Embedded OTL pythonically - or with hscript?

   2182   4   1
User Avatar
Member
79 posts
Joined: April 2011
Offline
I've tried doing things like

node.type().definition().copyToHDAFile('Embedded', ‘nodename’)

and

otwrite Sop/nodetypename Embedded

both with no luck…


Anyone know of a way to do this?
User Avatar
Member
1913 posts
Joined: Nov. 2006
Offline
Not sure what you're seeing but node.type().definition().copyToHDAFile('Embedded') worked fine for me.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
79 posts
Joined: April 2011
Offline
aha, was going to quickly and didn't realize that the newname was optional. Thanks Graham! While I've got you here - quick way to switch so that all of the nodes of that type in the file use the embedded definition?
User Avatar
Member
1913 posts
Joined: Nov. 2006
Offline
You need to then get the asset definition from Embedded at set it to be preferred. Something like this:
for definition in hou.hda.definitionsInFile(“Embedded”):
definition.setIsPreferred(True)
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
79 posts
Joined: April 2011
Offline
awesome. Thanks and say hello to Bowmar for me.
  • Quick Links