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: 

Maya 2020.1 and MLdeleteUnused issue with SurfaceShader1

3 REPLIES 3
Reply
Message 1 of 4
Craig_Lamorte
1973 Views, 3 Replies

Maya 2020.1 and MLdeleteUnused issue with SurfaceShader1

Hi,

 

I have discovered on when I run

mel.eval("MLdeleteUnused();")

in maya 2020.1 that this error is thrown

 

// Error: line 0: Non-deletable node 'standardSurface1' cannot be deleted. // 

And sometimes it will crash maya as well.  Looks like standSurface1 is a new default shader in maya.  Looks like it was never added to ignore that material during the MLdeleteUnused command.  Is this a bug or am i missing something?

 

3 REPLIES 3
Message 2 of 4

anyone have a resolution to this.  Can't seem to figure how to get around this, it breaks all of our tools that use the delete unused materials function.

Message 3 of 4
lanh.hong
in reply to: Craig_Lamorte

Hi Craig.Lamorte,

 

This is a known bug in Maya 2020. There will be a fix in an upcoming update or release. 

 

In the meantime, the way to fix this is to add a few lines of code to the MLdeleteUnused.mel file to get a list of default materials and skip deleting them. I've attached the updated MLdeleteUnused.mel file here so you can just replace the old file with this one. The file can be found in C:\Program Files\Autodesk\Maya2020\scripts\others\ .

 

Regards,

Lanh


Lanh Hong
Developer Technical Services
Autodesk Developer Network



Message 4 of 4

Did this get fixed? Im on Maya 2022.3 and am getting

// Error: line 0: Non-deletable node 'standardSurface1' cannot be deleted. Im trying to do "delete unused nodes" option in the hypershade

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

Post to forums  

Autodesk Design & Make Report