sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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
#1   Old 30-Oct-08, 00:14   
Reply With Quote


J09's Avatar
J09 J09 is offline
Member
 
Join Date: Jan 2007
Posts: 1,460
Awesome!! I can't get real deep into this now, but I'll be back for more!
............................................
Resources
#2   Old 30-Oct-08, 01:17   
Reply With Quote
fatfinger's Avatar
fatfinger fatfinger is offline
Donating Member
 
Join Date: Jan 2007
Location: Melbourne, Australia
Posts: 472
Thanks for sharing, that looks really interesting! Are their any compiled binaries of MBDyn?
#3   Old 30-Oct-08, 01:27   
Reply With Quote
cekuhnen's Avatar
cekuhnen cekuhnen is offline
Member
 
Join Date: Mar 2003
Location: Grand Rapids, Michigan, USA
Posts: 6,217
mh this looks very impressive - when all objects are automated boy this could be very handy for a lot of product animations.
............................................
C l a a s E i c k e K u h n e n
Artist : Designer : Educator
#4   Old 30-Oct-08, 01:43   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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
#5   Old 30-Oct-08, 01:45   
Reply With Quote
fatfinger's Avatar
fatfinger fatfinger is offline
Donating Member
 
Join Date: Jan 2007
Location: Melbourne, Australia
Posts: 472
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.
#6   Old 30-Oct-08, 03:45   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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
#7   Old 30-Oct-08, 03:52   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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.
#8   Old 30-Oct-08, 12:30   
Reply With Quote
Atom's Avatar
Atom Atom is offline
Member
 
Join Date: Jan 2006
Location: Ohio
Posts: 5,129
Interesting.

Seems like a lot of setup work.
............................................
Windows XP 64, 3Gb RAM, nVidia 9500M GS

Blender 2.49.2, Python 2.64

2.49b Scripts:
Blendgraph
Meshfoot
Cubic Transition
APE

2.49b Scenes:
After Effects Stroke
Sea Tubes
Page Rip or Tear
Opening A Book
Single Page Turn
3DSMax Super Spray

#9   Old 30-Oct-08, 12:38   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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.
#10   Old 30-Oct-08, 16:29   
Reply With Quote
fatfinger's Avatar
fatfinger fatfinger is offline
Donating Member
 
Join Date: Jan 2007
Location: Melbourne, Australia
Posts: 472
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.
#11   Old 30-Oct-08, 23:11   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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.
#12   Old 31-Oct-08, 02:10   
Reply With Quote
scrag_10 scrag_10 is offline
Member
 
Join Date: Mar 2008
Posts: 474
does this take into account when/if the end of the propeller goes mach 1?
and the negative effects that come with that happening?
............................................
http://www.blender-materials.org rocks!
http://wiki.blender.org/index.php/Scripts/Catalog
#13   Old 31-Oct-08, 04:49   
Reply With Quote
fatfinger's Avatar
fatfinger fatfinger is offline
Donating Member
 
Join Date: Jan 2007
Location: Melbourne, Australia
Posts: 472
Quote:
Originally Posted by gdbaldw View Post
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.
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.
#14   Old 31-Oct-08, 09:13   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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.
#15   Old 31-Oct-08, 20:12   
Reply With Quote
Rinne's Avatar
Rinne Rinne is offline
Member
 
Join Date: Jun 2005
Posts: 300
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
#16   Old 31-Oct-08, 21:14   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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
2. Copy current mbdyn.exe to C:\Program Files\MBDyn\mbdyn.exe
3. Copy both scripts into C:\Program FIles\Blender Foundation\Blender\.blender\scripts
4. 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!
#17   Old 05-Nov-08, 18:24   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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.)
#18   Old 06-Nov-08, 07:40   
Reply With Quote
gdbaldw gdbaldw is offline
Member
 
Join Date: May 2004
Posts: 47
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
#19   Old 07-Nov-08, 17:23   
Reply With Quote
SHABA1 SHABA1 is offline
Member
 
Join Date: Mar 2002
Location: California
Posts: 1,457
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
............................................
At some point in life you stop being the man you are and start being the man you always wanted to be. ------ Bruce Springsteen.
#20   Old 07-Nov-08, 18:38   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 23:32.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists