I have an imported obj that comes in as one geo object. It's a very large asset with a large number of primitive groups. My ultimate goal is to be able to assign different materials to a set of primitive groups. Is there a way to do that procedurally?
I'd like to break out the one geo object into multiple objects that can receive unique material assignments.
thanks for your time
Assign material to primitive group?
7234 6 2- Herve Bizira
- Member
- 13 posts
- Joined: May 2013
- Offline
- malexander
- Staff
- 5158 posts
- Joined: July 2005
- Offline
- Herve Bizira
- Member
- 13 posts
- Joined: May 2013
- Offline
awesome! I just saw that the groups dropdown lists all primitive groups in the object.
would you happen to know how to iterate over all primitive groups in python?
I have about 300 primitive groups and I'd like to write a little expression that loops through them all, and assigns certain materials to certain subsets? I know the basics of python in houdini and I can loop over objects and create new material sops but I'm not sure how to list all primitive groups on a given file node.
thanks!
would you happen to know how to iterate over all primitive groups in python?
I have about 300 primitive groups and I'd like to write a little expression that loops through them all, and assigns certain materials to certain subsets? I know the basics of python in houdini and I can loop over objects and create new material sops but I'm not sure how to list all primitive groups on a given file node.
thanks!
- Herve Bizira
- Member
- 13 posts
- Joined: May 2013
- Offline
After digging around a bit in the HOM cookbook:
http://www.sidefx.com/docs/houdini13.0/hom/cookbook/print_hip_stats/ [sidefx.com]
I realized I could get the list of primitive groups in my object using this call:
myObj = hou.node('/obj/importedObj')
primitiveGroups = myObj.displayObject().geometry().primGroups()
http://www.sidefx.com/docs/houdini13.0/hom/cookbook/print_hip_stats/ [sidefx.com]
I realized I could get the list of primitive groups in my object using this call:
myObj = hou.node('/obj/importedObj')
primitiveGroups = myObj.displayObject().geometry().primGroups()
- TangheStudent
- Member
- 88 posts
- Joined: Feb. 2021
- Offline
- jsmack
- Member
- 7770 posts
- Joined: Sept. 2011
- Online
- TangheStudent
- Member
- 88 posts
- Joined: Feb. 2021
- Offline
-
- Quick Links