c4d.EventAdd() [SOLVED]
-
On 12/12/2014 at 09:03, xxxxxxxx wrote:
I have a python tag from witch I run my script.
To keep it simple say I use this:tip_enable = [1200]
tip_disable = [1100,1300,1400]
#enable morphs in Top_Morph
for item in tip_enable:
tip_L_01.GetFirstTag()[4000,item] = True
#disable morphs in Top_Morph
for item in tip_disable:
tip_L_01.GetFirstTag()[4000,item] = False
c4d.EventAdd()Now my problem is I want to work this from a Radio Button, but "c4d.EventAdd()" will keep on executing while that Radio Button is active. I want c4d to update only once even though the Radio Button is active.
Is this possible???
-
On 12/12/2014 at 10:04, xxxxxxxx wrote:
Hello,
can you explain what you mean with "work this from a Radio Button"? A Python tag's "main" function will be called every time the document or the host object will be calculated.
Best wishes,
Sebastian -
On 12/12/2014 at 18:41, xxxxxxxx wrote:
Sorry Sebastian, what I meant was "Python Node"
if cntrl_obj[c4d.ID_USERDATA,7] == 0: #Radio button
tip_enable = [1200]
tip_disable = [1100,1300,1400]
#enable morphs in Top_Morph
for item in tip_enable:
tip_L_01.GetFirstTag()[4000,item] = True
#disable morphs in Top_Morph
for item in tip_disable:
tip_L_01.GetFirstTag()[4000,item] = False
c4d.EventAdd() -
On 15/12/2014 at 11:07, xxxxxxxx wrote:
Hello,
so if I understand you correctly you have a Python Xpresso node and want that some code only executes once after some userdata of some object was changed.
I suggest that you could store the old value of your control parameter in another user data parameter of your control object. So you can check if the current value is different than the stored value. Also this way the stored value will be saved with the control object.
Best wishes,
Sebastian -
On 15/12/2014 at 19:39, xxxxxxxx wrote:
Thanks Sebastian. I simply rescript to use "conditions" to run and stop my script
-
On 16/12/2014 at 04:03, xxxxxxxx wrote:
You should not call c4d.EventAdd() from Tag or Node. There should
be no need for it. Please explain why you think you need it. -
On 16/12/2014 at 04:46, xxxxxxxx wrote:
With English not my first language its hard to explain, but my objects did not want to update without the c4d.EventAdd(). With c4d.EventAdd() it worked fine but it kept on updating witch slowed things down. But after restructuring my script so that it only runs in certain conditions everything is fine now.
Thanks