How can I make a curve non selectable (without template/layer and keeping color)

Hi there.
Quick question regarding Maya curves.
I’m trying to make a curve to be not selectable, but maintaining the Override color(let’s say yellow rgb 1 1 0).
I want to keep that specific color, so template and reference won’t do the trick since it changes the color.
I tried putting it into a layer, but it changes the color as well.
Is there any way to do this?

Thanks!
Dimitri

Not really, not without creating a custom draw node… you can however (if you are not templating any other objects in your scene) set the inactive Template color to Yellow.

Hope that helps.

~B)

Hi Robert.
I thought about that too, but then I would be left with only one color.
I need the curves to be in different colors.
I guess I’ll have to create custom nodes.
Thanks for the help!
Dimitri.

try putting the color override on the shape node(s), not the transform of the curve.

Hi Chad.
I did the override color on the shape node. If I make the transform either a template or reference, I can still select the shape node :frowning:
Also if I put either the shape or transform node in a layer it will inherit the template/reference color. If the shape node has the override color prior being added to the layer it won’t inherit the the layer reference/template color, but it will be selectable.

I guess it’s not possible to get a curve to be colored and non-selectable unless one makes a custom node.
Thanks for your help.

seems a little monotonous but what if you made a scriptJob that just clears the selection if the selected object is equal to whatever objects you don’t want selected, stored in list?

Hi Matt.
I think that might work! I’m gonna try it.
I assume if I have a scriptJob for every curve control like that it would get heavy, right?
Thanks for the help.

[QUOTE=dimitrifrazao;10491]Hi Matt.
I think that might work! I’m gonna try it.
I assume if I have a scriptJob for every curve control like that it would get heavy, right?
Thanks for the help.[/QUOTE]

You’ll probably notice it a bit each time you select the curve that you don’t want selectable (as it’ll trigger the job and then restore the previous selection), but it shouldn’t be horrendous.

I’ve written a tutorial using a scriptNode and a scriptJob based on selection change that you can easily edit to work for you.

If you chop out all the stuff about changing the material on the selected mesh and replace it with some script undo the curve selection using the undo command you should be able to get it working pretty quickly.

matt.

Matt.