cmds.button (python, callbacks, maya 2011) , takes no arguments, one given

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 06 June 2011   #1
cmds.button (python, callbacks, maya 2011) , takes no arguments, one given

Hi,

I am writing a UI for my script.

The gist of it is that I have a UI, and that UI has a button, when I click the button that runs this:

def createDummyButton():         
	d = Dummy('locators', 'globalCtrl', 'gScale', 'grpNodes', 'killM')



It gives the error :


# Error: createDummyButton() takes no arguments (1 given) # 




And that's all it does. I have tried inserting self into the parenthesis and also *args, but nothing works so far.... Could anyone help me out? To be blunt, I got classes to work 3 hours ago, and have been rewriting a 2000 line script since, I don't know if I'm even accessing that class properly. Or writing my entire script properly. But when ran without the button, it works great. It's only the button that complains.



Cheers.


I can post my UI script, so will do that.



 import maya.cmds as cmds 
 
 from createDummyRig import *
 
   rigUI = 'rigUI'
 
   if cmds.window(rigUI, exists = True):
 
      cmds.deleteUI(rigUI)
 
   rigUI = cmds.window(rigUI, t = 'JT Rigging UI', sizeable = False, tb = True, mnb = False, mxb = False, menuBar = True, tlb = True, nm = 5)
 
  form = cmds.formLayout()
 
  tabs = cmds.tabLayout(innerMarginWidth = 1, innerMarginHeight = 1)
 
  rigUIMenu = cmds.menu('Help', hm = True)
 
  cmds.menuItem('About')
 
  cmds.popupMenu(button = 1)
 
  cmds.formLayout(form, edit = True, attachForm = ((tabs, 'top', 0), (tabs, 'left', 0), (tabs, 'bottom', 0), (tabs, 'right', 0)), w = 30)
 
      tab1 = cmds.rowColumnLayout('Dummy')
 
  #cmds.columnLayout(rowSpacing = 10)
 
  #cmds.setParent('..')
 
  cmds.frameLayout(l = 'Dummy Skeleton Setup', w = 400)
 
  cmds.textFieldGrp (label="Character Name:", ann="Insert a name for the character or leave empty.", tx = '', w = 1)
 
  cmds.textFieldGrp (label="Global Scale:", ann="Scale of Character is basis or multiplier for all further controllers", tx = '', w = 1, ed = False, en = False)
 
  fingJUI = cmds.frameLayout(l = 'Number of Fingers', w = 10)
 
  cmds.text('\n', h = 5)
 
  fingButtonGrp = cmds.radioButtonGrp(p = fingJUI, l = 'Fingers: ', sl = 0, w = 1, numberOfRadioButtons = 4, labelArray4 = ['One', 'Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw5 = [60,60,60,60,60])
 
  #testing = cmds.radioButtonGrp(fingButtonGrp, q = True, cw4 = True)
 
  #print testing
 
  cmds.text('\n', h = 5)
 
  spineJUI = cmds.frameLayout(l = 'Number of Spine Joints')
 
  cmds.text('\n', h = 5)
 
  cmds.radioButtonGrp(p = spineJUI, l = 'Spine Segments: ', sl = 0, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Three', 'Five', 'Ten'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
 
  cmds.text('\n', h = 5)
 
  neckJUI = cmds.frameLayout(l = 'Number of Neck Joints')
 
  cmds.text('\n', h = 5)
 
  cmds.radioButtonGrp(p = neckJUI, l = 'Neck Segments: ', sl = 0, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
 
  cmds.text('\n', h = 5)
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
  cmds.button(l = '\nCreate Dummy Skeleton\n', c = createDummyButton)
 
  cmds.columnLayout()
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab2 = cmds.rowColumnLayout('Skeleton')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Skeleton Setup')
 
  cmds.text('testA')
 
  cmds.columnLayout()
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab3 = cmds.rowColumnLayout('Legs')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Leg Rig Setup')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab4 = cmds.rowColumnLayout('Arms')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Arm Rig Setup')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab5 = cmds.rowColumnLayout('Spine and Head')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Spine Rig Setup')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab6 = cmds.rowColumnLayout('Stretchy IK')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Stretchy Setup')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   tab6 = cmds.rowColumnLayout('Extras')
 
  cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
 
  cmds.setParent('..')
 
  cmds.frameLayout(l = 'Extras')
 
  cmds.setParent('..')
 
  cmds.setParent('..')
 
   cmds.showWindow(rigUI)
 
   def crSkelButton():
 
      cmds.textFieldGrp (label="Global Scale:", ann="Scale of Character is basis or multiplier for all further controllers", tx = d.gScale, w = 1, ed = False, en = False, edit = True)
 
Old 06 June 2011   #2
Some widgets automatically pass arguments during a callback, so you'll need to make sure your function will allow for these, just by providing dummy arguments.

import maya.cmds as cmds
cmds.window()
cmds.columnLayout()
cmds.button(command=doIt)
cmds.showWindow()

def doIt(arg=None):
	print 'foo'


This particular situation, and others are discussed in detail in the pyMel docs.
__________________
vimeo
blog
 
Old 06 June 2011   #3
Hi,

Usually that would be the case, but I have tried passing it dummy arguments, it just gives the same error unfortunately.


Urgh so foolish... I just restarted maya and now it works.

Last edited by JaredTaylor : 06 June 2011 at 10:29 AM.
 
Old 06 June 2011   #4
are you sure you are reloading your modified code properly?

restart Maya, then input or import your code with the relevent lines as follows:
def createDummyButton(*args):
...
cmds.button(l = 'Create Dummy Skeleton', c = createDummyButton)
and if it doesn't work your problem lies elsewhere.
:nathaN
 
Old 06 June 2011   #5
I just found out as you said it, all I had to do was restart maya / reload the code.

Thanks guys... I guess these things happen when you don't sleep.
 
Old 06 June 2011   #6
Me again... just one more issue...

I have a text field for my autorig where you enter the name of the character, if I select all my code and run it (it's separate from the UI code), then hit the create dummy rig button it all goes fine. But if I get the code through 'from createDummyRig import *' it simply errors out, because in the dummy rig file the __init__ is getting the character name to use as a prefix from the text box.

It says:

Error: NameError: file C:/Users/Jared/Documents/maya/scripts\createDummyRig.py line 66: global name 'charNameUI' is not defined # 


line 66 is this:

charName = cmds.textFieldGrp(charNameUI, q = True, tx = True) + '_'


And charNameUI is this:

charNameUI = cmds.textFieldGrp ('nameTextField', label="Optional Character Name:", ann="Insert a name for the character or leave empty.", tx = '', w = 1)
 
Old 06 June 2011   #7
btw. if you do ui in python and may2011, I recommend pymel. At the moment you write:


cmds.columnLayout()
...
cmds.setParent("..")


With pymel you are able to write:


import pymel.core as pm
with pm.columnLayout():
	  with pm.rowLayout():
			...
	  with pm.columnLayout():
			....

No hassle with setParent(..) any more and you have indentation what helps very much not loosing the orientation.
 
Old 06 June 2011   #8
Originally Posted by Virtualistic: Me again... just one more issue...


As far as the error goes, the variable is out of scope.

I can't be sure how you've structured your code. Since you've mentioned '__init__', I assume you're using classes. If you are, you might want to take advantage of data attributes & inheritance if you're not already.

Here's how I might go about it.

ui.py
import maya.cmds as cmds
import createDummyRig

class UI(createDummyRig.CreateDummyRig):
	def __init__(self):
		self.win = 'win'
		if cmds.window(self.win, exists=True):
			cmds.deleteUI(self.win)

		self.win = cmds.window()
		self.layout = cmds.columnLayout()
		self.textField = cmds.textField()
		self.button = cmds.button(label='Create Rig', command=self.build)
		cmds.showWindow(self.win)



createDummyRig.py
import maya.cmds as cmds

class CreateDummyRig():
	def __init__(self):
		pass
	def build(self, *args):
		self.charName = cmds.textField(self.textField, query=True, text=True)
		print '...building %s dummy rig' % self.charName 



In script editor:
import ui
ui.UI()



I would recommend writing your code in an external editor & using the reload function in maya each time you make changes.
__________________
vimeo
blog

Last edited by mlefevre : 06 June 2011 at 02:54 PM. Reason: Formatting code
 
Old 06 June 2011   #9
Hi there,

Thanks for your help but it is still giving me the same error. I rewrote it how you specified, I think I got it right.. but.. it still gives the same error.

I'll post up my code but it's around 2k lines long. First is interface, second is creation of dummy rig. I have to apologize, I have been doing python for only a week now and I've done a lot of things the long way. Was learning a year ago but got nowhere back then.

Err, it wont let me post, about 4x too long to fit in, so I'll use pastebin.

import maya.cmds as cmds import createDummyRig as dum
     
       #reload(dum)
     
        class RUI(dum.Dummy):
     
          def __init__(self, charNameUI):
     
              
     
               
     
              rigUI = 'rigUI'
     
              
     
              if cmds.window(rigUI, exists = True):
     
                  cmds.deleteUI(rigUI)
     
              
              rigUI = cmds.window(rigUI, t = 'JT Rigging UI', sizeable = False, tb = True, mnb = False, mxb = False, menuBar = True, tlb = True, nm = 5)
     
              form = cmds.formLayout()
     
              tabs = cmds.tabLayout(innerMarginWidth = 1, innerMarginHeight = 1)
     
              rigUIMenu = cmds.menu('Help', hm = True)
     
              aboutMenu = cmds.menuItem('about')
     
              cmds.popupMenu('about', button = 1)
     
              deleteUIMenu = cmds.menu('Delete', hm = True)
     
              cmds.menuItem('dummySkeleton')
     
              cmds.formLayout(form, edit = True, attachForm = ((tabs, 'top', 0), (tabs, 'left', 0), (tabs, 'bottom', 0), (tabs, 'right', 0)), w = 30)
     
              
     
              
     
              
     
              
     
              
     
              tab1 = cmds.rowColumnLayout('Dummy')
     
              #cmds.columnLayout(rowSpacing = 10)
     
              #cmds.setParent('..')
     
              cmds.frameLayout(l = 'Dummy Skeleton Setup', w = 400)
     
              self.charNameUI = cmds.textFieldGrp ('nameTextField', label="Optional Character Name:", ann="Insert a name for the character or leave empty.", tx = '', w = 1)
     
              gScaleUI = cmds.textFieldGrp (label="Scale Multiplier:", ann="Scale multipler of Character: basis for all further base controllers", tx = '1.0', w = 1, ed = False, en = False)
     
              fingJUI = cmds.frameLayout(l = 'Number of Fingers', w = 10)
     
              cmds.text('\n', h = 5)
     
              fingButtonGrp = cmds.radioButtonGrp('fingRadio', p = fingJUI, l = 'Fingers: ', sl = 4, w = 1, numberOfRadioButtons = 4, labelArray4 = ['One', 'Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw5 = [60,60,60,60,60])
     
              #testing = cmds.radioButtonGrp(fingButtonGrp, q = True, cw4 = True)
     
              #print testing
     
              cmds.text('\n', h = 5)
     
              spineJUI = cmds.frameLayout(l = 'Number of Spine Joints')
     
              cmds.text('\n', h = 5)
     
              cmds.radioButtonGrp('spineRadio', p = spineJUI, l = 'Spine Joints: ', sl = 2, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Three', 'Five', 'Ten'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
     
              cmds.text('\n', h = 5)
     
              neckJUI = cmds.frameLayout(l = 'Number of Neck Joints')
     
              cmds.text('\n', h = 5)
     
              cmds.radioButtonGrp('neckRadio', p = neckJUI, l = 'Neck Joints: ', sl = 0, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
     
              cmds.text('\n', h = 5)
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              cmds.button(l = '\nCreate Dummy Skeleton\n', c = createDummyButton) # also have it make char name field grey
     
              cmds.columnLayout()
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab2 = cmds.rowColumnLayout('Skeleton')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Skeleton Setup')
     
              cmds.text('testA')
     
              cmds.columnLayout()
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab3 = cmds.rowColumnLayout('Legs')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Leg Rig Setup')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab4 = cmds.rowColumnLayout('Arms')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Arm Rig Setup')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab5 = cmds.rowColumnLayout('Spine and Head')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Spine Rig Setup')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab6 = cmds.rowColumnLayout('Stretchy IK')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Stretchy Setup')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              tab6 = cmds.rowColumnLayout('Extras')
     
              cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
     
              cmds.setParent('..')
     
              cmds.frameLayout(l = 'Extras')
     
              cmds.setParent('..')
     
              cmds.setParent('..')
     
              
     
              cmds.showWindow(rigUI)
     
              #test1 = cmds.radioButtonGrp('spineRadio', q = True, sl = True)
     
              #test1 = cmds.radioButtonGrp('test', q = True, sl = True)
     
              #print test1
     
      def crSkelButton():
     
          cmds.textFieldGrp (label="Global Scale:", ann="Scale of Character is basis or multiplier for all further controllers", tx = d.gScale, w = 1, ed = False, en = False, edit = True)
     
          
     
      r = RUI('charNameUI')
     
       





actual dummy script: http://pastebin.com/tJDkL1Ne

line 68 is where it errors

Even if I use:

charName = cmds.textFieldGrp(RUI.charNameUI, q = True, tx = True) + '_'

It just says RUI has no attribute named 'charNameUI'... and it does.

Another thing, why when I make a definition:

 def createDummyButton(arg=None):     d = Dummy('locators', 'globalCtrl', 'gScale', 'grpNodes', 'killM', 'layerNodes')
 
 

does it only execute the code and NOT store the instance? :/

Last edited by JaredTaylor : 06 June 2011 at 08:58 PM.
 
Old 06 June 2011   #10
Okay, there's a number of issues, but essentially you're calling a function (createDummyButton) from your RUI instance, which instantiates a class(Dummy in this case) and you're expecting this instance to have access to a data attribute (instance.charNameUI) contained in the RUI instance which inherits from Dummy. These are TWO different instances.

Presumably you have a python module in your scripts directory called RUI.py, or perhaps UI.py, or something else. I only say this, because it needs to be clear as to whether you're running this from the script editor and/or you plan to later import it as a module, or whether you'll just assign it as a shelf button or some other thingy..maybe within a package or something else.

So, lets say your UI code is contained in rui.py in your scripts directory. You'd call on it with:

import rui
rui.RUI()


I'm not sure why you're passing in charNameUI as a string to the constructor. I can't see why it would be necessary, so I'd take it out, atleast for now.
That'll mean removing the parameter from the class RUI's init.

class RUI(dum.Dummy):
	def __init__(self):


Get rid of the 'createDummyButton' function.
If you wanted to access it, you'd need to refer to its module, which in this case is 'dum', so you'd use dum.createDummyButton.
However, Dummy is a base class of RUI, you've inherited its 'build' method, so lets use it.

Change:

cmds.button(l = '\nCreate Dummy Skeleton\n', c = createDummyButton)


to:

cmds.button(l = '\nCreate Dummy Skeleton\n', c = self.build)


Since your build method takes arguments, you can use the partial function from the functools module. However, you're hard-coding these values anyway from within the function 'createDummyButton', so there's not much point in having them as parameters to your build method.
Simply declare them as data attributes when you call on it.

Change:

def build(self, locators, globalCtrl, gScale, grpNodes, killM):


to:

def build(self):

	self.locators = 'locators'
	self.globalCtrl = 'globalCtrl'
	#and so on..


Within your UI code, which we'll say is within rui.py, you have the following:
self.charNameUI = cmds.textFieldGrp ('nameTextField', label="Optional Character Name:", ann="Insert a name for the character or leave empty.", tx = '', w = 1)


..this is creating an instance attribute that holds a reference to the textField, but you're also naming it explicity with 'nameTextField', which isn't necessary.

As you've inherited the build method from Dummy class, the instance will have access to the data attribute 'self.charNameUI'. Consequently, so will any other method within either class of the instance. So whenever you need to query the input in the textField, use this data attribute to refer to the textField control.

self.charName =  cmds.textFieldGrp (self.charNameUI, query=True, text=True)


Unfortunately I can't test any of this out. I'm getting indentation issues.
__________________
vimeo
blog

Last edited by mlefevre : 06 June 2011 at 12:08 AM. Reason: Formatting...once again..sux!
 
Old 06 June 2011   #11
On a side note, (which incidently, I'd usually just edit my previous message but it just ****s up the formatting and I can't be bothered going thru that again...), I don't presume that this stuff is correct, I might be wrong. But I'd deffo try stick with python and oop type stuff.

Good luck
__________________
vimeo
blog
 
Old 06 June 2011   #12
Hey,

I followed what you said as best as I could, only issue is I don't entirely understand what's happening but the more I read/do the more sense it makes.

I finally have everything working except for one thing, if I pass any arguments to the button, 'c = self.build', it executes on opening the GUI. If I pass no arguments, the button wont work because it complains of a lack of arguments (got 2 need 7).

This is what it's calling:

def build(self):
	 self.locators = 'locators'
  
       self.globalCtrl = 'globalCtrl'
  
       self.gScale = 'gScale'
  
       self.grpNodes = 'grpNodes'
  
       self.killM = 'killM'
  
       self.layerNodes = 'layerNodes'



Thanks so much for your help.

Last edited by JaredTaylor : 06 June 2011 at 01:22 AM.
 
Old 06 June 2011   #13
It sounds like you would need to reload 'createDummyRig' module, as it's constructor is still asking for several arguments.

I just booted it up & the UI and rig framework looks quite cool!

I'd really recommend though that you take a closer look at python oop to really take full advantage of it. Start off experimenting with really small classes. 2000+ lines of code to deal with is pretty mental if you've had only a weeks experience.

CreateDummyRig - PasteBin

import maya.cmds as cmds
import createDummyRig as dum

class RUI(dum.Dummy):
	def __init__(self):
		rigUI = 'rigUI'
		if cmds.window(rigUI, exists = True):
			cmds.deleteUI(rigUI)
		rigUI = cmds.window(rigUI, t = 'JT Rigging UI', sizeable = False, tb = True, mnb = False, mxb = False, menuBar = True, tlb = True, nm = 5)
		form = cmds.formLayout()
		tabs = cmds.tabLayout(innerMarginWidth = 1, innerMarginHeight = 1)
		rigUIMenu = cmds.menu('Help', hm = True)
		aboutMenu = cmds.menuItem('about')
		cmds.popupMenu('about', button = 1)
		deleteUIMenu = cmds.menu('Delete', hm = True)
		cmds.menuItem('dummySkeleton')
		cmds.formLayout(form, edit = True, attachForm = ((tabs, 'top', 0), (tabs, 'left', 0), (tabs, 'bottom', 0), (tabs, 'right', 0)), w = 30)
		tab1 = cmds.rowColumnLayout('Dummy')
		cmds.frameLayout(l = 'Dummy Skeleton Setup', w = 400)
		self.charNameUI = cmds.textFieldGrp ('nameTextField', label="Optional Character Name:", ann="Insert a name for the character or leave empty.", tx = '', w = 1)
		gScaleUI = cmds.textFieldGrp (label="Scale Multiplier:", ann="Scale multipler of Character: basis for all further base controllers", tx = '1.0', w = 1, ed = False, en = False)
		fingJUI = cmds.frameLayout(l = 'Number of Fingers', w = 10)
		cmds.text('\n', h = 5)
		fingButtonGrp = cmds.radioButtonGrp('fingRadio', p = fingJUI, l = 'Fingers: ', sl = 4, w = 1, numberOfRadioButtons = 4, labelArray4 = ['One', 'Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw5 = [60,60,60,60,60])
		cmds.text('\n', h = 5)
		spineJUI = cmds.frameLayout(l = 'Number of Spine Joints')
		cmds.text('\n', h = 5)
		cmds.radioButtonGrp('spineRadio', p = spineJUI, l = 'Spine Joints: ', sl = 2, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Three', 'Five', 'Ten'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
		cmds.text('\n', h = 5)
		neckJUI = cmds.frameLayout(l = 'Number of Neck Joints')
		cmds.text('\n', h = 5)
		cmds.radioButtonGrp('neckRadio', p = neckJUI, l = 'Neck Joints: ', sl = 0, w = 1, numberOfRadioButtons = 3, labelArray3 = ['Two', 'Three', 'Four'], ct2 = ('left', 'left'), cw4 = [95,95,95,95])
		cmds.text('\n', h = 5)
		cmds.setParent('..')
		cmds.setParent('..')
		cmds.setParent('..')
		cmds.button(l = '\nCreate Dummy Skeleton\n', c = self.build) # also have it make char name field grey
		cmds.columnLayout()
		cmds.setParent('..')
		cmds.setParent('..')
		cmds.setParent('..')
		tab2 = cmds.rowColumnLayout('Skeleton')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Skeleton Setup')
		cmds.text('testA')
		cmds.columnLayout()
		cmds.setParent('..')
		cmds.setParent('..')
		cmds.setParent('..')
		tab3 = cmds.rowColumnLayout('Legs')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Leg Rig Setup')
		cmds.setParent('..')
		cmds.setParent('..')
		tab4 = cmds.rowColumnLayout('Arms')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Arm Rig Setup')
		cmds.setParent('..')
		cmds.setParent('..')
		tab5 = cmds.rowColumnLayout('Spine and Head')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Spine Rig Setup')
		cmds.setParent('..')
		cmds.setParent('..')
		tab6 = cmds.rowColumnLayout('Stretchy IK')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Stretchy Setup')
		cmds.setParent('..')
		cmds.setParent('..')
		tab6 = cmds.rowColumnLayout('Extras')
		cmds.columnLayout(columnAttach = ('both', 5), rowSpacing = 10, columnWidth = 150)
		cmds.setParent('..')
		cmds.frameLayout(l = 'Extras')
		cmds.setParent('..')
		cmds.setParent('..')
		cmds.showWindow(rigUI)
		
		def crSkelButton():
			cmds.textFieldGrp (label="Global Scale:", ann="Scale of Character is basis or multiplier for all further controllers", tx = d.gScale, w = 1, ed = False, en = False, edit = True)
__________________
vimeo
blog
 
Old 06 June 2011   #14
I have a horrible habit of diving in the deep end of the pool...

Served me well so far!

Thanks so much for your help, I made one single mistake which was botching the whole thing, I had arguments in build instead of self, *args ... which was causing it.

I have a deadline for this so will try to pump it out, then take a step back and see where I need to improve.

Last edited by JaredTaylor : 06 June 2011 at 07:11 AM.
 
Old 06 June 2011   #15
I think there's an issue, I can no longer store the variables to be used in another function of another class like you can when they are called during __init__ ; or am I just being dumb?

In my other module, I would simply refer to it as dum.locators , right?
 
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 09:03 PM.


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