Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: ichinozori on 2024-06-02, 10:14:03
-
Hello everyone, I first want to thank several people who have helped me overcome the problems I experienced in the post I published previously.
Now I want something that can minimize processing time, namely automatically arranging all materials in the "Reflection" and "Scale" sections in the material editor menu.
I have previously tried asking ChatGPT but every script provided always does not work as I expected, below I have attached the detailed section marked in red for the settings I want to make which can change automatically as I expected from "1.0" to "0.0"(https://i.ibb.co.com/RPXPgFJ/howto.png)
and this is script that ChatGPT wrote to me
allMaterials = getClassInstances PhysicalMaterial
if allMaterials.count > 0 then
(
for mat in allMaterials do
(
if mat.hasProperty #reflectivityMap then
mat.reflectivityMap.amount = 0.0
if mat.hasProperty #subsurfaceScattering then
mat.subsurfaceScatteringScale = 0.0
)
format "All Physical Materials have been updated.\n"
)
else
(
format "No Physical Materials found in the scene.\n"
)
-
If you want to do it scene wide use this:
for i in sceneMaterials do
(
if ClassOf i == PhysicalMaterial then
(
i.reflectivity = 0.0
i.sss_scale = 0.0
)
)
Just for selected objects:
for obj in selection do
(
if ClassOf obj.material == PhysicalMaterial then
(
obj.material.reflectivity = 0.0
obj.material.sss_scale = 0.0
)
)
or when dealing with materials inside a multisub (on selected objects) use this:
for obj in selection do
(
for i in getClassInstances PhysicalMaterial target:obj do
(
i.reflectivity = 0.0
i.sss_scale = 0.0
)
)
-
try this:
for mat in (allPhysMats = getClassInstances PhysicalMaterial) do
(
mat.reflectivity = 0.0
mat.sss_scale = 0.0
)
James beat me to it :P
I think he wanted to set the values to 0?
-
I think he wanted to set the values to 0?
Ah yes you are correct. Ive updated the snippets to reflect this.