If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Exciting News: Chaos acquires EvolveLAB = AI-Powered Design.
To learn more, please visit this page!
New! You can now log in to the forums with your chaos.com account as well as your forum account.
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.
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
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.
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.
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;
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.
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 -------
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?
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!
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.
Comment