Tag plugin - adding childs to Cycle
-
On 24/08/2017 at 06:29, xxxxxxxx wrote:
Regarding creation from user data even if I think pgroof already understand it, but since there is no proper exemple for handle it, I would share a class I did for a plugin in order to help future readers.
https://github.com/gr4ph0s/RefractiveIndex-Importer/blob/master/res/src/UserData.py
And
https://github.com/gr4ph0s/RefractiveIndex-Importer/blob/master/RefractiveIndex.pyp -
On 24/08/2017 at 09:39, xxxxxxxx wrote:
Thanks, the cycle is now updated and indeed quite easy, thanks!
One questions:
I see that function GetDDescription is executed quite often.
So, I guess inserting the Cycle must be done somewhere else. For example in Init()?-Pim
PS one small error. The line "if not description.SetParameter(myCycleID, bcCycle, c4d.DescLevel(SWITCHFRAMESGROUP)) :" should have a DescID and not a DescLevel.
-
On 24/08/2017 at 09:40, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Regarding creation from user data even if I think pgrooff already understand it, but since there is no proper example for handle it, I would share a class I did for a plugin in order to help future readers.
Thanks you very much, very helpful!
-
On 24/08/2017 at 09:58, xxxxxxxx wrote:
https://github.com/gr4ph0s/RefractiveIndex-Importer/blob/master/RefractiveIndex.pyp
Look at the Message function and more specially about c4d.MSG_MENUPREPARE -
On 25/08/2017 at 00:40, xxxxxxxx wrote:
Great, thanks.
-
On 25/08/2017 at 00:43, xxxxxxxx wrote:
I guess GetDDescription is executed every time a description is changed?
Is that the only way to detect whether a different entry cycle is selected, or is there a message I can check.
-
On 25/08/2017 at 05:13, xxxxxxxx wrote:
Hello,
GetDDescription() is called every time Cinema is interested in the parameter description of an element. The edited Description it not stored anywhere so you have to define your custom parameter description every time GetDDescription() is called (since the parameter description can change at any time).
If you are interested when a parameter value changed you can implement NodeData.SetDParameter() or you can listen for the MSG_DESCRIPTION_POSTSETPARAMETER message.
best wishes,
Sebastian -
On 25/08/2017 at 06:43, xxxxxxxx wrote:
So, now I can update the children in the Cycle field.
In the tag plugin, message() is used to get the value to define a new child of Cycle.
I add the input to a List, that is used in GetDDescription to define the children of Cycle.However, how can I trigger GetDDescription to be executed, so the update Cycle is shown?
def Message(self, node, type, data) : if type == c4d.MSG_DESCRIPTION_COMMAND: if (data['id'][0].id == ADDCHILD) : data = node.GetDataInstance() child= data[CHILDINPUT] self.children.append[child] #used in GetDDescription to define the children of Cycle #now trigger GetDDescription to show the updated Cycle return True
-
On 25/08/2017 at 08:56, xxxxxxxx wrote:
Hello,
you can make the host object dirty be setting the dirty flag DIRTYFLAGS_DESCRIPTION. That should trigger GetDDescription () again.
best wishes,
Sebastian -
On 26/08/2017 at 05:10, xxxxxxxx wrote:
Thanks, it works if I set the tag to dirty using DIRTYFLAGS_DESCRIPTION.
_
_
-Pim