Automatically version up HDA default State

   1082   4   2
User Avatar
Member
46 posts
Joined: Dec. 2014
Offline
Hello,

Is there a way to have the default state name update with the HDA version? When the HDA is versioned up currently there will always be an error about the viewer state name conflict if the user has forgotten to rename it and the old HDA is still in the hip file. As you can imagine this can and is causing havoc when these HDAs are pushed to hundreds of Houdini users.

Thanks
Edited by JohnDoe777 - Jan. 30, 2025 13:06:59
User Avatar
Member
247 posts
Joined: May 2017
Offline
Hi, under $HHP (python libs) there is a module 'assettools.py' which contains all related functions for assets creation through the node context menu, including increasing of version. A lot of stuff... To set the default state name you can use this:
node.type().definition().sections()["DefaultState"].setContents('new_state_name')
OPMenu.xml [www.sidefx.com] uses the 'increaseMajorVersion' function, which you can find at bottom in the assetstools module. I guess the line above and some extra string logic should make it work.
User Avatar
Member
46 posts
Joined: Dec. 2014
Offline
Hi thanks for your reply,

I should have said that in this situation they're not using the default Side Effects versioning up but an in house publishing script. I'm sure pipeline could implement an easy fix to change the default state name version when versioning up. Problem is they're not bothered with fixing any critical problems with their HDA publishing system.

So as a user I was hoping that there was a way to put the current HDA version in the default state name like a variable "viewer_state_tool_$VERSION" so when I published the HDA it's already correctly versioned.

If that's not possible I'll probably try and do a wrapper script around the HDA publisher that the studio uses to set the default state name myself.
User Avatar
Member
46 posts
Joined: Dec. 2014
Offline
I also see there's a "On Install" Event Handler option that might allow me to rename the default state. So there seems to be a few approaches I can try.
User Avatar
Member
247 posts
Joined: May 2017
Offline
Understand, yes think using on install event is a good point.
  • Quick Links