Jump to content

how to put library material to scene material


oviam
 Share

Recommended Posts

in max script i am trying to put all the library materials to scene materials( like what "put material to scene" button in "material editor" does) but i am not able to find the function for that...

 

for example i have the material name called "mymat01" in the library,the same material exist in the scene,i have to replace that material to library material..

 

instead of clicking "put material to scene" button what function makes the same?

 

 

 

thanks,

 

oviam

Link to comment
Share on other sites

  • 5 years later...
  • 1 year later...

I have the exact same problem. However, I've noticed that "SceneMaterials" is a read-only array in MAXscript. If you try to change one of them by using 'SceneMaterials["name"] = currentMaterialLibrary["name"]', MAX does not generate errors or warnings, it simply does nothing and skips over the code.

 

Does anyone know of a way to edit your Scene Materials without iterating through all of the objects in your scene? Some scenes have many multi-subs with instanced materials, so this would not be very performant, and could possibly remove the links between the multi-subs.

Link to comment
Share on other sites

I'd like to replace the current scene materials with materials from a material library that has been optimized for faster rendering. I can't really tell which material parameters have changed except by iterating through all of them and comparing to the value from the material library version of the material.

This would take quite a while because there are a lot of materials in the scenes. The fastest solution would be to simply replace the scene materials but I haven't found a way to do that yet.

 

Thanks for the blurscripts though, they are very interesting. Thanks to them I might solve a couple of other issues with other scripts I encountered :D

Edited by Thion
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...