PDA

View Full Version : Drawing overrides


lifire
07-24-2006, 03:15 PM
So my rig is all set up and I'm ready to change the control curve colors (in Maya) and I get this error message when I try to change the color of the drawing override:

Error: The attribute 'curveShape2.overrideColor' is locked or connected and cannot be modified.

So I try to use this to unlock it:

setAttr curveShape2.overrideColor 1;

and it gives me the same error!

This is probably an easy thing to fix, but I've never encountered it before. So, does anyone know why this might be locked or what it is locked to and how to fix it or find it? Thanks!

rokandic
07-24-2006, 04:35 PM
You must use -lock flag to lock/unlock the attribute. In your case:

setAttr -lock 0 curveShape2.overrideColor;

lifire
07-24-2006, 05:25 PM
Well, even though I'm slightly embarassed to admit having that part wrong, the correct syntax still does not actually unlock the drawing override. When I execute it, it seems all is well, then I try to change the color in the attribute editor and... same error.

I figured it might be because the controller curve is a child to a null group for alignment purposes and I have to unlock that group as well, but that didn't work either. Weird.

rokandic
07-24-2006, 08:35 PM
Two things to check:
1. Is it a curve from a referenced file?
2. Is something connected to that attribute and thus cannot be changed?

lifire
07-24-2006, 10:34 PM
Hmmm.... I don't see that the override is connected to anything, at least I did not intentionally connect it. So unless something in my scene inadvertently connected all the overrides to something for all the curves currently controlling my character...

As for the curves, they have not been referenced or anything.

BoomRat
07-25-2006, 03:36 AM
You probably have it on a layer. Once there, you can't override as far as I know.

lifire
07-25-2006, 09:55 PM
As much as I thought 100% that removing it from a layer would work, sadly it did not. Oh well, I guess I'll just make 2 layers and change their display colors.

Nihilists
07-26-2006, 05:35 AM
I have a script that can over ride the colors of a given selection of nodes. If the node is on a layer the layer is disconnected from the colorOverride and change to a given color.

Found here: http://www.meljunky.com/meltrick.shtml
Also found below...


/*
colorOverride
Disconnects the overrideColor from the layer if available and applies the color given
Accepts 2 arguements:
$list[] - Nodes that will have their color changed. Transform nodes will be evaluated
to color a shape node if available. `ls -sl` can be used to color the selection
$color - values are based of Colors preference, index 1. (Window -> Settings/Preferences -> Colors...Tab(Active))
examples: 6 blue, 13 Red, 14 Green, 17 Yellow
Created by Brian Escribano
Website: www.melJunky.com (http://www.meljunky.com/)
Email: brian@meljunky.com
Version 1.0: June 7, 2006
*/
//This script is desiged to change the colorover fuction to a given color
global proc colorOverride (string $list[], int $color){
string $shape[], $layer[], $colorNode;

for ($node in $list){
//determine shape node
$shape = `listRelatives -f -s $node`;
if (size($shape) == 0){
//transform only
$colorNode = $node;
}else{
//shape node
$colorNode = $shape[0];
}
//determine layer
$layer = `listConnections -t displayLayer $colorNode`;
//disconnect layer if exists
if (size($layer) != 0)
disconnectAttr ($layer[0] + ".drawInfo") ($colorNode + ".drawOverride");
setAttr ($colorNode + ".overrideEnabled") 1;
setAttr ($colorNode + ".overrideColor") $color;
}
print "Color override complete.";
}

lifire
08-05-2006, 05:31 AM
Wow, thanks for that! I tried a different color override script and it didn't work. I just tried this and it worked. Now I'm just trying to figure out how and why it works, considering my curves are no longer in a layer. Yet it doesn't work if I simply enable overrides in the attribute editor...?

CGTalk Moderation
08-05-2006, 05:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.