for obj in selection do
((
int $.i = $.material.materialList.count;
if ($.i) do
for mat in $.material.materialList do
$.diffuse = color 255 255 255
$.ambient = color 255 255 255
else (
$.diffuse = color 255 255 255
$.ambient = color 255 255 255
)
))
Absolute noob here with absolute noob question:
Why is this not working?
This script is supposed to change the diffuse and ambient colour of all the materials even the multimaterials.
it gives me the Error:
-- Error occurred in anonymous codeblock; filename: ; position: 205; line: 8
-- Syntax error: at else, expected <factor>
-- In line: else (
Any help is much appreciated!
Replies
This should help you out.
Thank you so much Juan! :poly136:
The script works perfectly and I also got to learn some new things!
Could you tell me what the errors in my script were? It would be awesome if I could know where I went wrong!
As a start: the first error tells you that the 'else' statement is in a wrong place .. and that is because it must follow an if
you can write:
if ... then
...
else
...
or you can write:
if ... then
(
...
...
...
)
else
(
...
...
...
)
but you can not write:
if ... then
... ( <- bc here is the end of the 'if' if you don't use brackets )
... ( <- if there should be an else it must stand here)
...
else
(
...
...
...
)
Thanks for the help Till! I tried to debug it but I didnt know that then was a necessity. I think I glossed that over. Thanks again!
Thanks again Juan! This has been super informative! I didn't know about the proper syntax of maxscript. I think I'll go read some more into it! From now on $ is for defining properties.
To find the Vray property names you can probably select one object with a vray material and run this command:
Thanks guys!
there was another problem:
mat 1 = multimaterial
mat 2 = Vray2SidedMtl
how to change the color in the material 3 ?
I understand you don't work with Vray, but can you tell me the basis?
I can't build
In the following code you you need to replace standardmaterial with the class name of the VRay materials. You can get the class of a VRay material by applying it to an object and running this snip:
Still the latest question:
in scene one object
As off "show shaded Material in viewport" in all bitmaps and material ?
found a similar, but not the
http://forums.cgsociety.org/archive/index.php?t-1083444.html