Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Import and replace similarly names shaders

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
626 Views, 2 Replies

Import and replace similarly names shaders

Greetings! In my workflow I receive meshes with often more than 50 materials applied to it, all simple Phong shaders, with specific naming conventions. I have created a new collection of shaders, each being Arnold shaders designed to replace the Phongs and with identical names. I was hoping exporting the shaders and importing into the original scene file would simply replace the original shaders with the identical names, but this instead seems to apply the name of the imported shader file which I've saved as a .MB file to the beginning of all the shaders instead of replacing them.

 

I seem to remember being able to do this once but seems like it doesn't work anymore. Am I missing something?

2 REPLIES 2
Message 2 of 3
trs_andre
in reply to: Anonymous

Hi|!

Not sure if this works for you but you could select an old material, click the option to select all the meshes using that material, and then apply the new material, deleting the old one in the end. After doing this to all materials, you could rename them with a MEL script.

 

It should be possible to do everything within the same MEL script, though. For example, if all the new materials have the same prefix, you could do something like:

 

- Run through all materials

- Check what meshes are using material "old_A" and reconnect them to material "new_A"

- Delete material "old_A"

- And so on

 

Hope it helps!

André Moreira

Game Developer / Technical Artist

LinkedIn

Message 3 of 3
jordan.giboney
in reply to: Anonymous

hi @Anonymous 

 

Thanks for posting! did you have a chance to try the suggestion from @trs_andre? Any success? If you found another workaround we would love to hear it as well 🙂 

 

Thanks again for being a part of our community!



Jordan Giboney
Technical Solutions Engineer | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report