[Closed] Checksums & Removing dupe scene materials
Looks like you may not have the Win32 extensions installed. Grab those and it should register.
I actually found a repro case here that misbehaves. It’s not the checksum itself that’s the issue, it’s how I’m building the input string. The original method works great on the material types used at our studio due to how they’re architected, but could do better with the more standard Max material types.
I’ll tweak that function a bit tonight after work and re-post it. I can have it try the Python method first, too, thanks for the suggestion.
We use VRay exclusively for renderings, your method of looping through the props array is a great way of doing it and it should work for ours as well, just letting you know. I’ll grab the extensions.
I updated the code on that blog post and the script in the ZIP file. The getPropsString function now handles the typical property trees.
I also changed it to use stringStream instead of string appending, so it should run faster on large scenes.
Lastly, it tries the Python checksum method first, falling back on the pure MaxScript one if that isn’t registered.
Let me know how it works for you, Colin. And thanks for the feedback!
trying it now, once again great work vScourge. I’ll let you know how it goes.
It appears to be working correctly, however I do get this run-time error, at first glance at a missing bitmap or something that exists in the scene.
Here is the error:
Replacing material 'FLG_mnkyGrss' with 'Draconia-Lef'
....
-- csum: undefined
-- called in anonymous codeblock
-- Frame:
-- timeStart: 40570042
-- getPropsString: getPropsString()
-- getChecksumMXS: getChecksumMXS()
-- removedCount: 259
-- uniqueCount: 145
-- getChecksum: getChecksum()
-- csMatArr: #(#("b6ea5c2334760b45034c58a81ef5cd65", "9a17c7849ac58cdc49b3caf5eea05d7c", "55e5c1abc7dde4b06437e5b6f37eb9a0", "4eba5caf2bed33b1486ebfee2c40a4cb", "ca319ada90d9a229583a831ca6db5c40", "bb2b7e5ed3bf3c3a2a8dd6b8543d4854", "a9a6033fa260d931e2e212661e07058f", "3577dee6a37f5509c4b91c8b83077af1", "d09385be1a1fa6a797d8c9fdb8ad10a6", "205955fa4bd3397b3e12a2b1beb08b2b", "7f4717881a9f57f3ba5510889e6789fc", "078509489dd6a8a1b004b1118de498cc", "0f16b73b6af76ce6ba131c2c5e70adca", "97bbf038ce2bd30116f211cec3e8a86e", "4bdf10d49aec845c5cea35867e11519a", "cc75df3e214d309eae58487e7578e342", "787a8e8488d64334902337c8eb1bd795", "23f2744eea74f12890309d16c88962fd", "a933f936cc57d9935f64d6bcd686fa92", "d1bb574aaf4e96c6432aa124597a3033", ...), #(T-401-12x24:VRayMtl, ST-402:VRayMtl, T-401:VRayMtl, Matte Aluminum Frame:VRayMtl, WD-401:VRayMtl, TER-404:VRayMtl, WF-401:VRayMtl, WD-401-darker:VRayMtl, Glass:VRayMtl, polished chrome:VRayMtl, WD-404:VRayMtl, frame metal:VRayMtl, fireplace:VRayMtl, GL-407:VRayMtl, VRayMtl_3:VRayMtl, QSUR-402:VRayMtl, WD-402:VRayMtl, PT-404:VRayMtl, Brushed Stainless Steel:VRayMtl, T-404-02:VRayMtl, ...))
-- getMaterialChecksum: getMaterialChecksum()
>> MAXScript MacroScript Error Exception: -- Runtime error: Error opening bitmap: <<
It breaks on line 120 of the function “getPropsString” which reads
val = getProperty mat p
It doesn’t look like there’s any missing bitmaps in the scene. See if you can figure it out, I’m using the python checksum method.
-Colin
I can’t seem to repro that, even with missing maps. I don’t have the vRay material available, maybe there’s something unique about it that’s causing the script problems.
You might be able to work around it with a new try/catch at/near that line.