Hello guys,
I'd like to add on a Digital Asset a control to be able to switch the parameter “block” of the nodes! Like a toggle to decide from outside if block or not a node inside the digital Asset! Is it possible? Can someone help me please…
Thanks a lot!
Block Parameter on Digital Asset
3811 5 2- 3Davide
- Member
- 5 posts
- Joined: 10月 2008
- Offline
- claudio_101
- Member
- 121 posts
- Joined: 7月 2008
- Offline
- 3Davide
- Member
- 5 posts
- Joined: 10月 2008
- Offline
Thanks but I think that this way can't work for me…
In my case I have a node in the CHOP Network that needs to be blocked otherwise it will reloads everything everytime… but it needs to be unlocked sometime to let it load the new scene! I'd like have the control of that red botton on the Digital Asset! Is it possible?
In my case I have a node in the CHOP Network that needs to be blocked otherwise it will reloads everything everytime… but it needs to be unlocked sometime to let it load the new scene! I'd like have the control of that red botton on the Digital Asset! Is it possible?
- claudio_101
- Member
- 121 posts
- Joined: 7月 2008
- Offline
Then you can do it with python with the function setUnloadFlag(). (hou.ChopNode [sidefx.com])
Available for new projects
- 3Davide
- Member
- 5 posts
- Joined: 10月 2008
- Offline
- claudio_101
- Member
- 121 posts
- Joined: 7月 2008
- Offline
Hi Davide,
Instead of doing it with the setUnloadFlag I did it with the bypass() function.
First thing I did was create a HDA in CHOPS and added a toggle parameter called “Block”.
On that parameter I set the following callback script.
kwargs.hdaModule().bypass(kwargs)
Then in the script tab of the HDA you'll find a little script that is called by the callback script and sets the bypass flag of every node that begins with BYPASS. If you add new nodes in the HDA with the prefix BYPASS you'll see that they change also.
import re
def bypass(node):
# Unlock Asset
node.allowEditingOfContents(True)
#Loop through every child of the HDA
for child in node.children():
#If part of the name of the node matches BYPASS go on
if re.match(“BYPASS?”, child.name()):
# If there is a child that starts with the name BYPASS
# then check if the bypass flag is checked.
# If it is checked then set it to off
if child.isBypassed():
child.bypass(0)
# Else if it's not checked then set it to on
else:
child.bypass(1)
Instead of doing it with the setUnloadFlag I did it with the bypass() function.
First thing I did was create a HDA in CHOPS and added a toggle parameter called “Block”.
On that parameter I set the following callback script.
kwargs.hdaModule().bypass(kwargs)
Then in the script tab of the HDA you'll find a little script that is called by the callback script and sets the bypass flag of every node that begins with BYPASS. If you add new nodes in the HDA with the prefix BYPASS you'll see that they change also.
import re
def bypass(node):
# Unlock Asset
node.allowEditingOfContents(True)
#Loop through every child of the HDA
for child in node.children():
#If part of the name of the node matches BYPASS go on
if re.match(“BYPASS?”, child.name()):
# If there is a child that starts with the name BYPASS
# then check if the bypass flag is checked.
# If it is checked then set it to off
if child.isBypassed():
child.bypass(0)
# Else if it's not checked then set it to on
else:
child.bypass(1)
Available for new projects
-
- Quick Links