Announcement

Collapse
No announcement yet.

V-Ray Material Library sample refresher script

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

  • #16
    Very minor update to v 103 to detect esc keypresses and terminate gracefully also for the multi- file loop (it was implemented only for the samples rendering phase.).
    File in the first post.
    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


    • #17
      Updated to v 104.
      Two important fixes.
      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


      • #18
        Updated to v 106.
        One fix to recursive search, and some minor QoL changes to UI and toolltips.
        As usual, grab it from the first post.
        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


        • #19
          Hi Lele,

          I'm late to this party, and I tried running this great looking script but I get an error.....

          I actually learned about your script from Jonas Noell's YouTube channel, and someone else on that video got this same message - his fix didn't work for me...

          Any ideas please ? I'd love to use this script for material libraries I have collected over the years

          Thanks.


          Click image for larger version

Name:	Capture4.JPG
Views:	864
Size:	119.5 KB
ID:	1104796







          Last edited by JezUK; 27-02-2021, 11:41 PM.
          Jez

          ------------------------------------
          3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
          Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

          Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
          ---- Updated 06/09/23 -------

          Comment


          • #20
            JezUK thanks for the report, i had the wrong file uploaded, it's fixed now (top post).
            I also modified the first post to reflect the recommendation: as of V-Ray 5 update 1, this script is embedded in the material library, under the "Add to Library" button, and the copying of the max file it requiresis taken care of by the installer, and shouldn't be manually overwritten.
            Last edited by ^Lele^; 28-02-2021, 12:26 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


            • #21
              Hi Lele,

              Thanks for your quick response.

              I tried your files, but I still get the exact same error.

              Jez

              ------------------------------------
              3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
              Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

              Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
              ---- Updated 06/09/23 -------

              Comment


              • #22
                Originally posted by JezUK View Post
                Hi Lele,

                Thanks for your quick response.

                I tried your files, but I still get the exact same error.

                Damn, it doesn't error here at all.
                What exactly is the process you're attempting?
                Could i get a file which errors in mail?
                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


                • #23
                  Originally posted by ^Lele^ View Post

                  Damn, it doesn't error here at all.
                  What exactly is the process you're attempting?
                  Could i get a file which errors in mail?
                  I can send you the simple test material file I created with just 4 materials in it - it's nothing special.

                  I'm actually trying to just follow the wonderful videos of Jonas Noell - here is the link to exactly what it is that I'm trying to do - add my own materials to the asset browser.

                  https://youtu.be/OWhTpYA_N_0?t=220

                  I will say that this error wasn't the first error I was experiencing - it first started with an error about Mental Ray (see attached for that)...... I got rid of that error through adding some mr files as per instructed on Autodesk's forum here;

                  https://forums.autodesk.com/t5/3ds-m...8771573/page/2


                  Click image for larger version

