So I have been playing around in H16 with trying to create a HDA version manager in python and I discovered that you could assign multiple definitions with different names (for instance a name with an incremented version portion of <namespace>::<name>::<version>) to a single HDA file. Am I right in thinking that I could use this to store past versions of an HDA in a single HDA node? Is there a way this could be used to roll back and forth between versions pythonically?
So far my experiments seem to let me make and add new definitions to an HDA file, but I can't figure out how to set a previous definition to be current, or how to erase unwanted definitions. Any tips?
"Rolling Back" HDA definition versions with python
3204 7 4- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
- martinkindl83
- Member
- 260 posts
- Joined: Nov. 2014
- Offline
- jsmack
- Member
- 7762 posts
- Joined: Sept. 2011
- Offline
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
jsmackSo I am not sure which part of the HOM you are talking about, since I haven't been able to figure this out from the documentation yet. Currently the pages I have found most useful are…
Yes, we use this in our studio's HDA version control system. Everything you need to know is in the HOM documentation.
hou.HDADefinition [www.sidefx.com]
hou.hda [www.sidefx.com]
hou.Node [www.sidefx.com]
Install and manage assets [www.sidefx.com]
However, none of these make it clear how to set the current definition of the asset. Even when I try to change the current definition the operator type manager window the node doesn't actually change to that definition.
Any tips as to what functions or examples in the documentation I should be looking at?
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
- zephmann
- Member
- 5 posts
- Joined: Jan. 2012
- Offline
Hey NFX,
To remove a definition, in hou.HDADefinition, “destroy” will actually delete the definition from the .hda file and uninstall it, otherwise you can uninstall the file using “hou.hda.uninstallFile”.
Check out the changeNodeType method of hou.Node to change back to a previous version
node = hou.node(“/obj/geo1/my_asset”)
node.changeNodeType(“my_namespace::my_asset::1.00”)
This will update only that current node however; any newly placed nodes will still be the latest version.
I'm not sure exactly how to get newly created nodes to be a previous version other than destroying or uninstalling any later versions. This could be an argument for keeping separate versions of an asset in separate .hda files. So far as I can tell, the isCurrent and isPreferred only seem to refer to situations when multiple .hda files contain conflicting versions of an asset and you want to specify which file should be used. For instance, if you have asset_a.hda and asset_b.hda and they both have a definition for “my_asset::1.00”, you could use setIsPreferred to specify which one you want. The file path for the preferred definition then shows up in green in the Asset Manager window.
I'm wrestling with this stuff too right now so I feel your pain. Please let me know if you find out anything else!
Good luck :n)
To remove a definition, in hou.HDADefinition, “destroy” will actually delete the definition from the .hda file and uninstall it, otherwise you can uninstall the file using “hou.hda.uninstallFile”.
Check out the changeNodeType method of hou.Node to change back to a previous version
node = hou.node(“/obj/geo1/my_asset”)
node.changeNodeType(“my_namespace::my_asset::1.00”)
This will update only that current node however; any newly placed nodes will still be the latest version.
I'm not sure exactly how to get newly created nodes to be a previous version other than destroying or uninstalling any later versions. This could be an argument for keeping separate versions of an asset in separate .hda files. So far as I can tell, the isCurrent and isPreferred only seem to refer to situations when multiple .hda files contain conflicting versions of an asset and you want to specify which file should be used. For instance, if you have asset_a.hda and asset_b.hda and they both have a definition for “my_asset::1.00”, you could use setIsPreferred to specify which one you want. The file path for the preferred definition then shows up in green in the Asset Manager window.
I'm wrestling with this stuff too right now so I feel your pain. Please let me know if you find out anything else!
Good luck :n)
FX TD - The Mill, Los Angeles, CA
- NFX
- Member
- 183 posts
- Joined: Dec. 2011
- Offline
- sdugaro
- Member
- 380 posts
- Joined: July 2005
- Offline
bump. get anywhere with this? I'm still finding this a bit wonky in 19.0.
I've deployed 'beta' myhda::4.0, but the I want to force myhda::3.5 to be used when one tabs in a new instance.
I don't want to uninstall myhda::4.0, I want it there to be able to compare versions when developing and testing, I'm just having trouble configuring the 'preferred' definition for all users to be an earlier version in the version stream. At some point I'd like to switch the preferred definition to myhda::4.0, but only when its ready for primetime.
I've deployed 'beta' myhda::4.0, but the I want to force myhda::3.5 to be used when one tabs in a new instance.
I don't want to uninstall myhda::4.0, I want it there to be able to compare versions when developing and testing, I'm just having trouble configuring the 'preferred' definition for all users to be an earlier version in the version stream. At some point I'd like to switch the preferred definition to myhda::4.0, but only when its ready for primetime.
-
- Quick Links