Announcement

Collapse
No announcement yet.

Output ID matte for instances?

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

  • Output ID matte for instances?

    I have a scene that has multiple instances of a grouped set of geometry. The geo all has individual object ID mattes on the shape nodes, and these all get passed through to the instances nicely. However, I want to give the compers overall ID mattes for the instanced groups so they can separate them out as a whole as well. I've tested a few different options with render elements as well as object properties, but can't seem to find a way to do this. Is there a way to achieve this, or is the instancing a roadblock?

  • #2
    I guess you could try using Cryptomatte render element for the instanced objects and Object ID for the whole groups. The other way would be to create a custom masks in post with render elements that you curently have.
    Nikolay Kusht | chaos.com
    Team Lead, 3D Support | contact us

    Comment


    • #3
      I already tried this approach. The only method using RE's that I can get to generate anything or generate different colors for the instanced geo is renderId, but that creates a unique color for each separate piece of geo in each instanced group. This will make creating mattes for the overall object very difficult for the compers. I was hoping there was a way to create a single color ID/matte for each overall group. I thought this was possible with an object properties node applied to each group node, but with "override object ID" checked it doesn't generate anything into a multimatte. Otherwise yes I can create mattes using extra render layers with shading overrides, but was hoping for a more elegant approach within Vray.

      Comment


      • #4
        The override object ID should work just fine. What V-Ray version is this? I'll have a look just in case.
        Btw, do you still want to use the individual IDs but have a group ID on top, or have I misunderstood?
        Alex Yolov
        Product Manager
        V-Ray for Maya, Chaos Player
        www.chaos.com

        Comment


        • #5
          Yes, that's what I'm looking to do -- have object IDs for all the geo in the group, but output an overall ID for each group as well. So far I'm just using render layers and shading overrides but if there's a better way I'd love to know. Vray 3.60.04 in Maya 2018.2.

          Comment


          • #6
            I can get an overall matte with an object properties node and an ID override, and this will pass the matte into a multimatte. However I then lose the per-object IDs which are being passed into other multimatte elements. Is it not possible to get both in a single pass? Seems like I'd have to create another render layer, which is really the same as doing a shader override.

            Comment


            • #7
              It won't work in that way, since having multiple ID assignments on different hierarchy levels means one will override the other, like you've already noticed.

              There might be a way however. For example with Cryptomatte - you can add two cryptomatte render elements - one in "node name" mode (which is the derfault - for the individual masks) and one in "V-Ray user attribute mode" (for the per-group masks). Then group your objects into maya groups and add v-ray extra attributes > "user attributes" to the group node itself and add a custom attribute <attributeName>=<attributeValue>. Then add the attributeName in the cryptomatte in mode "attribute". This will create two sets of masks - one individual and one per group. I've attached an example scene -> multi_level_matte.zip

              You can combine this with the multimatte render element, e.g. cryptomatte in "attribute" mode for the group level and multimatte(s) for the individual masks.

              In case you can't use the cryptomatte (if your compositing is outside nuke or fusion), you can combine this with multimattes only by (ab)using the source of the objectIDs (material vs. object).
              1. you can add multiMatte render elements (with the default mode "use material ID" being disabled, meaning IDs deriving from meshes will be used). Use those for your individual masks.
              2. you can add multiMatte render elements with "use material ID" enabled - IDs deriving from material nodes will be used - this is now the tricky part.
              3. add extra vray attributes to your materials > material ID and add the same ID (labeled "multiMatte ID") to all materials you want to group.

              I've added an example scene for this too - multi_level_matte_mltID.zip
              This way you end up with each object having it's individual ID and the objects' materials having the same ID for whatever groups you want to group them in.

              I can think of more ways to do that - they get more complex but require even less tweaking and attribute adding - all of the above so far would require some scripting to lessen the manual work. You can select the materials you want to use as group IDs and do some MEL:

              Code:
              string $mtls[] = `ls -sl`;
              for ($mtl in $mtls) {
                  vray addAttributesFromGroup $mtl "vray_material_id" 1;
                  setAttr ($mtl + ".vrayMaterialId") <ID_number>;
              }
              Does this help?
              Attached Files
              Alex Yolov
              Product Manager
              V-Ray for Maya, Chaos Player
              www.chaos.com

              Comment


              • #8
                Thanks. Have been out sick a few days but will look at this when I get a chance. Of course the job that required this got killed anyway

                Comment

                Working...
                X