6
$\begingroup$

I have need to do some 3D fluid piping simulations, and I am seriously considering Blender. I believe Blender is the right tool for the job, but I would like to confirm this before I dive in.

I want to skip the GUI tools as much as possible and instead use python to carry me initially (I want to avoid anything that needs the mouse). My goal is to set myself up for automation by building on Python right from the start. I am coming from AutoCAD, and I am hoping for a similar experience to AutoCAD command line with LISP (meaning, I don't have to touch the mouse if I don't want to).

  • Is Blender the right tool for what I want?
  • Should I consider alternatives like PyOgre (for a pure-python experience)?
$\endgroup$
5
  • $\begingroup$ Can you explain what you mean by Interactive Python Workflow? - Automation and interactivity are not mutually exclusive - but in this context I'm not sure how you intend to interact with blender without using the mouse, for eg. $\endgroup$
    – ideasman42
    Commented Sep 17, 2013 at 23:41
  • $\begingroup$ Meaning I would rather build my models one line at a time rather than one click at a time. I will very likely still need the mouse and some of Blenders visual aids, but am hoping to assembly my project from a python interactive session. $\endgroup$ Commented Sep 17, 2013 at 23:55
  • $\begingroup$ do you mean you would want to build your models in python getting feedback from changes for each line of script executed? $\endgroup$
    – ideasman42
    Commented Sep 18, 2013 at 2:03
  • $\begingroup$ Basically yes. I have been digging through the 2.5 py-cookbooks, and I think I like what I see. The API is a little more verbose than I had hoped, but I should get over that soon enough. My first py-module might be a set of PROXY functions similar to AutoCAD commands. Then I can just start hacking away on my model. $\endgroup$ Commented Sep 18, 2013 at 2:38
  • $\begingroup$ You shouldn't repeat your questions in multiple SE sections. $\endgroup$
    – sambler
    Commented Sep 18, 2013 at 5:33

1 Answer 1

3
$\begingroup$

Yes, as long as Blender has the functionality you need, I would say automation in Python is one of Blenders strengths.

In fact Blender's SPH fluid simulator was developed/improved by a company who made a product that did automated fluid simulation that ran on a supercomputer to test fluids behavior in through different pipes/containers for a commercial project. But you can automate many other tasks too. see AutoCRC (bottom of credits page link).

Blender can for example be compiled without a user interface, as a Python module (or just run release builds in background mode), and perform automated physics simulations, video editing, rendering, file format conversions, mesh processing - etc.

There are some caveats though:

  • Not every area of Blender has been used in automation, if you try to automate something that nobody tried before, you mileage may vary
    (fluid simulation should go fine, but some areas rely on a user interface - game engine or sculpting for eg).
  • Its best to first use the interface to setup tasks before automating.
    From your questions it sounds like you may want to avoid using Blender at all? I think its not wise to avoid using the UI at least for testing steps to be automated.

As a starting point for automation in Blender, I'd recommend see the Background Job template. See:
Text Editor -> Templates -> Background Job. This means you can run Blender from the command line to execute the task.

Another example (based on that template) that renders FBX files from the command line.

Any pure-python solution depends totally on the python-modules available to use, I wasn't aware of PyOgre being able to do fluid simulation - and am not familiar with fluid simulation in Python in general, so its hard to answer this part of your question.

Note:

Your question asks "for a beginner", I wouldn't consider this a beginner project, and I don't think being a beginner makes any difference to the answer. This stuff you have to learn one way or another and if you are a beginner you may just take longer to figure it all out.

$\endgroup$
2
  • $\begingroup$ I do plan on having the GUI running at all times. I said pure python as an extreme, but I expect for some staging and project management I will learn parts of the GUI. What I meant to say, was I want a strong Interactive Python experience. $\endgroup$ Commented Sep 17, 2013 at 23:34
  • $\begingroup$ Note, Im not actually simulating fluid dynamics (maybe one day). For now I was just going to use Particle systems confined to a pipeline geometry (which PyOrge can do). $\endgroup$ Commented Sep 17, 2013 at 23:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .