Value Driven Effector not updating? [SOLVED]
-
On 18/05/2016 at 06:49, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 16
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;---------
Hi,I want my value driven effector to be updated on each frame. How is this accomplished? I have no other object dependency so cannot use AddEffectorDependence().
Thanks!
-
On 18/05/2016 at 06:55, xxxxxxxx wrote:
Howdy,
Maybe in a MessageData plugin?
Adios,
Cactus Dan -
On 18/05/2016 at 07:03, xxxxxxxx wrote:
Thanks Dan first of all!
I rather not want to create a plugin to update a plugin though.I mean the random mograph effector for example, it updates automatically each frame. I don't think C4D is updating this from the outside? So there must be an "internal" way of saying "do update!".
I could detect temporal changes manually, so is it for example safe to just set my effector dirty?
I would assume that AddEffectorDependence() is doing this when the linked object is dirty (but it would help to know from where e.g. InitPoints() is called in the first place).Cheers
-
On 18/05/2016 at 10:27, xxxxxxxx wrote:
Howdy,
What about the Execute() function?
Adios,
Cactus Dan -
On 18/05/2016 at 11:20, xxxxxxxx wrote:
Hey,
Can you elaborate? Not sure I understand. Is it called per frame only?
I was going from the noiseeffector example (https://github.com/PluginCafe/cinema4d_cpp_sdk/blob/master/source/object/noiseeffector.cpp) in the SDK (which does not use the Execute function but it does not require per frame updates).
-
On 18/05/2016 at 11:53, xxxxxxxx wrote:
Howdy,
No, but you could check to see if the frame has changed within the Execute function.
Adios,
Cactus Dan -
On 18/05/2016 at 13:30, xxxxxxxx wrote:
thanks Dan. However I am not sure if it is the right place because Execute() is called in a thread context.
And MoGraph uses the message system to execute the virtual functions it provides, so the question is, can it result in Execute() being called before the mograph function calls?Anyway, thanks to your pointer to the Execute() member I found ExecuteEffector() which is called first in the effector pipeline according to the docs. This seems like a valid place I guess.
Cheers!
-
On 18/05/2016 at 14:23, xxxxxxxx wrote:
I think CheckDirty() is also called for Effector plugins, and if you set your effector dirty, it should be re-evaluated.
Cheers,
Niklas -
On 18/05/2016 at 15:36, xxxxxxxx wrote:
Now this is of course even better! You are right, it can be overloaded for Effectors (I checked the API). Thanks Niklas!
-
On 19/05/2016 at 01:53, xxxxxxxx wrote:
Hello,
there is the flag EFFECTORFLAGS_TIMEDEPENDENT that might be used in such cases.
Best wishes,
Sebastian -
On 19/05/2016 at 07:02, xxxxxxxx wrote:
Thanks Sebastian. Excellent. Guess this is more than solved now.