Tutorial: Creating Objects Dynamically using Scripting

It is useful to be able to place objects using scripting, for example to load levels from files, and so create compound objects made from various components. This tutorial describes a basic setup for this. It includes a PDF and an example blend file. The written tutorial assumes programming knowledge, but you might still benefit from the code in the example blend file.

http://www.luma.co.za/labs/DynamicObjectCreation.zip (100 KB)

I don’t claim this to be the best solution to the problem, so please let me know what you think.


I’m still looking this over. It takes me a while for things to sink in. Could this method be used for loading a mesh from a file or not?

Excellent work as usual, Herman. I don’t think the slow building of the level is that big of a problem, since the curtain could be used to your advantage. Why not turn it into a loading screen? This would be very easy to do if you could simply get the number of objects that need to be loaded and keep a running counter as they are being added. Run a simple calculation to find the percentage, then just combine it with goldentaiji’s healthbar tutorial to make a functional and accurate progressive loading screen.

I actually think that watching a level building would be much better than a loading screen.

Anyway, this is a very decent document.

Good job herman.

@fireside: Not as is (I am not sure it is possible at all…). All the objects need to be in hidden layers of the scene.

@blendenzo, Social: thanks, cool ideas.