THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/11/2009 at 06:49, xxxxxxxx wrote:
Cinema 4D Version: 10/11
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
I have an object that acts as a kind of effector (no MoGraph effector). The only thing it should do is building an array with data. It does not generate any geometry or virtual hierarchy whatsoever.
So I thought, I should build the data array in ObjectData::Execute(). But it seems that function is never being called.
What would be the right function to build some internal data? Since it's not a generator object I cannot use GetVirtualObjects()as I understood.
Thanks in advance.
On 11/11/2009 at 07:13, xxxxxxxx wrote:
simply use GetVirtualObjects(), build your data in it and return a null object (or not if you want constant reupdating).
On 11/11/2009 at 07:38, xxxxxxxx wrote:
But in the SDK it sais for ObjectData::GetVirtualObjects() : "Must not be overridden for non-generator objects." Should I simply ignore that?
On 11/11/2009 at 10:24, xxxxxxxx wrote:
Yes. I think the doc has a sense mistake there. It should say "Doesn´t have to be overridden.." instead of "Must not be overridden..". As long as you are returning an object I think it is safe (a simple null object is perfect for no output), I would dare to say that it´s safe to not return anything (null pointer) but this will really result in your object trying to recreate its caches for every update event that occurs in c4d (and that is a lot!). Depending on what you need and what data you process, it would then be wise to handle the updates yourself. Otherwise there is no reason why you shouldn´t use GetVirtualObjects().
On 11/11/2009 at 13:59, xxxxxxxx wrote:
On 13/11/2009 at 20:37, xxxxxxxx wrote:
Can you use the ObjectData::Message() function to build your array data? That seems to get called a lot.
If you want an object to call its Execute() function, you have to use the ObjectData::AddToExecution() first and add a priority for the execution:
virtual Bool AddToExecution(PluginObject* op, PriorityList* list)
By default this function returns FALSE. Then C4D will call Execute() at the priority specified by the user in the EXPRESSION_PRIORITY parameter of the container.
If you override this function and return TRUE, then you can insert your own points of execution in the list by calling for example:
list->Add(op, EXECUTION_ANIMATION, 0);
list->Add(op, EXECUTION_GENERATOR, 0);
CINEMA 4D will then call Execute() two times.
On 17/11/2009 at 05:46, xxxxxxxx wrote:
If the data has to be created just once put the data creation in an overloaded Init() method.