Jump to content

callback script


Hello world

Recommended Posts

I want to add and delete a node when I select a toggle.I think this could be done in the call back script in type parameters.

the given below is the code I ve tried

hp=hou.node('/obj').createNode('shopnet','test') 
test1=hou.ToggleParmTemplate('a','test1t',1) 
hp.addSpareParmTuple(test1,('General test',),True) 

toout=hou.node('out').createNode('shopnet','test1') 
test2=hou.ToggleParmTemplate('b','test2',1) 
toout.addSpareParmTuple(test2,('General test',),True) 
test2t=hou.node('out/test1/') 
test2t.parm('b').setExpression('ch("/obj/test/a")') 

if(test2t.evalParm('b')==1): 
tout1=hou.node('out').createNode('ifd','mantraworking') 
else: 
tout11=hou.node('/out/mantraworking') 
tou1=hou.node('obj/mantraworking') 
tou1.destroy()

for some reason it doesnt work.do i need to type all these code in the call back script field?

could anyone please correct me.

thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...