Jump to content
hitch

Set detail attribute in HDA python Module.

Recommended Posts

Hi

I am creating a HDA and I want to set the values of a detail attribute (an array) on an attribute create node. I am trying to do this in the python module of the HDA. 

In sop level, in a python node I can set an array fine, but in the python module of the HDA it errors.

GeometryPermissionError: Geometry is read-only.

I feel i am just missing something really simple, but can't get my head around it. I can find heaps of threads about this relating to the python sop, but not much for the python module window. 

I would be fine to do it all from the python sop, but I am pulling in the array from the interwebs and I want to try to chuck the HDA in unreal/unity. 

Any help would be greatly appreciated.

 

def mybutton(kwargs):
    
    node = kwargs['node']
    #works fine
    node.node("line").parm("points").set(5)
    
    testlist = [1,2,3,4,5]
    #works fine reading the empty array created in the below node
    anarray = node.node("attribcreate1").geometry().findGlobalAttrib("myArray")
    print(anarray)
    #throws read only error
    node.node("attribcreate1").geometry().setGlobalAttribValue("myArray", testlist)

 

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

×