Can't assign shaders - error parsing arguement

Can't assign shaders - error parsing arguement

arcon76
Collaborator Collaborator
23,813 Views
20 Replies
Message 1 of 21

Can't assign shaders - error parsing arguement

arcon76
Collaborator
Collaborator

Maya 2017 has a bug where sometimes a shader will randomly get corrupted, with any attempt to apply a different shader to the object its on resulting in the following error:

 

// Warning: line 1: Node 'polySurfaceShape21921.instObjGroups[0]': cannot make assignment to 'rs_woodSG1' shader. // 
// Error: line 1: Error while parsing arguments. // 

The only solution I've found is deleting the shading network & making a new one. Just more 2017 buggy bullcrap.

 

 

Accepted solutions (1)
23,814 Views
20 Replies
Replies (20)
Message 2 of 21

BenBisares
Autodesk Support
Autodesk Support

Do you have an archive (File > Archive Scene) of a scene that exhibits this behaviour that you can share with us?

 

From my experience we have seen this happen with scenes that have nested references and/or multiple render layers.

 

We have a ticket open with development for what I believe is the same issue but it's still under investigation so we would like as much data as we possible.



Ben Bisares
0 Likes
Message 3 of 21

Christoph_Schaedl
Mentor
Mentor

try deleting the history and assign the labert1 shader first...

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Message 4 of 21

arcon76
Collaborator
Collaborator

Hi sorry for the extreme delay in my reply. The behaviour seemed to correct itself as I progressed the project (I should've saved a version with the fault lol), however I will keep an eye out for it on my next project and report back here if I see it again.

 

0 Likes
Message 5 of 21

creationasif
Contributor
Contributor

hey

create a copy of this file 

and unlink your all shader connection by using this script.

global proc unlinkall()
{
string $lsm[] = `ls {"_UNKNOWN_REF_NODE_*"}`;
catchQuiet(`delete $lsm`);

string $objs[] = `ls -type mesh-long -type shape`;
int $i=0;
int $j=0;
int $m=0;
int $k=0;
for($i=0;$i<size($objs);$i++)
{
int $chk=`gmatch $objs[$i] "*Ctrl*"`;
if ($chk==0)
{
string $cons2[]=`listConnections -type "shadingEngine" -p true -s true $objs[$i]`;
for($j=0;$j<size($cons2);$j++)
{
string $cons3[]=`listConnections -p true -s true $cons2[$j]`;
catchQuiet(`disconnectAttr $cons2[$j] $cons3[0]`);
catchQuiet(`disconnectAttr $cons3[0] $cons2[$j] `);
} 
} 
}
}
unlinkall();

After asign lambert1.

and do shader transfer from old file.

problem will solve.. if still there is any issue feel free to ping me 

0 Likes
Message 6 of 21

resorsky
Contributor
Contributor

This is not solution! The soultion is repair the bug in SG itself. Problem usualy appear when you copy shader with shading group and try assign it to different model. But i never notice this bug when i copy only shader without shading group. The best solution for non destructive way is delete SG and assign again shader to object, then the new SG create automaticly and everything works fine. The bug exist since maya 2012 even earlier I think. It's very anoying, appear not often, but when it appear it could mess all scene file. I dont know why somebody in autodesk dont notice that.

Message 7 of 21

rockyhCU7BB
Community Visitor
Community Visitor

And it's still happening in Maya 2018.. exact same issue, same solution. When I duped a shading network and assigned it to a different object, I got exactly same msg - error parsing argument. So I just had to delete the new SG and assign different texture or rebuild the SG on my own. 

Message 8 of 21

gferra21
Community Visitor
Community Visitor

I found this thread for the "error while parsing arguments" when trying to assign another shader. I'm working in Maya 2020 with render layers, which I hear is sometimes connected to this issue...This bug still exists. Unlinking all of my shaders is a huge hassle, and would rather go back to an old file and lose an hour of work. Really hope this bug gets fixed. 

Message 9 of 21

tnZADWX
Explorer
Explorer

The bug is still here in 2022.2. I get it all the time - 😩😩😩

Message 10 of 21

sarawilde7
Observer
Observer

Encountered this bug in 2022 with duplicated shader graphs. Huge time waster. Thanks for the thread though glad to see users are at least tracking this. 

Message 11 of 21

Henrik_Cederblad
Advocate
Advocate

Here's another report of this happening in 2022.3 while assigning an existing ai_StandardSurface material to multiple objects.

Message 12 of 21

tommie.christiansen
Community Visitor
Community Visitor

Have had issues with this since maya 2015. There is some funky stuff going on with how Shadinggroup Sets are connecting to nodes atleast. 

0 Likes
Message 13 of 21

ktplive
Community Visitor
Community Visitor

Had this issue when I was using cmds.createNode('shadingGroup' etc....  to create the shading group

Soon as I changed it to some of my older scripts which used:

cmds.sets(empty=True, renderable=True,noSurfaceShader=True, name=name+'SG');

 

I could start assigning via cmds.hyperShade(a='Material Name')

 

Message 14 of 21

joshoantonio
Community Visitor
Community Visitor
This was exactly the issue! Thanks!
0 Likes
Message 15 of 21

ingemaryinsturain
Community Visitor
Community Visitor

I fixed by exporting the object as obj and importing it back into the scene. This is how he dissociates itself from the SG

0 Likes
Message 16 of 21

severinderek
Explorer
Explorer
Accepted solution

Late reply, but hopefully it will help users encountering the same issue.

We had this issue in Maya 2020, but it does not seem to be related to the version of Maya, as it is still happening in Maya 2022.

 

Found out that (in my case) the issue was related to the shading group not being connected to a render partition.

Don't know how this happened, but it seems to have been corrupted somewhere.

 

By adding the connection to the SG, it solves the problem.

In MEL:

 

connectAttr "<SHADING_GROUP>.pa" ":renderPartition.st" -na;

 

where "<SHADING_GROUP" is the name/path of the shading group node.

Example:

connectAttr "mainShaderSG.pa" ":renderPartition.st" -na;

 

Of course, deleting and recreating a new SG also works, but sometimes you don't want to delete the nodes.

Message 17 of 21

infoLUD4N
Observer
Observer

I can't see the reason to keep making new versions of the software when stupid bugs like this won't be fixed. The same with the pivot snap issue that have been there for years. Come on, this is totally basic functions, we are paying money for this to work 😞

Message 18 of 21

tompainterbigman
Participant
Participant

+1 this is a super annoying bug I'm getting it every week at the moment

0 Likes
Message 19 of 21

tompainterbigman
Participant
Participant

todays version of this bug has something to do with namespaces for me, the script editor reads..

sets -e -forceElement A_v22cloth1:blinn3SG;

I can assign other materials just not this one

0 Likes
Message 20 of 21

matthias.richter
Contributor
Contributor
Life saver!
0 Likes