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 Tools Search this Thread Display Modes
  10 October 2012
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")
#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

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

  10 October 2012
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.
  10 October 2012
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
Society of Digital Artists

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

All times are GMT. The time now is 11:00 AM.

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