CV Curve color for Controls


#1

Hey, does anybody knowhow to color cv curves without using User Defined Colors, or Layers? I’m trying to color the controls for my rig, and they settings need to be within the file to work with multiple computers.

If you’ve seen the Genrei rig, like his eye and head controls.
On that note, anybody know how the heck he got more than one cv object to select as and be one object?

Also, if you have an answer for the color, I’m hopping to connect some kind of slider to the color of the cv that will shift the hue of the color, so the animators can change the control colors incase they’re blending in with the background.


#2

Ok, first thing. Look in the attribute editor under Drawing Overrides. That’s where the colors and such are controlled. Note that these become connected when you add things to layers, so you may have to do some playing with the Connection Editor if you want to have your controls in a layer. The color control already has a slider, so that covers that. There’s lots of ways to expose that control (make it keyable, or add an attribute and expression or whatever) if it’s too buried for your tastes.


#3

Yeah, i saw that before, but I couldn’t figure out what it was connected to. And the only attribute I could find for it was overrideColor, but when messing with that attribute, after breaking it’s connection, I didn’t get any reaction from it. It didn’t say it was connected to anything in the conection editor, but the channel attribute said it was. I also didn’t find anything linked to it in the hypergraph.

Do you have any more detailed instructions how how to pull this off?


#4

I’m away from the computer running Maya, so take these with a grain of salt.

There are two controls you need to set. The first is the override enabled and the second is the color. If your object is in a layer, the shape and the transform’s Drawing Overrides (the group containing both these attributes as well as override visibility and such) is connected to the Layer. This locks all those attributes unless you create some other attribute to drive them. Not real useful.

In general, I want the Layer overrides for visibility, templatization, etc, but want to choose colors specifically. So, instead of adding an object to the Layer, which adds the connection I don’t want, I simply connect up the attributes on the layer that I want directly, rather than the uber-Drawing Overrides. You can do this manually with the connection editor, but it’s a bit tedious with lots of controls. It’s pretty easy to write a MEL script to do it, though, using a simple loop.

Here’s a little trick I’ve used to do it with minimal code writing of my own.

  1. Open the Connection Editor with the Layer in the left and the first object in the right.
  2. Clear the Script Editor History.
  3. Connect the attributes you wish from the layer to the object. Each time you do this, you’ll get a ‘connectAttr’ command in the SE history.
  4. Once done, Copy all the SE history to the clipboard
  5. Write the code:

for($i in ls -sl -fl):
{
// pasted code goes here
}

  1. Modify the pasted code, replacing the name of the first object with ‘($i’ and add a ) at the end of each line prior to the semicolon. It’ll be something like this:

connectAttr Layer.XXX Object.YYY;

becomes

connectAttr Layer.XXX ($i.YYY);

for each line.

  1. Select all the items you wish to link

  2. Execute the command in the SE.

If all goes well (and I haven’t forgotten anything) you’ll find a bunch of connections connecting each item to the layer. The layer’s controls will override those things so you can make all your controls invisible, for example, but not the others, which you can control manually.

Ok, that’s a lot, and it’s all from memory. It’s much easier to do than explain. Let me know if you need any more help/clarification.


#5

So I think I get all of what you’ve said there. The brick wall I keep hitting is getting it unattached for any of the layers. I’ve tried making the attributes keyable so i can break the conections in the channel menu, and I’ve tried disconecting the conection through the conection editor, but Maya keep crashing after I try to colose the conection editor after that.

Because even if it’s not on a layer I created, it’s on the default layer, and I can’t seem to get control away from that, so that I can just set the color to what ever I want. So i understand adding the controls to a layer by hand so the overides from it don’t take effect. I just can’t get it to the point where I have control in the first place

Do I need to link it to something else that has a draw info node first? Or is it that i’m using maya 6, which seems to be full of bugs maybe?

Anyway, maybe i’m just slow on this subject right now, but I need more specific directions on how to control the overrideColor.


#6

Yeah, the default layer thing is kind of annoying, but it’s pretty easy to get the object away from the layer managers.

Ok, select the item you wish to disconnect. Open the Hypergraph and graph incoming connections. You should see the layer, with a connection to both the object and its transform. Select each connection in turn and delete them. Voila, no more Layer connection.

I’m using 5.0.1, so I don’t know if it’s buggy in this respect or not, but this should work for you.


#7

Ok, cool. I got a hold of that and was able to set the colors to the desiered color and stick them on a layer. That works like a charm. One last question is what’s the attribute i’m hooking this up to to get a slider attribute for the color? I was trying the overrideColor attribute but it didn’t seem to affect anything. The only thing I’m getting outa the script editor are the menu window updates, but nothing on the object. I don’t see any new connections going into the shape either. Am I looking at the wrong object?

Also, not that this really maters for anything, but I’m just really curious if you know how the Generi rig has like the smileyface icon? It’s 4 seperate shapes, but selects as one when you click on any part of it. Has me totaly baffeled. not that I have any practical use for that other than cool icons, but… I just really want to know how to do that.

Anyway, again thanks for the color help. Makes my life much easier.


#8

If I understand what you’re asking, you don’t need to hook up another attribute to the overrideColor to make it useable. It’s right there. You could write some GUI MEL for it, or make it keyable so it’s visible in the channel box to make it easier to access, though. If you want to be really clever, you could create some attributes on your root control that controls the visibility and colors of groups of controls. I’ve done that, so I can control visibility of the controls (but not color) from the root.

As for the multiple shapes thing, what they probably did was create each of the shapes, then linked them all to the same transform node (I don’t have that rig to look at). I think you can do this in the hypergraph if you show both shape and transforms, and I know exactly where to look for the info (They talk about doing this in Inside Maya 5 in one of the setup chapters. It’s in a grey text box on a left hand page… I’ve got a very visual memory so can remember where info is better than I remember what it was. Frustrating, sometimes), but I don’t have it here. If you take the rig you’re talking about and look at the hierarchy in the HG, you should be at least able to confirm that that’s what they did.


#9

Well, what I want is to make a control some where that can change teh control colors to an alternet color incase it’s beldning in with the background. This isn’t so much for me, but for the animators, who i’m not sure would remember how to change the colors on their own.

I tried making the override attribues keyable, but none of the sliders were affecting the color change at all. I was trying to figure out if I was missing something there, or if the color override is suposed to do it?

It seems kinda strange because i can trun on enable overrides in the attribute editor, but then if i make overrideEnable keyable it shows up as off. And if I make overrideColor keyable, it’s channel slider doesn’t seem to affect anything.

It’s not a huge deal. I just figured it’d be a nice feature for animation.

I looked at the other rig, and it looks like that set up you were saying. I had had that idea also, but theres not actualy any connection between them that I could see. Or with any curve i made for that mater. two nodes, but no link inbetween them as far as I could tell. I must admit the Ypergraph is one of my weeker spots though. I tend to use the connection editor and outliner the most

Anyway, you’ve solved most of my problems, like I said before. I could figure out te mel for it if I knew what I was suposed to be affecting. I just havn’t been able to find that attribute.


#10

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.