THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/08/2011 at 08:34, xxxxxxxx wrote:
Cinema 4D Version: R12
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
Is it possible to set the execution order of generators? I'm thinking of the example of the Mograph tracer. Here you have a generator (an emitter) inside another generator (the tracer). It seems that the emitter always generates particles before the tracer generates splines - if it didn't you'd get a gap between the particle and the spline.
This is exactly what's happening to my plugin. I've got an emitter and my own tracer object, both using GetVirtualObjects to generate the particles and splines respectively. If the tracer is *below* the emitter in the OM, everything is fine because the emitter GVO is called before the tracer GVO. If the tracer is above the emitter, there's a slight gap between the end of the spline and the particle, because the tracer is always one frame behind the emitter.
What I'd like to do - if it's possible - is to force the tracer always to generate after the emitter so it uses the up-to-date particle position to generate the spline. I could force the user to make the tracer a child of the emitter, which would work, but I'm using a link field at the moment and for various reasons I'd like to keep it like that.
I've see this thread - https://plugincafe.maxon.net/topic/5044/4968_using-prioritylist - but it doesn't really help. Is there a way to do this reliably (since the Mograph tracer does it I'm hoping there is)?
On 26/08/2011 at 08:55, xxxxxxxx wrote:
The priority list sets the order of operation (in general). C4D processes things in a certain order (such as animation, expressions, generators, etc.). You can tell your plugin when it should be processed. The thread linked from your linked thread is more explanatory:
On 26/08/2011 at 14:17, xxxxxxxx wrote:
Thanks Robert. Yes, I read that thread too, but I still wasn't (am not) sure about how this is supposed to work. Still, if it's the priority list I need to look at, then that's a great starting point, so many thanks for confirming that.
On 26/08/2011 at 15:45, xxxxxxxx wrote:
Hm, tried this and still can't get it to work. I can add the PRIORITY description element to both objects, read/write data to those elements and use it in ObjectData::AddToExecution() but it doesn't make any difference.
My understanding from the SDK is that AddToExecution affects the order in which ObjectData::Execute for different objects is called, but all my object generation is done in GetVirtualObjects, so I'm not sure how the AddToExecution call affects this.
Still puzzled about how to get this to work. Is what I'm trying to do even possible?
On 28/08/2011 at 07:39, xxxxxxxx wrote:
Have you tried to generate your virtual objects in the Execute() function and hold them in memory waiting for GetVirtualObjects() to be called?
On 28/08/2011 at 08:02, xxxxxxxx wrote:
Thanks Dan. That's a good idea, I didn't realise you could do that. I'll give it a try!.
On 28/08/2011 at 08:25, xxxxxxxx wrote:
Interesting idea. Darn you Dan. (Dan, you darn?) ":)
On 29/08/2011 at 05:52, xxxxxxxx wrote:
Hehe, I was outside of the box when I thought of that one.