Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Apologies if this has been answered before, but I could not find it by searching.
my plugin makes a null follow the matrix of another object. problem is that because of priorities unless the plugin object is after the "target" it is always one frame behind ( or it snaps on position when you refresh the viewport)
my plugin is based on ObjectData, and is a Generator, not a tag, so how do I go about changing the priority so that the code only runs after the target's matrix has been calculated?
i'd much appreciate a "dummies" explanation, as I am still only dipping my toes into programming and plugin dev
Many thanks, Eddie
Hi @Eduardo-Oliveira first of all welcome on the PluginCafe community.
I think @zipit already provided you some correct answers or at least point you that this workflow is kind of strange for a Cinema 4D user since normally the object by itself doesn't really set its own position, but it's up to a tag (constraint Tag) to define the object position to another one.
But in case you really want to do it, doing it in the Execute method of your ObjectData is fine.
def AddToExecution(self, op, list): list.Add(op, c4d.EXECUTIONPRIORITY_GENERATOR, c4d.EXECUTIONFLAGS_CACHEBUILDING) return True def Execute(self, op, doc, bt, priority, flags): op.SetMg(doc.GetFirstObject().GetMg()) return c4d.EXECUTIONRESULT_OK
You also need to ensure you registered your object with the flag c4d.OBJECT_CALL_ADDEXECUTION so AddToExecution and Execute are called.
Cheers, Maxime.
Hi,
while object nodes (i.e. ObjectData) also have a priority list, it is AFAIK only being used to determine the call order of ObjectData.Execute and not the order of any cache building. What you could do is:
ObjectData
ObjectData.Execute
OBJECT_INPUT
BaseObject
TagData
Cheers, zipit