Announcement

Collapse
No announcement yet.

How to render Material-IDs from object as a render element?

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

  • How to render Material-IDs from object as a render element?

    Hello,
    I was testing the Material ID render element (https://docs.chaos.com/display/VMAX/VRayMtlID)
    But it renders nothing but black.

    My object has 6 Material IDs.

    I have also tried setting the Output Type on "COLOR".

    2.)
    I have also set up a Multi/sub-material with colors: Is it possible to render the color assignments as only a VrayExtraTex?
    (while keeping the original material of course)
    That would be helpful

    Thanks

  • #2
    You need to set the material ID per material.
    It's not the face ID specified in a multi-sub, it's the little square (defaults to 0) in each material's top toolbar (in the compact material editor).
    Lele
    Trouble Stirrer in RnD @ Chaos
    ----------------------
    emanuele.lecchi@chaos.com

    Disclaimer:
    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

    Comment


    • #3
      Okay, so if I have only one material assigned, it's not possible to get the material IDs of faces?

      Thanks

      Comment


      • #4
        Not unless you assigned a material id per face id.
        very scriptable.
        Lele
        Trouble Stirrer in RnD @ Chaos
        ----------------------
        emanuele.lecchi@chaos.com

        Disclaimer:
        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

        Comment


        • #5
          Actually it is possible without scripting. Max keeps track of mat IDs for each level of material hierarchy. You can set up ID on Diffuse map level and it will show up in RE. Unfortunately you can have only on ID per material

          Zoran

          Comment


          • #6
            Of course it's doable manually, but there are a number of blocking, and/or time consuming caveats.
            For example, material IDs only go as far as 15 via UI, while face IDs are essentially unbounded.
            Scripting allows instead to assign any material ID value to a material, which will be tracked identically in the mtlID RE.

            so, for example,
            Code:
            meditmaterials[1] = multimaterial numsubs:100 --multisub filled with 100 gray vrayMtl in material editor slot 1
            for m=1 to meditmaterials[1].materiallist.count do --iterate through the 100 materials
            (
            meditmaterials[1].materiallist[m].effectsChannel = meditmaterials[1].materialIDList[m] --set the material ID to the same as the face ID
            )
            This is simply unachievable via UI, and if it was, it'd still be exceptionally time-consuming and prone to error.
            Lele
            Trouble Stirrer in RnD @ Chaos
            ----------------------
            emanuele.lecchi@chaos.com

            Disclaimer:
            The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

            Comment

            Working...
            X