I’m thinking about starting on my first Python scripting project (a two parter). I’ll set it out for you and see if it’s even possible before I invest the time. Also, any pitfalls you can see.
Overview of script 1: an object randomization script. You select the objects that you want to have randomized, enter your parameters in the script (max/min/progression type) for local x,y,z, rotations and scales. The script then randomly varies the objects’ locations/rotations/scales based on the provided criteria. This would be good for making “natural” distributions of objects, like pebbles in a stream, trees in a forest, etc.
Overview of script 2: an object orientation script. This script would orient any object that conformed to a defined naming convention (“Tree*”) toward the camera, on a definable axis basis. You would only rotate the object along it’s local “up” axis. It’s sort of like a standard track relationship, but effected on many objects at once and contrained to rotation along a single axis.
The whole point of this is to mimic trees in a forest. This is the same technique used in the animated short “The Hunt”, which, if you haven’t seen it, is incredible. You can find a link to it from http://www.cgchannel.com. All of the forest flyovers are done with exactly this technique, rectangles with image/alpha mapped trees, via a plugin for 3DSMAX, and it looks phenomenal. As far as I can see, this would not be horribly difficult to reproduce for Blender with Python.
So what you would need (I think) would be the ability to:
- Look up objects based on their name
- Access and manipulate the coordinate/rotation/scale data for those objects
- Recheck the orientation on a frame-wise basis to make sure the objects always face the camera.
That’s it. Is this possible? From what I know about programming, it seems that this would not be a horribly difficult set of scripts to write. BTW, if you’re skeptical about the power of this technique, I strongly encourage you to check out “The Hunt”.
Also, does anyone know of scripts with similar functionality (even the update-per-frame thing) that I could take a look at?
Thanks. Oh, I’m planning to proceed even if no one responds. I was just hoping to make the way a bit easier before I begin.