Python - setting list parm on USD/Solaris instancer

   1112   1   1
User Avatar
Member
17 posts
Joined: Aug. 2012
Offline
Hey there!

I came across an issue and hope to find some help here once again I tried searching but didn't really know what to search for and ultimately ended up unsuccessful. I also posted over on odforce but so far yielded no replies.

I am trying to create a Solaris/USD network with my python script but when I set the list parameters on the instancer node it only changes the choice visually but does not actually use it.

As an example, when I set the “Prototype Index” to “Name Attribute” manually, the UI shows a new field to enter the name attribute. When I do this in Python:

usd_instancer.parm('protoindexsrc').set("Name Attribute")
usd_instancer.parm('nameattr').set("instancename")

the “Prototype Index” gets set to “Name Attribute” but the extra field is not shown and the node behaves as if it's set to its default value. If I then open the list and click on “Name Attribute” myself again, it shows the new line with my correct name attribute.

Additionally, I noticed now that sometimes the script does not even set the list parameter. E.g. when I open a fresh scene, use my script, it creates the instancer with default values (no errors though). When I run my script again, it creates a new instancer with the list set to my values, but still having the initial issue mentioned above :/

How would one go about solving this? Is there an extra function connected to this list choice that I have to trigger as well in Python?

As always, I am very grateful for any pointers, ideas and help!

Tested on MacOSX Mojave and CentOS 7 with Houdini 18.0.348. Small screenshot attached showing how I set the nodes parameter and it evaluates correctly in the shell but does not show in the interface and does not actually work.

Take care,

Dziga

Attachments:
Screenshot 2020-02-19 at 10.31.39.png (434.3 KB)

freelance matte painter & environment concept artist
User Avatar
Member
17 posts
Joined: Aug. 2012
Offline
Okay, I was dumb ;D
The value token is “extsop” and not “External SOP”. Not sure, why I didn't think about checking the edit parameter interface panel before… ;P
freelance matte painter & environment concept artist
  • Quick Links