- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » modelica3D
modelica3D
modelica3D
Dear all,
I just switched to OM (Linux) and now try to start 3D multibody animations. Unfortunately, I can't start any of it.
According to the release notes, I would expect to have modelica3D implemented within the latest OM environment:
https://www.openmodelica.org/index.php/ … 0-released
"3D graphics visualization using the Modelica3D library."
Is the only way to start it via this instruction:?
https://mlcontrol.uebb.tu-berlin.de/red … stallation
I installed the nightly build for Linux. My error message from OMShell is:
Code:
>> loadModelica3D()
false
Error: Failed to load package ModelicaServices (3.2.1 modelica3d) using MODELICAPATH /usr/lib/omlibrary:/home/oli/.openmodelica/libraries/.
Thanks in advance!
Re: modelica3D
You probably didn't install the library:
Code:
$ apt-file find Modelica3D
omlib-modelicaservices-3.2.1-modelica3d: /usr/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Modelica3D/package.mo
- sjoelund.se
- 1700 Posts
Re: modelica3D
Dear sjoelund.se,
Thanks - you were quite right. Rather a noob request, I admit. I worked a lot with Dymola on Windows so far, but Linux is rather new to me...
Nethertheless, after some testing, 3d animation works nice! I managed to implement it via openscenegraph (OSG). Wasn't that easy to work out so I want to share my learnings:
Installation
1. Installation of modelica3D via Ubuntu Software-Center (Modelica Services...)
(Didn't see that coming at first place ,-)
Prepare System
2. Start the OSG script via the terminal:
Code:
python /usr/lib/omlibrary-modelica3d/osg-gtk/dbus-server.py
--> this script must be executed every time before starting a simulation in order to activate the animation
Start via OMEdit
3. Open OMEdit
4. Unload ModelicaServices (via right-Click on library)
5. Load ModelicaServices with working Modelica3D Library
File: /usr/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/package.mo
6. Load my multibody system model (e.g. myMBSmodel.mo)
7. Add modelica3D - keywords within myMBSmodel.mo head:
Code:
import M3D = ModelicaServices.Modelica3D;
inner M3D.Controller m3d_control;
8. Start simulation
-> OSG animation starts automatically in new window
Start via OMShell
(Remark that modelica3D-keywords must be added before starting the simulation - see step 7 above!)
3. Open OMShell
4. Load Modelica Library
Code:
loadModel(Modelica)
5. Load Modelica3D Library
Code:
loadModelica3D()
6. Load my multibody system model (e.g. myMBSmodel.mo)
Code:
loadFile("/home/myFiles/myMBSmodel.mo")
7. Start simulation
Code:
simulate(myMBSmodel,startTime=0.0,stopTime=3.0)
-> OSG animation starts automatically in new window
I did not manage to implement an animation with blender yet. Starting the blender script returns the error massage:
Code:
>>python /usr/lib/omlibrary-modelica3d/blender2.59/dbus-server.py
Traceback (most recent call last):
File "dbus-server.py", line 9, in <module>
from bpy import ops, data, context
ImportError: No module named bpy
There seems to be something wrong with my python script. I suppose, I need python 3 to implement it... Any tipps welcome.
Enjoy the mbs-animation so far. Thanks to the OM-Team, I appreciate your work!
Regards,
Oliver
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » modelica3D