Sari_Y Posted September 8, 2020 Share Posted September 8, 2020 Hi. Guys. I'm stuck python scripts. How to get "name" attribute value at prim via python? I would replace the Null name with it. Python scripts is new to me. I'm not sure error meaning. Please give me some advice. Thanks! Saori Quote Link to comment Share on other sites More sharing options...
ikoon Posted September 8, 2020 Share Posted September 8, 2020 Hi Saori, we have to reference the node`s Geometry, not the node itself. Try this: geo = hou.node("/obj/GEO_model/null1").geometry() geo.attribValue("name") Or, this is the same: node = hou.node("/obj/GEO_model/null1") geo = node.geometry() geo.attribValue("name") 2 Quote Link to comment Share on other sites More sharing options...
animatrix Posted September 8, 2020 Share Posted September 8, 2020 Hi Saori-san, You need to access the geometry on your hou.Node instance. For example: hou.node("/obj/GEO_model/null1").geometry().attribValue("name") 2 Quote Link to comment Share on other sites More sharing options...
anim Posted September 8, 2020 Share Posted September 8, 2020 also since you are trying to access prim attribute value you need to get a single prim first hou.node("/obj/GEO_model/null1").geometry().iterPrims()[0].attribValue("name") 1 1 Quote Link to comment Share on other sites More sharing options...
Sari_Y Posted September 9, 2020 Author Share Posted September 9, 2020 cool! I got it. Thanks for your time guys! null = hou.node("/obj/GEO_model/null1") nullname = null.geometry().iterPrims()[0].attribValue('name') null.setName(nullname) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.