Found 53 posts.
Search results Show results as topic list.
Technical Discussion » op:/ operator and Camera background image?
- jrcooper
- 59 posts
- Offline
Unfortunately, this still does not work. I've tried it with 18.0, 18.5, 19.0, and 19.5 and it fails in the same way in all of them. I just don't think this is a feature they ever intend to support. Which is strange because the COP2 image appears as the background in the viewport when you look through the camera.
Technical Discussion » Trouble with custom SideFXLabs deployment
- jrcooper
- 59 posts
- Offline
Yes, this works for us with full UNC network paths. In fact, our SIDEFXLABS entry actually looks more like this:
Where $DEPLOY_ROOT is a custom environment variable set by our application launcher to a Windows-style path (e.g., "N:/global") when the host machine is a Windows machine, and to a Linux-style path (e.g., "//netfsmnt/global") when the host machine is a Linux machine.
"SIDEFXLABS": "${DEPLOY_ROOT}/houdini/packages/18.0/SideFXLabs/${sidefxlabs_current_version}"
Where $DEPLOY_ROOT is a custom environment variable set by our application launcher to a Windows-style path (e.g., "N:/global") when the host machine is a Windows machine, and to a Linux-style path (e.g., "//netfsmnt/global") when the host machine is a Linux machine.
Technical Discussion » Trouble with custom SideFXLabs deployment
- jrcooper
- 59 posts
- Offline
I believe the way we got this working was by modifying the SideFXLabs.json file to look like this:
Where
{ "env": [ { "sidefxlabs_current_version": "1.205" }, { "SIDEFXLABS": "N:/global/houdini/packages/18.0/SideFXLabs/${sidefxlabs_current_version}" }, { "PATH": { "method": "prepend", "value": [ "$SIDEFXLABS/bin" ] } } ], "path": "$SIDEFXLABS" }
Where
N:/global/houdini/packages/18.0/SideFXLabs/1.205
was the network path where the package contents were extracted.
Technical Discussion » Python API call to "Save Node Type" on a digital asset
- jrcooper
- 59 posts
- Offline
Technical Discussion » Python API call to "Save Node Type" on a digital asset
- jrcooper
- 59 posts
- Offline
With an unlocked OTL you can link parms from the top level to nodes inside (Copy Parmeter/Paste Relative References) and then right-click and choose "Save Node Type" in order to make those references part of the OTL definition prior to matching the current definition to lock it back up again.
But in Python:
Am I just not seeing the saveNodeType() method in the docs? Without a method like this, creating links between parms does not get saved with the OTL definition after calling matchCurrentDefinition().
But in Python:
new_otl = subnet.createDigitalAsset(...) setupMyParms(new_otl) new_otl.saveNodeType() # <-- This doesn't exist??? new_otl.matchCurrentDefinition()
Am I just not seeing the saveNodeType() method in the docs? Without a method like this, creating links between parms does not get saved with the OTL definition after calling matchCurrentDefinition().
Technical Discussion » Parm state & conditionals not preserved in parmTemplateGroup
- jrcooper
- 59 posts
- Offline
I had a feeling that was the case.
But then, how does the Type Properties editor manage to get it right when you do it "manually"?
EDIT: So even the Type Properties editor doesn't get it right for the Redshift_ROP node, or at least not anymore (something changed because a previous version of a Redshift ROP that I wrapped manually somehow preserved the conditionals even though none appear in the Type Properties interface for those parms). But it does for others like mantra and arnold ROPs. Very strange.
But then, how does the Type Properties editor manage to get it right when you do it "manually"?
EDIT: So even the Type Properties editor doesn't get it right for the Redshift_ROP node, or at least not anymore (something changed because a previous version of a Redshift ROP that I wrapped manually somehow preserved the conditionals even though none appear in the Type Properties interface for those parms). But it does for others like mantra and arnold ROPs. Very strange.
Edited by jrcooper - July 28, 2022 18:51:22
Technical Discussion » Parm state & conditionals not preserved in parmTemplateGroup
- jrcooper
- 59 posts
- Offline
If I am making an OTL manually, and I use the Type Properties editor to copy a parm from a node inside the OTL to the OTL's parameter interface, any parm state (like if it is hidden) or conditionals are copied along with all the other parm properties.
But if I try to do this via Python, using the parmTemplateGroup from the inner child node and calling setParmTemplateGroup() on the OTL with it, no conditionals of any parms appear on the parms on the OTL, and (hidden) states are not preserved. In fact, when I query the parmTemplates in that group, t.conditionals() always returns an empty dictionary, even though conditionals clearly exist.
How do I get the parm state and conditionals to be preserved on the OTL's parm set when using setParmTemplateGroup()?
P.S. I've called hou.Node.updateParmStates() on the child node before getting its parmTemplateGroup, but that doesn't affect the data in the parmTemplates, only the parms themselves if queried.
UPDATE: I notice that this only seems to be the case when the inner child node is a 3rd party (compiled) plugin node, like a Redshift render ROP. Conditionals and such are preserved when the inner child node is itself an OTL I've made the usual way in Houdini's GUI.
But if I try to do this via Python, using the parmTemplateGroup from the inner child node and calling setParmTemplateGroup() on the OTL with it, no conditionals of any parms appear on the parms on the OTL, and (hidden) states are not preserved. In fact, when I query the parmTemplates in that group, t.conditionals() always returns an empty dictionary, even though conditionals clearly exist.
How do I get the parm state and conditionals to be preserved on the OTL's parm set when using setParmTemplateGroup()?
P.S. I've called hou.Node.updateParmStates() on the child node before getting its parmTemplateGroup, but that doesn't affect the data in the parmTemplates, only the parms themselves if queried.
UPDATE: I notice that this only seems to be the case when the inner child node is a 3rd party (compiled) plugin node, like a Redshift render ROP. Conditionals and such are preserved when the inner child node is itself an OTL I've made the usual way in Houdini's GUI.
Edited by jrcooper - July 28, 2022 13:55:07
Technical Discussion » Setting HDA tab submenu name via python?
- jrcooper
- 59 posts
- Offline
Wow. That's a lot of code to just set the TAB submenu name! I appreciate you sharing the code. I will give it a try. Thank you very much!
Technical Discussion » Setting HDA tab submenu name via python?
- jrcooper
- 59 posts
- Offline
I am writing a script that creates an OTL entirely programmatically via Python, and I need it to fill out a number of the fields that a user would ordinarily fill out using the Type Properties editor when creating an OTL interactively. Specifically, I need to set the tab submenu name string.
By exploring an existing OTL I can see that when the Interactive/Shelf Tools/Context/TAB Submenu Path field of the Type Properties editor is set to something custom (i.e., not the default "Digital Asset"), the corresponding hou.HDADefinition object contains a hou.HDASection called "Tools.shelf", and its contents is a string of XML containing "<toolSubmenu>MyTools</toolSubmenu>" amidst all the other XML tags.
But a brand new OTL has no such section. What is the method for setting this field programmatically in Python? I don't think reverse engineering the XML text is a good approach, and I can't imagine SideFX expects us to do that in any case. But I can't find anything in the API docs that describes how to set any of the options in the "Interactive" portion of the Type Properties editor for an OTL in general, or the tab submenu string in particular.
By exploring an existing OTL I can see that when the Interactive/Shelf Tools/Context/TAB Submenu Path field of the Type Properties editor is set to something custom (i.e., not the default "Digital Asset"), the corresponding hou.HDADefinition object contains a hou.HDASection called "Tools.shelf", and its contents is a string of XML containing "<toolSubmenu>MyTools</toolSubmenu>" amidst all the other XML tags.
But a brand new OTL has no such section. What is the method for setting this field programmatically in Python? I don't think reverse engineering the XML text is a good approach, and I can't imagine SideFX expects us to do that in any case. But I can't find anything in the API docs that describes how to set any of the options in the "Interactive" portion of the Type Properties editor for an OTL in general, or the tab submenu string in particular.
Technical Discussion » How to copy mantra ROP "take" parm?
- jrcooper
- 59 posts
- Offline
So I found a solution for this:
But it would be nice to be able to handle this as a general case, rather than having to know that "take" is specifically a parm that needs this treatment. I don't know how to detect that is the case. I only figured this out by seeing what the parm editor did to populate the take menu when I linked it to the subnet's parm interface. But how to know when this is necessary in general for any particular StringParmTemplate?
group = from_node.parmTemplateGroup() t = group.find("take") if t: t.setItemGeneratorScriptLanguage(hou.scriptLanguage.Hscript) t.setItemGeneratorScript("opmenu -l -a %s take" % (from_node.name())) group.replace("take", t)
But it would be nice to be able to handle this as a general case, rather than having to know that "take" is specifically a parm that needs this treatment. I don't know how to detect that is the case. I only figured this out by seeing what the parm editor did to populate the take menu when I linked it to the subnet's parm interface. But how to know when this is necessary in general for any particular StringParmTemplate?
Technical Discussion » Mimicing parameter editor Multiparm linking via python?
- jrcooper
- 59 posts
- Offline
That worked. Thank you.
Do you know off hand if SideFX has any plans to make a direct python API equivalent to the opmultiparm command?
Do you know off hand if SideFX has any plans to make a direct python API equivalent to the opmultiparm command?
Technical Discussion » Mimicing parameter editor Multiparm linking via python?
- jrcooper
- 59 posts
- Offline
So when you open the parm editor for a subnet or OTL and drag a multiparm block of a child node in the From Nodes tab to the parm interface of the node/OTL, Houdini does a bunch of magic to link the multiparm block and all its # parms to the child node.
How do you do this with python?
It isn't enough to just take the parmTemplateGroup which contains the multiparm and use setParmTemplateGroup on the destination node because while adding a block with the "+" value creates the new block on the child node, none of the parms are linked up automatically.
Basically I want to write a python script that does the equivalent of opening the parm editor and dragging a child node's entire parm interface to the containing subnet/OTL, including all the magic necessary to link everything up properly. Is there a python recipe for this somewhere?
How do you do this with python?
It isn't enough to just take the parmTemplateGroup which contains the multiparm and use setParmTemplateGroup on the destination node because while adding a block with the "+" value creates the new block on the child node, none of the parms are linked up automatically.
Basically I want to write a python script that does the equivalent of opening the parm editor and dragging a child node's entire parm interface to the containing subnet/OTL, including all the magic necessary to link everything up properly. Is there a python recipe for this somewhere?
Technical Discussion » How to copy mantra ROP "take" parm?
- jrcooper
- 59 posts
- Offline
I'm trying to write a python script for Houdini 18.0.597 which promotes all the parms of a mantra ROP to the containing subnet node and am tripping up on the "take" parm. On the mantra node it is a menu with two items "(Current)" and "Main". But on the subnet, it becomes just a plain string with the current value of "_current_".
What's going on here and how do I make the subnet's version of the "take" parm be exactly like the mantra ROP's "take" parm?
What's going on here and how do I make the subnet's version of the "take" parm be exactly like the mantra ROP's "take" parm?
group = mantra_rop.parmTemplateGroup() containing_subnet.setParmTemplateGroup(group) # At this point the complete parm interface has been copied from mantra_rop to subnet, # but the "take" parm is not a menu like it should be. Why not? How to fix?
Technical Discussion » Measure SOP bug?
- jrcooper
- 59 posts
- Offline
Technical Discussion » Measure SOP bug?
- jrcooper
- 59 posts
- Offline
Has anyone else been able to at least confirm the behavior I'm seeing (using the test geo I provided)?
Technical Discussion » Measure SOP bug?
- jrcooper
- 59 posts
- Offline
Platform: Windows 10
Houdini: 18.0.499
I used a Connectivity SOP set to Primitive connectivity type and Attribute set to “piece” to define the connected pieces of my geometry. The “piece” attribute ends up with a range of values from 0 to 2, which indicates three connected pieces of geometry. And when I hook up a Color SOP set to Random From Attribute “piece”, I see the three pieces of connected geometry in different colors.
However, when I connect a Measure SOP to this, set to Measure Area, Primitive Element Type, Accumulate By Piece, Piece Attribute “piece”, it creates four area values, not three. One of the three pieces is treated as two pieces and given two area measurements.
How can this happen, and how can I get the Measure SOP to only calculate and assign three area values?
Thanks.
(I've attached an example model that exhibits this phenomenon.)
Houdini: 18.0.499
I used a Connectivity SOP set to Primitive connectivity type and Attribute set to “piece” to define the connected pieces of my geometry. The “piece” attribute ends up with a range of values from 0 to 2, which indicates three connected pieces of geometry. And when I hook up a Color SOP set to Random From Attribute “piece”, I see the three pieces of connected geometry in different colors.
However, when I connect a Measure SOP to this, set to Measure Area, Primitive Element Type, Accumulate By Piece, Piece Attribute “piece”, it creates four area values, not three. One of the three pieces is treated as two pieces and given two area measurements.
How can this happen, and how can I get the Measure SOP to only calculate and assign three area values?
Thanks.
(I've attached an example model that exhibits this phenomenon.)
Edited by jrcooper - Nov. 13, 2020 19:20:43
Technical Discussion » Trouble with custom SideFXLabs deployment
- jrcooper
- 59 posts
- Offline
I'm trying to follow the scant documentation on custom deployment of the SideFXLabs package and having no success getting all the tools to be visible in a Houdini session.
For the sake of this example, let's say I have unzipped the SideFXLabs-1.205.zip file into a directory called:
Now, the contents of the zip archive is a folder called SideFXLabs-1.205, which means when I am done unzipping, I have:
inside of which are all the SideFXLabs subfolders and, crucially, the SideFXLabs.json package file.
I add this directory to HOUDINI_PACKAGE_DIR:
so that Houdini will find the SideFXLabs.json file. Then, inside SideFXLabs.json, I set the “SIDEFXLABS” env dictionary key to the value of:
which is the folder I chose for unzipping into. This is, as far as I can tell, precisely what the docs say to do, but while I do see a SideFXLabs shelf (with only one button for updating itself), I do not get any other shelf buttons nor do I get any Labs nodes.
What am I doing wrong?
For the sake of this example, let's say I have unzipped the SideFXLabs-1.205.zip file into a directory called:
C:/custom/packages
Now, the contents of the zip archive is a folder called SideFXLabs-1.205, which means when I am done unzipping, I have:
C:/custom/packages/SideFXLabs-1.205
inside of which are all the SideFXLabs subfolders and, crucially, the SideFXLabs.json package file.
I add this directory to HOUDINI_PACKAGE_DIR:
HOUDINI_PACKAGE_DIR="C:/custom/packages/SideFXLabs-1.205"
so that Houdini will find the SideFXLabs.json file. Then, inside SideFXLabs.json, I set the “SIDEFXLABS” env dictionary key to the value of:
"SIDEFXLABS": "C:/custom/packages"
which is the folder I chose for unzipping into. This is, as far as I can tell, precisely what the docs say to do, but while I do see a SideFXLabs shelf (with only one button for updating itself), I do not get any other shelf buttons nor do I get any Labs nodes.
What am I doing wrong?
Edited by jrcooper - Sept. 14, 2020 18:33:37
Technical Discussion » Promoted multi-parm callbacks not triggering
- jrcooper
- 59 posts
- Offline
Technical Discussion » Promoted multi-parm callbacks not triggering
- jrcooper
- 59 posts
- Offline
So I have a digital asset that wraps a ROP node and promotes a multi-parm block from the ROP node to its top-level interface. The problem is that normally when a user changes the value of one of the menu parms on the native ROP node it triggers code (internal to the native ROP node, of course) that puts a value in an adjacent parm. But this does not happen when the user does the same thing to the promoted menu parm of that multi-parm block.
The specific case is our wrapped Redshift ROP. The AOV multi-parm block has a parm called RS_aovID_# and when you select which AOV you want (diffuse, specular, etc.) it auto-fills the adjacent RS_aovSuffix_# parm with a corresponding name string. However, this does not happen when the user selects the AOV type from the promoted menu on our containing digital asset. The adjacent name parm remains unchanged.
How do I get our wrapped OTL to trigger the native callback on the native ROP it is wrapping?
Thanks!
The specific case is our wrapped Redshift ROP. The AOV multi-parm block has a parm called RS_aovID_# and when you select which AOV you want (diffuse, specular, etc.) it auto-fills the adjacent RS_aovSuffix_# parm with a corresponding name string. However, this does not happen when the user selects the AOV type from the promoted menu on our containing digital asset. The adjacent name parm remains unchanged.
How do I get our wrapped OTL to trigger the native callback on the native ROP it is wrapping?
Thanks!
Technical Discussion » Equivalent of old Group SOP expressions?
- jrcooper
- 59 posts
- Offline
Ah, that's very helpful!
I also see that
Thanks!
I also see that
opadd point
creates an Old Point SOP, which might be handy as well.Thanks!
-
- Quick Links