Announcement

Collapse
No announcement yet.

simple max script

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

  • simple max script

    for one or more objects selected, i'd like to change the vraymtl reflection color to 0 0 0. any thoughts on how i'd do this? i've tried many variations and keep getting errors.

    Code:
    VrayMtl reflection color 0 0 0
    thanks

  • #2
    Code:
    $.material.reflection_maxDepth = 12
    works just fine.

    i tried

    Code:
    $.material.reflection 0 0 0
    and get an error. i tried reflection = 0 0 0, tried (0 0 0) etc.

    if i try
    Code:
    $.material.reflection
    i get an response that says (color 255 255 255) which is white which is what the material's reflection color is.

    ugh.

    Comment


    • #3
      mother f'er.

      Code:
      $.material.reflection = (color 0 0 0)
      works!

      now all i have to do is figure out how to do this on objects with multi-sub materials. except for actual materials that need to be reflective
      Last edited by s_gru; 24-08-2023, 11:57 AM.

      Comment


      • #4
        Try VMC / Batch Material Editor scripts, both are free and can do batch editing for materials.
        -------------------------------------------------------------
        Simply, I love to put pixels together! Sounds easy right : ))
        Sketchbook-1 /Sketchbook-2 / Behance / Facebook

        Comment


        • #5
          Originally posted by s_gru View Post

          now all i have to do is figure out how to do this on objects with multi-sub materials. except for actual materials that need to be reflective
          What does it mean exactly?

          Comment


          • #6
            Originally posted by gandhics View Post

            What does it mean exactly?
            i have a bunch of objects in the scene all with multi/sub materials. each has between 3-7 sub-materials. some of those should actually have a reflective color, but it's maybe 10% of them.

            the other thing was when i type that MF'r script with many objects in my scene selected, objects with the multi/sub, the script errors out right away saying 'unknown property' on multi/sub material.

            after more research last night, i'd be faced with writing complex scripts and though i always like to learn, i think in this case i'm going to have to find a script like m.max suggested.

            thanks

            EDIT: something i did wonder is this: in the "scene materials" list of the slate material editor, wouldn't all the materials be listed separately from the mult-sub materials? and if not, why? also, internally to max, why is a mult-sub material a "material"?

            couldn't i just say skip all mult-sub materials? i realize this doesn't account for preserving metal materials or other materials with reflection, but i could add a snip that says "if reflection color > 0 0 0 then move on"
            Last edited by s_gru; 25-08-2023, 06:24 AM.

            Comment


            • #7
              You can use the following Maxscript to change all Vray materials reflection color to white unless it was originally black ,this will works with all Vraymtls including the one inside mult-sub materials, blend ,2 sided, … etc.
              Code:
              for m in (getclassinstances vraymtl) where m.reflection!= color 0 0 0 do m.reflection = color 255 255 255
              -------------------------------------------------------------
              Simply, I love to put pixels together! Sounds easy right : ))
              Sketchbook-1 /Sketchbook-2 / Behance / Facebook

              Comment


              • #8
                Originally posted by M.Max View Post
                You can use the following Maxscript to change all Vray materials reflection color to white unless it was originally black ,this will works with all Vraymtls including the one inside mult-sub materials, blend ,2 sided, … etc.
                Code:
                for m in (getclassinstances vraymtl) where m.reflection!= color 0 0 0 do m.reflection = color 255 255 255

                the VMC tool is cool. still, sometimes it's nice to have my own little button but i do have it installed!

                for your script, i can change the 0 0 0 and 255 255 255 - what's happening in my case is i get a lot of 255 255 255 when i import and convert materials to vraymtl. so no worries there. thanks for this.



                Comment


                • #9
                  just putting this out there also, but i found a Batch Material Edit by Nick Gushchin that works pretty well. it also allows me to change all bitmap blur settings. i tend to get a lot of vray warnings about bitmaps having a blur value of 0.01 for some reason (forest objects, imported revit stuff etc...) and i'm able to set them to 1.0 so i don't get warnings.

                  Comment


                  • #10
                    Originally posted by s_gru View Post
                    just putting this out there also, but i found a Batch Material Edit by Nick Gushchin that works pretty well.
                    That what I've recommend in my first comment too
                    Originally posted by s_gru View Post
                    it also allows me to change all bitmap blur settings. i tend to get a lot of vray warnings about bitmaps having a blur value of 0.01 for some reason (forest objects, imported Revit stuff etc...) and I'm able to set them to 1.0 so i don't get warnings.
                    I would highly recommend using Lele Script in the link below to clean your VRay material library for reset blur value and few other things :
                    https://forums.chaos.com/forum/v-ray...o-v6-standards
                    -------------------------------------------------------------
                    Simply, I love to put pixels together! Sounds easy right : ))
                    Sketchbook-1 /Sketchbook-2 / Behance / Facebook

                    Comment


                    • #11
                      woops sorry M.Max! chalk that up to scatter-brain-panic-deadline mode!

                      i walked-by lele's script because i saw a warning and didn't recognize anything in it so i thought - ADVANCED USERS ONLY ugh! but i will read up on it when i have chance.

                      Comment


                      • #12
                        vrayreflcolorsetter.zip

                        Hi , I made this simple script ,for reflection color settings of selected object's material
                        hope it helps.

                        Comment


                        • #13
                          nice. in some ways i think to myself - why haven't i relied more on scripts in the past. but in other ways i feel like - that's a LOT of stuff that should be built in ugh.

                          Comment

                          Working...
                          X