Name:	Capture1.JPG
Views:	892
Size:	17.8 KB
ID:	1104814
                  Jez

                  ------------------------------------
                  3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
                  Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

                  Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
                  ---- Updated 06/09/23 -------

                  Comment


                  • #24
                    Thanks for the reply.
                    Two things at play.
                    a) How exactly are you tryng to add the materials? Max file, or .mat file? Single, or multiple? Only one type ot both?
                    b) The Mr issue has nothing to do with me, or the material library: a max file or mat file was used which referenced the mentalray custom attributes, and as the material library loads the .max file, the error pops up.
                    The suggested way to fix it is to properly clean the incoming assets with the Autodesk-provided tools.

                    EDIT: the tutorial is misleading in that there is no need to go through the matlib creation manually.
                    You can save the max file (or use any saved one) as it is, with your materials assigned to something, and process the max file itself via script.
                    You can pick a max file directly, and even scan for the subfolders, and the script will take care of it all for you.
                    In fact, the manual creation of matlibs generates bad material libraries with invisible, but present, empty entries as the materials are deleted and re-added to the library.
                    The suggested method is to use the max file approach.
                    Last edited by ^Lele^; 28-02-2021, 01:30 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


                    • #25
                      Hi Lele,

                      No, I wasn't suggesting the Mr issues were to do with yourself I was simply mentioning that I had those to begin with from the start of me attempting to use this script for the first time.

                      I'm trying to add materials via a single .mat file. I started trying to do that with a .mat file I have that has around 40 materials I use often in it. I gave up with that and then tried with a brand new, newly created .mat file which had just 4 materials in it and I get that same error in that instance as well.

                      Thanks for all your help
                      Last edited by JezUK; 28-02-2021, 01:48 AM. Reason: Added incorrect information as a PS - please ignore that.
                      Jez

                      ------------------------------------
                      3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
                      Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

                      Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
                      ---- Updated 06/09/23 -------

                      Comment


                      • #26
                        And you said it errors with the script provided in the material library itself?
                        I.e. you open the material library, click on "add to library", click the script button to browse to a single matlib, and press the "go" button with everything at defaults?
                        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


                        • #27
                          Hi Lele,

                          I created a quick video to show you what I do and what happens.

                          Your comments regarding the suggested method is to use a max file are noted. I'll take another look.

                          Many thanks.

                          https://youtu.be/cjEAoA5jbjU


                          Last edited by JezUK; 28-02-2021, 01:57 AM.
                          Jez

                          ------------------------------------
                          3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
                          Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

                          Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
                          ---- Updated 06/09/23 -------

                          Comment


                          • #28
                            Eh, thanks, but it's not particularly telling.
                            Let's move this to mail, please.
                            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


                            • #29
                              Hi,

                              I just tried the newly updated approach with the "Add to Library" button in the Material Library Browser for Update 1, latest version.
                              The .mat file I used was the same I used earlier without issues.
                              Now I am getting the "-- Type error: if-test requires BooleanClass, got: OK" Error. Here is some additional info from the MaxScript Listener:

                              -- Error occurred in anonymous codeblock; filename: C:\Program Files\Chaos Group\V-Ray\3ds Max 2021\assets\VRML_Refresher.ms; position: 34134; line: 999
                              -- MAXScript Rollout Handler Exception:
                              -- Type error: if-test requires BooleanClass, got: OK
                              -- MAXScript callstack:
                              -- thread data: threadID:29488
                              -- ------------------------------------------------------
                              -- [stack level: 0]
                              -- In theMatLib loop; filename: C:\Program Files\Chaos Group\V-Ray\3ds Max 2021\assets\VRML_Refresher.ms; position: 34129; line: 998
                              -- member of: anonymous codeblock
                              -- Parameters:
                              -- theMatLib: "C:\Users\Jonas.Noell\Documents\3ds Max 2021\materiallibraries\_TestMaterials2.mat"
                              -- Locals:
                              -- theMatLib: "C:\Users\Jonas.Noell\Documents\3ds Max 2021\materiallibraries\_TestMaterials2.mat"
                              -- Externals:
                              -- checkMatlibIsValid: checkMatlibIsValid()
                              -- owner: <CodeBlock:anonymous>
                              -- perMatLibOps: perMatLibOps()
                              -- restoreMatlibHealth: restoreMatlibHealth()
                              -- ------------------------------------------------------
                              -- [stack level: 1]
                              -- called from btnGo.pressed(); filename: C:\Program Files\Chaos Group\V-Ray\3ds Max 2021\assets\VRML_Refresher.ms; position: 34135; line: 999
                              -- member of: Rollout:vrayMatLibRoll
                              -- Locals:
                              -- Externals:
                              -- owner: Rollout:vrayMatLibRoll
                              -- theMatLibs: #("C:\Users\Jonas.Noell\Documents\3ds Max 2021\materiallibraries\_TestMaterials2.mat")
                              -- gatherUISettings: gatherUISettings()
                              -- theMaxFiles: #()
                              -- vrayMatLibRoll: Rollout:vrayMatLibRoll
                              -- refreshAssetBrowser: refreshAssetBrowser()
                              -- ------------------------------------------------------
                              -- [stack level: 2]
                              -- called from top-level

                              I wasn't testing out the MaxScene converter though.

                              However, I tried with an earlier version of the script, and this one is WORKING:
                              VRML_Refresher_103.ms
                              I ONLY dragged in the script to the viewport, but the Max File Swatch2016.max is probably still the one that got installed with Update 1.

                              Hope that is in any way helpful? Let me know if you need some additional information!
                              Check out my FREE V-Ray Tutorials

                              Comment


                              • #30
                                Yes!
                                I managed to get it to error, and i can see what i did wrong. it's fixed now.
                                Ironically, i didn't see it error as i kept pointing at a corrupt matlib (the one you gave me, Jonas.), and so i'd keep running the script down the matlib healing path, which wouldn't error.
                                Thanks for finding out, we'll do a bit more QA before the next release, promised!
                                For now, i update to v 107, at the top.
                                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