Using Blender to Simulate Physics

I considered various ways to create a specific physical simulation. What I'm trying to do is a 3D model of the body moving under the influence of various forces over time. Initially, I studied coding anything in C ++ using a physical engine (Bullet) and a 3d engine (Irrlicht). However, I noticed that Blender already allows you to do physical simulations, since Bullet is integrated with it (correct me if I am wrong). It seems like it would be much easier to design the simulation exactly the way I want it (with the Blender advanced GUI).

My problem is that I would like to use the simulation results (mainly x, y, z, pitch, roll, yaw bodies at each moment in time) to enter c / C ++ code (or another language if its much easier for of this). Can this be done using Blender? Is there a better software package for this that I don't notice? Thanks, any advice is welcome.

+6
source share
2 answers

I would use a Python script for this task, since Blender has a nice interface that receives / sets objects and their properties programmatically through .py files.

So, after you finish your animation, you can call the script to go through the frames and save the necessary data to a file.

The start of the doc can be found here: http://wiki.blender.org/index.php/Doc:Manual/Extensions/Python or here: http://wiki.blender.org/index.php/Dev:2.5/Py / API / Intro

There is a huge list of scripts worthy of viewing similar procedures. http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts

+2
source

As mentioned earlier, it would be very simple to use python for this. For a more specific use when using Blender, perhaps you should refer to the main Blender forum at www.blenderartists.org

Python support for Blenderartists: http://blenderartists.org/forum/forumdisplay.php?11-Python-Support

Blender 2.5 code snippets (Introduction to scripting for Blender 2.5): http://blenderartists.org/forum/showthread.php?193908-Code-snippets.-Introduction-to-Python-scripting-in-Blender-2.5x

+1
source

Source: https://habr.com/ru/post/891046/


All Articles