FORUMS: list search recent posts

GUI Script for Buttons with Choise Node

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacqueline Johnsen
GUI Script for Buttons with Choise Node
on Nov 17, 2011 at 9:06:28 pm

I'm back! Still working on my adjustable character.

I've made some 2 coloured patterns like stripes and blocks and dots that should become fully adjustable through a melscript GUI. The colours work fine, the patterns were done by masks, but that's not important.
Because I'm stuck again. :(
With this:

window -width 150;
columnLayout -adjustableColumn true;
button -label "Button 1" -command "defaultButtonPush";
button -label "Button 2" -command "defaultButtonPush1”;
showWindow;

proc defaultButtonPush()
{
setAttr "choise1.selector" 1;
}
proc defaultButtonPush1()
{
setAttr "choise1.selector" 0;
}

Now I know it works fine with just the "defaultButtonPush" command, but it won't accept the other one.

just to be clear: I have 2 files attached to a choise node. If the selector of the choise node is 0, it will show one file, and if it's on 1 it will show the other file. So I need 2 buttons, 1 will change the selector to 0 and the other button will change it to 1. (there will be more files eventually)

I actually would have prefered a simple script like:

floatSliderButtonGrp -label "Label0" -value 0 ("choice1.selector");
or
button -l "Camouflage" setAttr choice1.selector $input[0];

But yeah, can't get those buttons to work! /grrr

Still! I almost had it!!!
...almost...

Help is greatly apreciated! ^^


Return to posts index


Jacqueline Johnsen
Re: GUI Script for Buttons with Choise Node
on Nov 22, 2011 at 12:17:28 pm

Looked it over with a programmer from school, and suddenly it worked...
:/ Must've been because an expert was watching! XD
Anyway, just glad it works now. Nice little node that choise node... ^^

window -width 150;
columnLayout -adjustableColumn true;
button -label "Squares" -command "defaultButtonPush0";
button -label "Camouflage" -command "defaultButtonPush1";
button -label "Anthro" -command "defaultButtonPush2";
button -label "Stripes" -command "defaultButtonPush3";
showWindow;
proc defaultButtonPush0()
{setAttr "choise1.selector" 0;}
proc defaultButtonPush1()
{setAttr "choise1.selector" 1;}
proc defaultButtonPush2()
{setAttr "choise1.selector" 2;}
proc defaultButtonPush3()
{setAttr "choise1.selector" 3;}


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]