Announcement

Collapse
No announcement yet.

Override Mtl - Objects without a Material assigned

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

  • Override Mtl - Objects without a Material assigned

    Hey,

    a small QoL feature request.

    Could we get an override material option to only override objects without material applied?
    Some use cases:
    • It be handy when starting to texture a new scene. Everything is overridden with a neutral material, and we can start to add one material after the other.
    • Creating a preview rendering, where not all materials are applied yet.
    • Just have it enabled to eliminate the strong colour bleed in case there are some objects hidden from camera view which don´t have a material applied.
    Thanks!
    Attached Files

  • #2
    You can add the idea to the Portal so that people can vote on it.

    Otherwise, for now, it can be done with a script by selecting all objects without a material and putting them in a Layer. Like so:
    Code:
    (
            newLayer = layerManager.newLayerFromName ("Objects without Materials" + "_" + ((layerManager.count + 1) as string))
            select(for each in geometry where each.material==undefined collect each)
            for o in selection do newLayer.addnode o
    )​​
    Afterward, when using the override, use the Exclude layers to exclude everything other than the no materials layer.
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      Simpler still (for now at least) is to hide anything without a shader.
      Code:
      for g in geometry where g.material != undefined do g.isHidden=true
      Of course, should you wish to unhide the same nodes, then you'd need to collect them first, and restore the visibility of the collection later.
      Code:
      global theNodes=#() --declared empy and global, so it will persist in the Max session
      theNodes=for g in geometry where g.material != undefined collect g --filled with nodes. Rerun this line to refresh.
      for n in theNodes do n.isHidden=true  --nodes hidden
      and later on (as "theNodes" has been globally stored)
      Code:
      for n in theNodes do n.isHidden=false --nodes shown
      should you change what nodes have a material assigned (as you added new materials to the scene, f.e.) then you'd need to rerun the second line to re-collect them.

      variations to this include creating a selection set, should both visibility and layer membership be unchangeable properties.
      Last edited by ^Lele^; 22-03-2025, 08:16 AM.
      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...