Plugin not updating with frame advance rendering

On 29/10/2014 at 09:52, xxxxxxxx wrote:

Actually just discovered that a Python Generator will do pretty much everything I need.  Will pursue this and see what happens, seems much simpler than trying to write a full plugin.

On 29/10/2014 at 12:05, xxxxxxxx wrote:

Might have to go back to the plugin route - having a problem with the python generator - any advice on this...

Basically my script inside the generator creates geometry every frame - but also uses a CallCommand to make editable the objects.  For some reason the CallCommand only seems to work once when first executed, but not again thereafter.  Have no idea why!

If I can get the generator to work, or understand how getvirtualobjects works in a plugin, i'll be happy..

On 29/10/2014 at 16:45, xxxxxxxx wrote:

Okay - I've learned that SendModelingCommand is much better for me than CallCommand.  So things are going well..

On 29/10/2014 at 17:25, xxxxxxxx wrote:

Ooh another little problem - I also need to use the 'Connect Objects' command - but it's not available with SendModellingCommand.  It can be called with CallCommand - but as I said - I can only get CallCommands to execute once when using within a generator.
How would I go about merging lots of objects into a single mesh otherwise?

On 30/10/2014 at 02:20, xxxxxxxx wrote:


A generator works by creating objects and returning them in GetVirtualObjects (). To return multiple objects simple create a parent object and make the other objects children of that parent. These objects are not permanently added to the scene; for every call of GetVirtualObjects() all objects have to be re-created.

Since GetVirtualObjects() works with virtual objects and is called in a thread context, CallCommand and SendModellingCommand may not work correctly or may not be available. The Python generator also creates it's geometry in a GetVirtualObjects() functions, so there in no difference between the generator and a plugin.

For an example how to use GetVirtualObjects() and how to handle rough polygon data please take a look at the RoundedTube example. You may also have a look at the "Atom" example in the C++ SDK.

best wishes,

On 30/10/2014 at 02:39, xxxxxxxx wrote:

Thanks very much Sebastian for the help as usual,
Last night I managed to get GetVirtualObjects to create all my hierarchy of objects - no problem - but for example if I want the positions of the objects to randomise every frame when rendering - It's stuck on the first frame - so I need to know how the plugin can make a call every frame somewhere to update the positions of the objects.

p.s. I discovered MCOMMAND_JOIN which will allow me to connect objects (not related to above problem)

On 30/10/2014 at 09:31, xxxxxxxx wrote:


GetVirtualObjects() is called very often so there are mechanisms that make sure your generator only re-creates it's result when something (like a parameter) changed. You can use SetOptimizeCache() to let the plugin itself decide if the generator should generate new geometry.

Another way is to manage it yourself with the "old" method of checking the cache and the dirty state. There you can also check if the frame changed (look at this example). If the frame changed, you can rebuild your geometry.

best wishes,

On 30/10/2014 at 10:44, xxxxxxxx wrote:

Thanks for that, useful to know - at the minute though it looks like I can get a good old python tag to do everything I need.  Workflow is much simpler this way.
Appreciate all the help on these forums,
Here's what I'm working on if it's of interest - I'm a 'generative artist'..


On 31/10/2014 at 01:01, xxxxxxxx wrote:

Hello Glenn,

very impressive work. Just one thing: Cinema introduced Python support in Release 12 four years ago, not just "recently".

For your purposes you may also take a look at the Python Mograph Effector.

best wishes,

On 31/10/2014 at 01:38, xxxxxxxx wrote:

haha - I've been out of the '3d' game for too long - I'm just catching up with how everything has progressed!