Multibody Dynamic Simulation - Available Now

Yes, its a mouthful – Multibody Dynamic Simulation. It simply means that you add gravity and air properties to your Blender environment, add physical and aerodynamic properties to your collection of Blender Objects, and then watch how it all behaves by simulating physics, mechanics, kinematics, aerodynamics, aeroelastics, etc. Some really smart researchers in Milan, Italy have been working on the open source code for over a decade, and now their code which is called MBDyn is hooked into Blender. The Python script and a video tutorial are available. Even if multibody dynamics is not your thing, the approach to adding attributes to Blender objects using context sensitive menus may be useful for your next Python script. You can download the source from here, and/or view the 17.5 minute tutorial on the lower part of the home page at this website. The MBDyn code was developed at Politecnico de Milano, and is available here.

Enjoy.
Doug

Awesome!! I can’t get real deep into this now, but I’ll be back for more!

Thanks for sharing, that looks really interesting! Are their any compiled binaries of MBDyn?

mh this looks very impressive - when all objects are automated boy this could be very handy for a lot of product animations.

By the way, made one minor change to script a few minutes ago and reposted.

MBDyn current source is here and some older precompiled binaries are available here.

I’ve only compiled most current source on Debian, so can’t vouch for the precompiled binaries.

Doug

O.K., I’ve downloaded one of the windoze binaries, which seems to work. Just one question, how do you make mbDyn accessible from Blender, as it says in the script? Thanks again.

In Linux, you’d copy the executable into /usr/local/bin, or some such place. For windows, not sure of the answer to your question. If you must use a C:… prompt, you could edit the line in mbdyn_gui.py

Just noticed that Sourceforge presented only one of the two scripts at its main download page. Corrected to now show both mbdyn.py and mbdyn_gui.py. Both scripts are needed to run the application.

Interesting.

Seems like a lot of setup work.

Setup on Linux requires compilation of MBDyn, a C program.

After that, just use the script like it was any other Python script.

As for Windows, it was reported above that the precompiled mbdyn binary works. Seems that as long as this binary is in your executables path (i.e. saved in a folder with other executables), it would be accessible to Blender. Then, use the two mbdyn scripts like any other Python script.

If you are more comfortable running Python from the Blender Text Window, copy the mbdyn.py file into a folder that is in the Blender scripts path, then copy the mbdyn_gui.py file into a Text Window and press Alt-P.

By works, I mean it didn’t throw up an error when I double clicked it. The binary I’m using is mbdyn-msys-2008-03-27.exe. The later one kept asking for cygltdl-3.dll, I d/l’ed Cygwin, but to no avail. Just for the record, when I try to run the script, the command window says it doesn’t recognise mbdyn, the script needs some modification to call the exe in Windows. I know it’s possible (Yaf(a)ray, Lux etc.) to call an executable from a python script, I just don’t know how to do it. Any help from someone who can write Python would be greatly appreciated. Thanks.

As a quick fix for Windows, you might uncomment line 161, and then comment out line 162 of the mbdyn_gui.py script

161 # error = call([‘mbdyn’, ‘-s’, ‘-f’, mbdyn.filename])
162 error = runAsync(mbdyn.filename)

You could then change…
call([‘mbdyn’, ‘-s’, ‘-f’, mbdyn.filename])

to something like…
call([‘C:\Windows\Programs\mbdyn.exe’, ‘-s’, ‘-f’, mbdyn.filename])

The only feature lost by switching from 162 to 161 is the Progress Bar while mbdyn is executing. In that case, Blender will not respond until mbdyn has finished executing is simulation.

does this take into account when/if the end of the propeller goes mach 1?
and the negative effects that come with that happening?

That’s the ticket! Thanks for that. I got it working and now I’m trying to work through your video tutorial, I’m getting some errors from mbdyn, but I’m not sure if I did everything correctly. At least that shows it’s working. Good show, thanks again.

Sweet! Order of object selection in the tutorial is important. Make sure you have the correct active object before adding the attribute. Look for which object is brighter in the tutorial, and then double check by looking at the names in the Pop Up Block.

As for checking mbdyn, try this. From a new Scene with one Cube, select the Cube and make it a Body. Then create a Gravity element. This should run ok. After pressing Display and then animating, the Cube will drop. (When you start the animation, make sure you are looking at a side view relative to you gravity vector.) If you have an error, check the Windows console and let me know what it says.

I don’t know if I totally got what happened in that tutorial video, or if I’ll need it in the near future, but it might very well be the most impressive thing I’ve seen so far in a GFX programme

Now works on MS Windows!

Tested on Vista, so I expect the script will work on all Windows platforms.

Simple install procedure:

  1. Blender 2.47+ with Python 2.5.2+
  2. Create this program directory, C:\Program Files\MBDyn
  3. Copy current mbdyn.exe to C:\Program Files\MBDyn\mbdyn.exe
  4. Copy both scripts into C:\Program FIles\Blender Foundation\Blender.blender\scripts
  5. In Blender Python Window, click Scripts -> Update Menus

Hotlinks to files:
—Current mbdyn.exe (Note: This is an executable. You may first check the site here)
—Python scripts

One usage note: A simpler method for locating Bodies was implemented. Instead of typing in an offset vector, use a Rigid Element to position and orient a Body relative to any other Element.

Enjoy!

A new, simple tutorial is available for animating Suzanne the Monkey, swinging on a rope with a friend.

The script should now work in both Linux and Windows.

New tutorial is at http://www.baldwintechnology.com/blender.html (No audio yet, but should be useful as is.)

The above tutorial, Swingin’ Suzanne, illustrates what in physics is called the double pendulum problem. An audio voice track has been added to explain the tutorial.

Also, a new 7 minute video tutorial is available showing how to quickly model a Glider Airplane, give it mass and aerodynamic features, and add gravity and air properties to the environment. Then, the glider is launched at an initial velocity and the simulation is run. This tutorial can be viewed at www.baldwintechnology.com/blender.html .

By the way, over 100 copies of the scripts have been downloaded from Sourceforge. I’d appreciate feedback either in this Forum or as PM from anyone who has attempted to use these scripts.

Enjoy,
Doug

Summary in two words: Too complicated

I am sure you know what you are talking about. But I got lost as soon as you started talking my EM BEE DYN. You need to explain this script and what it does in simple 3d artist non programmer and no physics student terms