Notifications
Clear all

[Closed] Assign material and render script

Good people! Hello everybody! I’m new in MaxScript and need help, please.
I have task:

  1. 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)
  2. Render it, using my existing camera, and output file to my folder.
  3. Apply a second existing material to my selected object.
  4. 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:

  1. It apply first material to my object.
  2. Render properly.
  3. It say “undefined” and second material is not applying.
  4. Render is without any material applyed to the object.
2 Replies

show your script to check, and we can try to remove errors

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”

or how it looks in script editor: