Leffler
04-15-2009, 01:21 PM
Hello!
I want to create a nurbs sphere that gets disconnected from itīs shader, so it turns up like a big solid dot in the maya UI. Its for rigging purposes
But I cant really figure out how to make the disconnection to work every time
This is the code so far
$nurbSph = `sphere -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r .5 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 4 -ch 0 -n "test"`;
select -r $nurbSph;
pickWalk -d down;
string $sel[] = `ls -sl`;
disconnectAttr ($sel[0] + ".instObjGroups[0]")("initialShadingGroup.dagSetMembers[0]");
setAttr($sel[0] + ".overrideEnabled")1;
setAttr($sel[0] + ".overrideColor")23;
What I want to make dynamic is this row
disconnectAttr ($sel[0] + ".instObjGroups[0]")("initialShadingGroup.dagSetMembers[0]");
I have tried to use listConnections and stuff like that but no luck. What can be used here?
What I want to do is basicly this:
# Get the shape node (which I have, by pickwalking down)
# Find out what connection it has to the shadingroup
# Break that connection
Help would be great, thanks in advance!
Otto
I want to create a nurbs sphere that gets disconnected from itīs shader, so it turns up like a big solid dot in the maya UI. Its for rigging purposes
But I cant really figure out how to make the disconnection to work every time
This is the code so far
$nurbSph = `sphere -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r .5 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 4 -ch 0 -n "test"`;
select -r $nurbSph;
pickWalk -d down;
string $sel[] = `ls -sl`;
disconnectAttr ($sel[0] + ".instObjGroups[0]")("initialShadingGroup.dagSetMembers[0]");
setAttr($sel[0] + ".overrideEnabled")1;
setAttr($sel[0] + ".overrideColor")23;
What I want to make dynamic is this row
disconnectAttr ($sel[0] + ".instObjGroups[0]")("initialShadingGroup.dagSetMembers[0]");
I have tried to use listConnections and stuff like that but no luck. What can be used here?
What I want to do is basicly this:
# Get the shape node (which I have, by pickwalking down)
# Find out what connection it has to the shadingroup
# Break that connection
Help would be great, thanks in advance!
Otto
