hey guys,
i searched for this quite a lot but without results -
is it possible to automatically set the display flag to the latest created node?
regards,
Manuel
is this really a stupid question? display flag problem
8611 15 1- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
When you perform operations using the viewport/shelf it pretty much always sets the display flag on the latest node. However, if you want it to ALWAYS happen I'd probably just add a global OnCreated script that always sets the display flag when a node is created. This of course has the downside of if you just put down a random Sop for example and don't want to connect it to anything, or you are trying to insert one into a chain, or branch off of one you probably don't want to be changing the flag but I guess it's up to how you want to run things.
Something like this would work
OnCreated.py in $HOME/houdiniX.Y/scripts/
node = kwargs
if hasattr(node, “setDisplayFlag”):
node.setDisplayFlag(True)
if hasattr(node, “setRenderFlag”):
node.setRenderFlag(True)
Something like this would work
OnCreated.py in $HOME/houdiniX.Y/scripts/
node = kwargs
if hasattr(node, “setDisplayFlag”):
node.setDisplayFlag(True)
if hasattr(node, “setRenderFlag”):
node.setRenderFlag(True)
Graham Thompson, Technical Artist @ Rockstar Games
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
thing is, i hardly create the nodes via viewport or the shelf, mostly directly in my networkview with the tab key. that's a very fast way to work, the only thing that bothers me is to permanently have to switch the display flag >.<
Doing it with a script brings exactly the problems you mentioned so i'd rather leave it as it is … ?!
Doing it with a script brings exactly the problems you mentioned so i'd rather leave it as it is … ?!
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
After thinking about it further and knowing exactly what it is you are going for I'd do it with an OnInputChanged script that basically looks at the first input node, if it exists, and if that node has the display and/or render flags set then it sets them on the node.
OnInputChanged.py
node = kwargs
idx = int(kwargs)
# Only care about the first input.
if idx is 0:
# Get the node connector for input 1.
connector = node.inputConnectors()
# If there is a connection.
if len(connector) > 0:
connection = connector
# Get the connected node.
input_node = connection.inputNode()
# Guard against node types that don't use these flags.
if hasattr(node, “setDisplayFlag”):
if input_node.isDisplayFlagSet():
node.setDisplayFlag(True)
if hasattr(node, “setRenderFlag”):
if input_node.isRenderFlagSet():
node.setRenderFlag(True)
OnInputChanged.py
node = kwargs
idx = int(kwargs)
# Only care about the first input.
if idx is 0:
# Get the node connector for input 1.
connector = node.inputConnectors()
# If there is a connection.
if len(connector) > 0:
connection = connector
# Get the connected node.
input_node = connection.inputNode()
# Guard against node types that don't use these flags.
if hasattr(node, “setDisplayFlag”):
if input_node.isDisplayFlagSet():
node.setDisplayFlag(True)
if hasattr(node, “setRenderFlag”):
if input_node.isRenderFlagSet():
node.setRenderFlag(True)
Graham Thompson, Technical Artist @ Rockstar Games
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
While you can put the file in your Houdini install directory, $HFS/houdini/scripts/, you should put it in your Houdini config directory, which on Windows will be something like My Documents/houdini10.0/scripts/. By default the OnInputChanged.py file doesn't exist already, and you probably won't have a scripts directory either so you'll have to create them both.
Graham Thompson, Technical Artist @ Rockstar Games
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
okay at least i got the script running now, unfortunately it's not 100% working,
it has problems with some nodes (i.e. the pointsfromvolume SOP).
Gives me the following error:
it has problems with some nodes (i.e. the pointsfromvolume SOP).
Gives me the following error:
Traceback (most recent call last):
File “CDOCUME~1/ADMINI~1/MYDOCU~1/houdini10.0/scripts/OnInputChanged.py”, line 27, in <module>
node.setDisplayFlag(True)
File “Ehoudini/HOUDIN~1.430/houdini/scripts/python\hou.py”, line 21090, in setDisplayFlag
return _hou.SopNode_setDisplayFlag(*args)
PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions
Traceback (most recent call last):
File “CDOCUME~1/ADMINI~1/MYDOCU~1/houdini10.0/scripts/OnInputChanged.py”, line 27, in <module>
node.setDisplayFlag(True)
File “Ehoudini/HOUDIN~1.430/houdini/scripts/python\hou.py”, line 21090, in setDisplayFlag
return _hou.SopNode_setDisplayFlag(*args)
PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
Sorry about that. I didn't test it with a digital asset.
In the case of assets and their indirect inputs, when the parent nodes input changes, it propagates down to the nodes inside that asset that look to that parent input for their input. In this case Houdini is attempting to change the flag on the first node in the asset but it is locked. I've updated the script to make sure the node isn't inside a locked digital asset.
In the case of assets and their indirect inputs, when the parent nodes input changes, it propagates down to the nodes inside that asset that look to that parent input for their input. In this case Houdini is attempting to change the flag on the first node in the asset but it is locked. I've updated the script to make sure the node isn't inside a locked digital asset.
Graham Thompson, Technical Artist @ Rockstar Games
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
great, many thanks!
Now it workes flawlessly and makes creating nodes inside the network view a lot more easier for me! Maybe one day i'll dare to have a look at scripting stuff, too! for the moment i'm quite happy that i got comfortable with expressions
I'm excited about your website, when are you going to relaunch it?
Now it workes flawlessly and makes creating nodes inside the network view a lot more easier for me! Maybe one day i'll dare to have a look at scripting stuff, too! for the moment i'm quite happy that i got comfortable with expressions
I'm excited about your website, when are you going to relaunch it?
- aiworks
- Member
- 130 posts
- Joined: April 2009
- Offline
Hmmm… and I'd suggest yet another approach, if you use network pane to add nodes:
Add a NULL to the end of your network, and move it a way down, to leave plenty of space above it. Set the display/render to the above NULL.
Set selection to any earlier node (the point where you are working). From now on, you should be able to add new nodes, the selection should move on automatically, while the display should stay at the ending NULL.
One other thing you might want to configure with this approach is the display settings in the 3d viewer (“d” key") - you can e.g. set current/selected to wireframe, so that the selected node generates only a wireframe view, while the shaded/flat/your preferred view stays on the final NULL. This is, as far as I've learned, the only way to work efficiently with subdivided polygons - viewing the subdivided, smooth result, while being able to manipulate the undivided polys/edges/verts.
Cheers,
Greg
Add a NULL to the end of your network, and move it a way down, to leave plenty of space above it. Set the display/render to the above NULL.
Set selection to any earlier node (the point where you are working). From now on, you should be able to add new nodes, the selection should move on automatically, while the display should stay at the ending NULL.
One other thing you might want to configure with this approach is the display settings in the 3d viewer (“d” key") - you can e.g. set current/selected to wireframe, so that the selected node generates only a wireframe view, while the shaded/flat/your preferred view stays on the final NULL. This is, as far as I've learned, the only way to work efficiently with subdivided polygons - viewing the subdivided, smooth result, while being able to manipulate the undivided polys/edges/verts.
Cheers,
Greg
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
-
- Quick Links