I'm creating a human baby AI in Blender, and am going to have it randomly generate actions and simultaneously move all its body motors.
Will python in Blender allow parallel programming?
I'm creating a human baby AI in Blender, and am going to have it randomly generate actions and simultaneously move all its body motors.
Will python in Blender allow parallel programming?
In Blender if you want to make use of multiple CPU cores for your scripts - look into multi-processing.
Since Python's threading does not take advantage of multiple CPU's and is mainly used so multiple tasks can run without one task blocking all the others.
Note that its questionable if you even need multi-processing for this task.
Also take a look at numba (jit accelerated Python which is compatible with Blender), it can give real speedups for numeric tasks and easier to integrate then alternatives.
I was looking at the question, and @Doyousketch2's answer and the subsequent discussion, and I think you are both talking around the issue. @FriendlyPerson44 is right that there are plenty of tasks that are computationally infeasible to do single-threaded (especially in real time) on currently modern hardware. @Doyousketch2 is also right that Blender shouldn't have to care because it should really only be communicating with anything (except for the isolated rendering pipeline) sequentially.
Your specific question: I don't know if Blender supports in process multi-threaded Python extensions, but I wouldn't recommend using them. Put anything multithreaded outside the Blender process.
Summary answer:
Details:
I hope this helps answer your concurrency questions with Blender
Just set it to iterate through each bone during every frame.
Move each one a fraction of the desired direction,
based upon the expected amount of frames for that motion.
Say his arm moves for 10 sec's @ 30 fps ...so 300 frames.
Lets say it starts with rotation X at 0°, and it'll end up at 60°
Every frame it moves 1/300th of 60° ...or 0.2°
If you want to get fancy, you can write a function
to ease the motion in and out.
But yeah, the trick to do it is called iteration, not parallel programming.