Announcement

Collapse
No announcement yet.

select objects/materials by their ID

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • select objects/materials by their ID

    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.

  • #2
    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 Yolov
    Product Manager
    V-Ray for Maya, Chaos Player
    www.chaos.com

    Comment


    • #3
      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?

      Comment


      • #4
        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.
        Alex Yolov
        Product Manager
        V-Ray for Maya, Chaos Player
        www.chaos.com

        Comment


        • #5
          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.
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment


          • #6
            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 Yolov
            Product Manager
            V-Ray for Maya, Chaos Player
            www.chaos.com

            Comment


            • #7
              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).

              Comment


              • #8
                multimatteID_wip3.zip

                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.
                Alex Yolov
                Product Manager
                V-Ray for Maya, Chaos Player
                www.chaos.com

                Comment


                • #9
                  Very Nice. Thank you for this little helper!
                  I hope this tool gets a bit more options in the future.

                  cheers

                  rico

                  Comment


                  • #10
                    I'll try to expand it to be able to also edit/assign multimatte IDs soon.
                    Alex Yolov
                    Product Manager
                    V-Ray for Maya, Chaos Player
                    www.chaos.com

                    Comment


                    • #11
                      Alex, thanks so much! I am away from the work today, but I will test it asap when I have chance.

                      Comment


                      • #12
                        Any feedback will be more than welcome.
                        Alex Yolov
                        Product Manager
                        V-Ray for Maya, Chaos Player
                        www.chaos.com

                        Comment


                        • #13
                          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!

                          Comment


                          • #14
                            That can be arranged, I'm not sorting the lists now, I'll add sorting.
                            Alex Yolov
                            Product Manager
                            V-Ray for Maya, Chaos Player
                            www.chaos.com

                            Comment


                            • #15
                              Hi Alex, I tweaked your script a bit and the IDs are sorted in order now.

                              Comment

                              Working...
                              X