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

Select Objects with Material but only from selection or replace material in selection of objects?

1 REPLY 1
Reply
Message 1 of 2
devinm3d
403 Views, 1 Reply

Select Objects with Material but only from selection or replace material in selection of objects?

devinm3d
Participant
Participant

SOS!

 

I know about the Maya Hypershade ability to "Select Objects with Material".... and I am looking for exactly that feature, BUT only on the selected objects in my scene... at the moment I have over 100k models in my Maya file that all need a material replaced on the object, and if I try to run "Select Objects with material" it breaks my Maya and freezes BAAAD...

I know a little python, but it would greatly help if someone could point me in the right direction for this. Even if its kinda a hacky way. I've got a major deadline and this would SAVE THE DAY.

 

devinm3d_0-1646451340100.png

 

devinm3d_1-1646451355868.png

 

 

0 Likes

Select Objects with Material but only from selection or replace material in selection of objects?

SOS!

 

I know about the Maya Hypershade ability to "Select Objects with Material".... and I am looking for exactly that feature, BUT only on the selected objects in my scene... at the moment I have over 100k models in my Maya file that all need a material replaced on the object, and if I try to run "Select Objects with material" it breaks my Maya and freezes BAAAD...

I know a little python, but it would greatly help if someone could point me in the right direction for this. Even if its kinda a hacky way. I've got a major deadline and this would SAVE THE DAY.

 

devinm3d_0-1646451340100.png

 

devinm3d_1-1646451355868.png

 

 

Labels (7)
1 REPLY 1
Message 2 of 2
mcw0
in reply to: devinm3d

mcw0
Advisor
Advisor

The logic for this would be:

1.  Get your selection

2.  Get the shader connections of your selection

3.  Loop through shaders to find the one you want to replace

4.  Reassign new shader when old shader is found.


0 Likes

The logic for this would be:

1.  Get your selection

2.  Get the shader connections of your selection

3.  Loop through shaders to find the one you want to replace

4.  Reassign new shader when old shader is found.


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

Post to forums  

Autodesk Design & Make Report