quite simple question about Class and intSlider...

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
quite simple question about Class and intSlider...

Hello, I am trying to get a value from a slider in a class to use it in another class, and i want this value to change and refresh when i move my slider.

Thank you for your help.

import maya.cmds as cmds
from math import sin



class Window:

def build(self):

cmds.window(title="RECURSION DES BOULES")
cmds.columnLayout()
cmds.button(label="CREATE",command="getValue()")
#print my slider value that changes when i move my slider
intSlider1 = cmds.intSliderGrp(field=True, label='number of recursions', minValue=1, maxValue=3)
#my slider
cmds.showWindow()

class getValue:

def __init__():
value = cmds.intSliderGrp(intSlider1, q=True, v=True)
#query my slider value... i do not know how to...
return value
#return my value to Window().build() button




Window().build()
 
Old 10 October 2012   #2
To make it change when you drag it you need to add the -changeCommand -flag and specify a procedure or command that will run when this event (change) happen.

Regarding queries on intSliders:
$var = `intSliderGrp -query -value nameOfTheIntSliderGrp`;
...should place the value of the slider into $var
__________________
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.
 
Old 10 October 2012   #3
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:44 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.