Hi, I am working on a scene from other company and doing the lighting and rendering. but the setup in the scene is a mess. one problem I have is there are many objects have objectID but not in a particular order. I need to click through each of them to make sure those ID are assigned correctly for our comp guy. there are thousands objects if not millions.
I just wondering if there is a script that I can select objects by the their objectID assigned?
like list all the used objectID in the scene then the objects will be highlighted if I click the ID?
thanks.
That could be scripted - something like a objID lister that shows a list of objectID and a tree structure with all objects under each with the option to select or edit it or something like that. I couldn’t find one on the internet. Now the problems would come from an ease-of-use standpoint, since objectIDs can be assigned to a mesh, a group, a transform node and via object properties - so scripting a robust tool will be more difficult and it will be slow for large scenes. I know that there are such tools for 3ds max made by users… but not for Maya, obviously. I hope I’m wrong.
Alex, yes, remember I saw something in 3dsmax before. but I am not sure it is for material ID or object ID. Is a such tool for material Id easier to script?
I believe it was one of John Martini’s tools for max. For maya - well, a robust all-round tool will take longer to make than something that does exactly one thing, specifically designed for your case and your project. But that doesn’t mean that it can’t be expanded later to do more stuff.
Do you have a general idea what is going on with your scenes - are all object IDs assigned via object properties, or as vray attributes? What will you want to do with them - just select the objects, edit the IDs, reassign materials? Do different objects have different objectIDs between render layers (I don’t even remember if such overrides are possible), etc…
Any general pointers to what exactly you need will make things easier.
Hmm, for objects, there will be some deep logic involved, since shape has precedent over transform, and object propeties override both, etc…
I’ll have to see what’s the hierarchical logic with material attributes.
Do you need this to work for material IDs or for object IDs (or both)?
The Material ID extra attributes add two controls = material ID (as a color value) and multimatte ID (an integer value). Which one of the two will you need to search through?
Multimatte IDs will be easy, I guess, since they are only applied to two types of nodes - materials and shading groups.
More details on how you plan to use it will help me get you something that will be at least useful for this particular case and maybe later expand it to a more robust tool.
Alex, thanks for the reply.
Through Multimatte ID will work in my case. My idea is to have a GUI to list all the multimatte used in the scene and highlight the objects by selecting their assigned the Multimatte ID (materials).
Here’s a wip version and I would like to stress the wip part of it
Click find and you’ll get 3 lists - left is all IDs in the scene, middle is the shader(s) with that ID and right are the object with the shader(s) from the middle list.
Notes:
* All risk of this crashing your scene is entirely on the user
* Not sure how slow it will be with thousands of shaders and millions of objects in the scene
* For some reason it will not work with the default lambert shading group, but I won’t be fixing that now, since … well, that doesn’t need further explaining.
* One day this could get expanded, improved in terms of UI and further tested so it’s more reliable
P.S. I hope it does what you need it to for your project. I won’t be able to make big adjustments very quickly if it doesn’t, you might have to wait.
P.P.S Usage - just copy the contents and paste it to a MEL tab in your script editor. Ctrl+Enter to run. multimatteID_wip3.zip (1.84 KB)
Finally have a chance to use it. Alex, it works very well in the scene!
we have 4 full size cars and environment with about 500+ shaders and 100+ material IDs. the script goes through the scene very fast. I did not notice any slow down.
only thing I think can be improved is to list the ID by orders.
Thanks again!
Care to share?
I’m thinking of turning this into a more all-round tool that will eventually support editing the IDs and more fun stuff.
I also need to optimize the code a bit since it’s a bit erratic at the moment and I do run a few operations that can be safely spared, but this will come with time.
Alex, I add one line:
$allSceneIDs = sort ($allSceneIDs);
it does the trick
editing ID in the UI will be a great one.
I have some ideas may make it more handy:
1. add a column for MultiMatte RE. maybe make this the first column to show all MultiMatte RE in the scene.
2. color or highlight scene ID in the GUI with their MultiMatte RE RGB color. or Color the geos/meshes in the viewport while selecting scene ID.
Hey guys, this is really useful. I ran the script through a production scene and it’s blazing fast.
Alex please add the feature of editing ID in the UI and the ones imagecube requested. Hope this script to be integrated as an official tool like the image to tiled EXR. I haven’t found a robust multimatte ID management tool available for public online. This would benefit a lot of Vray for maya users.
Thanks for the input, jasonhuang1115.
I’ll make sure to add those features, no doubt about that - the problem is when But I’ll keep you guys posted.
Now, if it doesn’t make it officially into the vray installation, worst case we’could set up some remote repository for such tools that anyone can download, use and contribute to.
And as usual - any thoughts on improving this tool or any other ideas for other tools that you guys think can be of help to you and users - just share some thoughts here and I’ll see what I can do.