Jump to content
dzigakaiser

Python - setting list parm on USD/Solaris instancer

Recommended Posts

Hey 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 then ended up unsuccessful.

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.

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!

Update:

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 :/

Update2:

I also posted over on the sidefx forums now and have a small screenshot to show what I mean:) I set the parameter in Python, it evaluates correctly in the shell but is neither shown in the interface nor actually used.

Take care,

Dziga

Screenshot 2020-02-19 at 10.31.39.png

Edited by dzigakaiser

Share this post


Link to post
Share on other sites

Oh boy, sometimes I am a bit stupid :D

The value to set is "extsop" and not "External SOP". I don't know why I didn't check out the edit parameter interface panel before...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×