Announcement

Collapse
No announcement yet.

Script to select all non-Vray materials in a scene?

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

  • Script to select all non-Vray materials in a scene?

    The scene converter is all well and good, but is there a way I can get all the non-Vray materials in to my editor easily so I can swap them out for my predefined Vray mats?

    I'm talking about a Revit model where there are lots of Autodesk materials, multiples of the same type, instances going in to many multiSubMaterials etc. I've swapped a lot out already but it's now a case of finding those bits that have flown under the radar.

  • #2
    I use Sini Tools. I also have the Fix Utility
    Bobby Parker
    www.bobby-parker.com
    e-mail: info@bobby-parker.com
    phone: 2188206812

    My current hardware setup:
    • Ryzen 9 5900x CPU
    • 128gb Vengeance RGB Pro RAM
    • NVIDIA GeForce RTX 4090 X2
    • ​Windows 11 Pro

    Comment


    • #3
      Originally posted by glorybound View Post
      I use Sini Tools. I also have the Fix Utility
      Does Sini have that exact function? i.e. just collecting the non-vray materials, rather than converting.

      Not come across Fix Utility, am I wrong in assuming this is a 3rd party script?

      Comment


      • #4
        This is probably the most savage way of coding it (I'm still learning), but it works:

        Code:
        select (for o in $* where superClassOf o == geometryClass collect o) --selects all geometry
        deselect (for i in selection where i.material==undefined collect i) -- deselects geometry without materials
        select (for g in selection where G.mat.category == #VRay collect g) -- selects geometry with V-Ray materials
        actionMan.executeAction 0 "40044" --inverts selection
        deselect (for p in selection where superClassOf p!=geometryClass collect p) --deselects non-geometry items​
        Last edited by hermit.crab; 02-11-2022, 12:36 PM.
        Aleksandar Hadzhiev | chaos.com
        Chaos Support Representative | contact us

        Comment


        • #5
          here, just run it with the scene open.
          If no offending material is found, no change will happen to the material editor, and a box will show up warning of the scene's cleanliness.
          If more than 24 materials are found, the mat editor will be fully populated, and a dialog box will warn you of how many more are left.
          Notice it does not check what is in the material editor, so any content in it will be overwritten with the offending materials.
          The operation isn't undoable: save/hold before running the script.
          Attached Files
          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


          • #6
            Originally posted by ^Lele^ View Post
            here, just run it with the scene open.
            If no offending material is found, no change will happen to the material editor, and a box will show up warning of the scene's cleanliness.
            If more than 24 materials are found, the mat editor will be fully populated, and a dialog box will warn you of how many more are left.
            Notice it does not check what is in the material editor, so any content in it will be overwritten with the offending materials.
            The operation isn't undoable: save/hold before running the script.
            Amazing! sounds perfect, will give it a try soon.

            Comment


            • #7
              For this or similar questions there's one tool to rule them all and it's Modifier Modifier Zorb.
              A.

              ---------------------
              www.digitaltwins.be

              Comment


              • #8
                Oh i agree.
                That thing saved my bacon *countless* times, in so many different aspects of production.
                Zorb's perennially on my "i'll offer you the next one" list.
                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