[Closed] Assign material and render script
Good people! Hello everybody! I’m new in MaxScript and need help, please.
I have task:
- Apply a first existing material to my selected object. (Object is a group, containning multiple meshes, splines) (my material is a multi sub-object material type)
- Render it, using my existing camera, and output file to my folder.
- Apply a second existing material to my selected object.
- Render it, using my existing camera, and output file to my folder.
And do it with all materials (multi sub-object) that I need (75 materials)
I need this script to render all my materials with another objects the same way.
My current simple script
Now if I launch the script it work this way:
- It apply first material to my object.
- Render properly.
- It say “undefined” and second material is not applying.
- Render is without any material applyed to the object.
Yes, sure! This is the script:
$.material = sceneMaterials[“TentwhiteSilverDpkBlack”]
render camera:$perspective_camera frame:1 outputfile: “S:\3DS_MAX_TEST_NET_RENDER\RoyalTent_Landing\Calculator_RoyalTent\EXPORT\TentwhiteSilverDpkBlack.jpeg”
$.material = sceneMaterials[“TentWhiteSilverDpkBrown”]
render camera:$perspective_camera frame:1 outputfile: “S:\3DS_MAX_TEST_NET_RENDER\RoyalTent_Landing\Calculator_RoyalTent\EXPORT\TentWhiteSilverDpkBrown.jpeg”
$.material = sceneMaterials[“TentWhiteSilverDpkTerracot”]
render camera:$perspective_camera frame:1 outputfile: “S:\3DS_MAX_TEST_NET_RENDER\RoyalTent_Landing\Calculator_RoyalTent\EXPORT\TentWhiteSilverDpkTerracot.jpeg”