List objects by material

   2196   3   2
User Avatar
Member
208 posts
Joined: Nov. 2010
Offline
Is there a way to list all objects that have a common material, e.g., all objects that have the same Metal Grate shader applied?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
There are quite a few ways to do that.

If you have all your materials assigned at the object level (objects have material references in their /Material/Material parameter) then you can go to the Material Palette pane, select your material and press the Select button. Now all the objects with object level material assignments will be selected.


Another method that shows material selections at both the Object and SOP level (Material SOPs or Pack Edit SOP material assignments) is to RMB (RightMouseButton) on the material and choose the menu option “View Dependencies…”. This opens up the Dependencies dialog for that node. The first few entries will be the objects and then a bunch of parameter references. In the Filter field at the bottom of the Dependencies dialog, type:

/obj/*

This will filter for only objects. This will be the list of Objects that have a reference to this material.

You can also write either hscript or python function to rip through all the objects given a material argument to return a list of objects and primitives with material assignments.


If you are doing the material assignments yourself, the way you assign materials could make things a lot easier. If you are creating scenes for others to use, you can use bundles or categories to create material assignments that would not only allow you to preview material assignments but to also edit them at a high level.
There's at least one school like the old school!
User Avatar
Member
208 posts
Joined: Nov. 2010
Offline
Thanks Jeff, the dependencies filter is what I needed.
Kevin
User Avatar
Member
604 posts
Joined: July 2013
Online
jeff
If you are doing the material assignments yourself, the way you assign materials could make things a lot easier. If you are creating scenes for others to use, you can use bundles or categories to create material assignments that would not only allow you to preview material assignments but to also edit them at a high level.

Jeff, can you elaborate a little more on how bundles/categories can be used in material assignment/management?

EDIT: Are you referring to Bundles and the Parameter Spreadsheet? I'm familiar with that workflow and like it.
Edited by TwinSnakes007 - Oct. 4, 2016 11:48:02
Houdini Indie
Karma/Redshift 3D
  • Quick Links