Hi there,
If toggle button =1 then create a node else if toggle button=0 then delete it
the given below is the code I tried.Please let me know the solution.
It works only when the script is run,and the node doesnt get deleted or created after the script is created.
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()