07 July 2004 | |
![]() |
|
New Member
|
how to put library material to scene material
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 |
07 July 2004 | |
![]() |
|
Lord of the posts
veteran game artist
USA
|
|
07 July 2004 | |
![]() |
|
New Member
|
![]() yeah EricChadwick i have already checked that script but it has only an option to replace material from library to scene selection (not scene material)
for that i need to select the objects to replace the material which is not working properly with my script, i want to directly put it in to scene material like what "put material to scene" button does... so is there any other way to do this? pls help me out... thanks, oviam |
07 July 2004 | |
![]() |
|
Know-it-All
|
|
07 July 2004 | |
![]() |
|
Don't Know-it-All.
portfolio
Keith R Morrison
Custom Tools Developer
Focus360
San Diego,
USA
|
You have to go to each scene object and test it to see if it gets a new material... a nested loop is the slowest, but easiest method to do this... provided your scene is a reasonable size this should work fine
for testObjectMat in objects do -- loop through all scene objects ( for TestLibMat in CurrentMaterialLibrary do -- test each object against each Material in Mat Lib ( try ( if ( testObjectMat.material.name == TestLibMat.name ) then testObjectMat.material=TestLinMat ) catch() ) ) good Luck Keith Morrison focus360.com |
07 July 2004 | |
![]() |
|
New Member
|
![]() thanks guys ,i added some conditional also like checking the material whether it's been assigned to the objects and all ....
oviam |
01 January 2006 | |
![]() |
|
Expert
|
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. |
Thread Closed share thread |
«
Previous Thread
|
Next Thread
»
|
|
|