Attached to this post the screen capture 'MaterialBinding_Solaris.jpg'
I have a python script that gets the path from a selected Leaf Primitive. Once I have the path from the Leaf Primitive ( in my example '/Variant/MFZ6/Carabiner4_Black' ) How can I get the path inside the 'material:binding' ( in my example '/Variant/materials/HighRes/MFZ6/Carabiner4_Black' ) out of the Leaf Prim Path?
Note that in this case I have the Display flag set on a Set Variant Node but I don't necessarily have the Set Variant node selected.
So the next code doesn't work
```hou.selectedNodes().stage().GetObjectAtPath(SingleSelectedPrimPath+'.material:binding')```
So how do I read the path inside the 'material:binding' once I have the 'Leaf Primitive Path' with Python?
Read 'material:binding' via the 'Leaf Primitive Path'
205 3 1- Carlo_Jongen
- Member
- 10 posts
- Joined: Nov. 2017
- Offline
- alexwheezy
- Member
- 316 posts
- Joined: Jan. 2013
- Offline
- Carlo_Jongen
- Member
- 10 posts
- Joined: Nov. 2017
- Offline
alexwheezyThis is what I had, but you can run into a situation where you have your Leaf Prim selected but not have any other perticular node selected. I wanted to avoid to use the next methode. However I don't think it is possible to read the path inside the 'material:binding' when you only have the 'Leaf Primitive Path'. You'll alway need know the'hou.node("/obj/lopnet1/pig")' to be able to get the stage().
hou.selectedNodes().stage().GetObjectAtPath(SingleSelectedPrimPath+'.material:binding')
```hou.node("/obj/lopnet1/pig").stage().GetObjectAtPath("/pig/geo/shape/PigNeck.material:binding")```
- Carlo_Jongen
- Member
- 10 posts
- Joined: Nov. 2017
- Offline
Notice I have the 'pMe5_variant' selected and I have the Display Flag set to 'MFZ6_variant'. And I can jump to the correct Material. This is how I wanted it to work. Only thing is that it seems impossible to read the path inside the 'material:binding' directly from the 'Leaf Primitive Path'. That would have made things a bit easier.
-
- Quick Links