oviam Posted July 8, 2004 Share Posted July 8, 2004 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 More sharing options...
Oleksandr Kramer Posted October 31, 2009 Share Posted October 31, 2009 (edited) scenematerials["mymat01"]=currentMaterialLibrary["mymat01"] or for replacing material for current object. obj=selection[1] MatName = obj.mat.name obj.mat = currentMaterialLibrary[MatName] Edited October 31, 2009 by Track Link to comment Share on other sites More sharing options...
Thion Posted December 10, 2010 Share Posted December 10, 2010 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 More sharing options...
mrucereto Posted December 10, 2010 Share Posted December 10, 2010 If you are just trying to change certain parameters of all materials in scene, or even just a portion, there are BlurScripts that give you this control. Material Control and Material Converter are a couple you might want to check out. http://www.neilblevins.com/blurscripts/blurscripts.htm Link to comment Share on other sites More sharing options...
Thion Posted December 13, 2010 Share Posted December 13, 2010 (edited) 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 Edited December 13, 2010 by Thion Link to comment Share on other sites More sharing options...
obaida Posted March 18, 2011 Share Posted March 18, 2011 Hi . a'm new here , so maybe its to late but anyway , there is a script can do this task . the script name : materialMover from : SoulburnScripts . http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now