Rigging

Rigging101 » Rigging128

Change Color (5 posts)

About This Topic

Tags

No tags yet.

  1. baljeetbhartiya

    offline
    Member
    Posted 6 years ago
    #

    How to change the NubsController color through script?

  2. BrianKenny

    offline
    Member
    Posted 6 years ago
    #

    setAttr "L_Clavicle_Ctrl.overrideEnabled" 1;
    setAttr "L_Clavicle_Ctrl.overrideColor" 6;

    end number represents the color on the slider and goes from 0 onward.

  3. baljeetbhartiya

    offline
    Member
    Posted 6 years ago
    #

    Thanks;
    I am see your demo.What kind of Setups are you use for stretch and squash.

  4. Smapdi

    offline
    Member
    Posted 6 years ago
    #

    here's a quick tip, change the color on the shape node of the control (same method as above, just on the shape node). This way the colors wont change when layers are used.

  5. Smapdi

    offline
    Member
    Posted 6 years ago
    #

    Here's some code to show what I was speaking of. My naming convention is baked in, change it as you need to ...

    cant get the code tag to work right here, mind the tabs

    sel = cmds.ls(sl=1)
    for eachSel in sel:
    sNodes = cmds.listRelatives(eachSel, shapes=1)
    for eachSnode in sNodes:
    cmds.setAttr(eachSnode + '.overrideEnabled', 1)
    if eachSnode.startswith('l_'):
    cmds.setAttr(eachSnode + '.overrideColor', 14)
    elif eachSnode.startswith('r_'):
    cmds.setAttr(eachSnode + '.overrideColor', 13)
    else:
    cmds.setAttr(eachSnode + '.overrideColor', 17)

Reply

You must log in to post.

Rigging101 » Rigging128
1,099 posts in 307 topics over 110 months by 188 of 8,226 members. Latest: fashionpvp, d2q4p5z2j, gasheldonl