I am curious if you could with python swap an HDA to another HDA without having the HDA move or change location in the network.
This seems to be happening anyways under the hood, if the HDA versions have different save locations. Switching the version then completly loads another hda path. Now I just need to figure out how to do this on purpose. While saving it, this is straight forward, but how to go about it with just swapping to another?
Replace one HDA with another
1985 4 0- AndreasWeidman
- Member
- 128 posts
- Joined: Feb. 2021
- Offline
- jsmack
- Member
- 8026 posts
- Joined: Sept. 2011
- Online
Are the hda's the same type name exactly, or different because of version/namespace? If identical then it should swap automatically when installing the new def if it's newer or if 'force_use_assets' is true on the hda.installFile command.
When the types differ, then swapping is less straightforward as a type change is involved. Every node in the scene would need to be found and type changed.
When the types differ, then swapping is less straightforward as a type change is involved. Every node in the scene would need to be found and type changed.
- AndreasWeidman
- Member
- 128 posts
- Joined: Feb. 2021
- Offline
Thanks Jsmack. So the simplified idea is this:
- We’d have an editable template HDA with stuff and our own save/load/edit/revert buttons. (Template.1.0.hda)
- Artist does things in it. Presses our save button. It saves it out and installs it as myName.1.0.hda.
- The Template hda should then be replaced by the myName hda, for this instance of the node. And myName hda becomes available as a new digital asset. Very similar to how ”save as” works in the Digital Asset menu.
The first two things is not a problem. It’s the last point I’m trying to solve. Currently I’m doing some hacky stuff, getting template position and input/output, and manually deleting one, and moving the other to its place. But that might screw with anything referenceing that node.
If I can find a way to replicate HDA ”save as”. That would make my day.
- We’d have an editable template HDA with stuff and our own save/load/edit/revert buttons. (Template.1.0.hda)
- Artist does things in it. Presses our save button. It saves it out and installs it as myName.1.0.hda.
- The Template hda should then be replaced by the myName hda, for this instance of the node. And myName hda becomes available as a new digital asset. Very similar to how ”save as” works in the Digital Asset menu.
The first two things is not a problem. It’s the last point I’m trying to solve. Currently I’m doing some hacky stuff, getting template position and input/output, and manually deleting one, and moving the other to its place. But that might screw with anything referenceing that node.
If I can find a way to replicate HDA ”save as”. That would make my day.
- jsmack
- Member
- 8026 posts
- Joined: Sept. 2011
- Online
- AndreasWeidman
- Member
- 128 posts
- Joined: Feb. 2021
- Offline
-
- Quick Links