Adverti horiz upsell

Checker Size Tool 1.2.0 for Maya (maya script)

Makes the checker size same among different objects

License
Button download
6,594 Downloads

Compatibility

  • 2013, 2012, 2011

Operating Systems

  • Windows

History

Created:06/02/2010
Last Modified:12/16/2016
File Size: 12.5 KB

Bugs

Maya 2016 reporting an error that prevents storing a checker size

Statuspending
Prioritymedium
Date03/18/2017
Submitted byZoey222 Zoey222

User clicks "Pick Checker Size" button.

gets:

# Error: NameError: file <maya console> line 1: name 'get_sel_faces_UV_ratio' is not defined #

 

Ive selected objects, faces, uvs, shells, everything. Nothing works!

What do? Thank you!

Comments on this bug:

  • sogm8vet

    sogm8vet said over 7 years ago:

    Here's how you can fix it. You'll have to rewrite some of the code. I'd recommend using either Notepad ++ or Sublime Text 3 (both are free) to make the changes.
     
    At the top insert this line of code under the "import math" module:
    1
    
    from functools import partial

    Then add "*args" in each of the following function's arguments (in between the parentheses) like this (don't forget about the comma!):

    1
    
    def get_sel_faces_UV_ratio(set_active, *args):

     

    1
    
    def set_UV_ratio(obj, *args):

     

    1
    
    def set_shell_button(*args):

     Then replace the entire "show_window" function with this code:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    
    def show_window():
    	global progressControl
    	global current_obj
    	global radio_col
    	UV_window = cmds.window(title="Maya Checker Size Tool", iconName='Short Name', rtf = 1, s=1, widthHeight=(300, 100), mxb = 0 )
     
    	if cmds.window(UV_window, ex = True ):
    		cmds.deleteUI( UV_window,window=True)
    	UV_window = cmds.window( title="Maya Checker Size Tool", iconName='Short Name', rtf = 1, s=1, widthHeight=(300, 100), mxb = 0 )
    	cmds.columnLayout( adjustableColumn=True )
    	cmds.frameLayout(label ="Get Size", w = 30 , h = 80 , mh = 5, mw = 5, bs = "etchedOut" )
    	cmds.columnLayout( adjustableColumn=True )
    	UV_get_but = cmds.button( label='Pick Checker Size',en=True, annotation='Store the checker size', 
    		command = partial(get_sel_faces_UV_ratio, 1) )
    	current_obj= cmds.text(w = 175 , l = '' , al =  'center')
    	cmds.setParent( '..' )
    	cmds.setParent( '..' )
    	cmds.frameLayout(label ="Set Size",  w = 30 , h = 110 , mh = 5, mw = 5, bs = "etchedOut" )
    	cmds.columnLayout( adjustableColumn=True )
    	UV_set_but = cmds.button( label='Set Checker Size of object(s)',en=True,annotation='Change checker size of one or more meshes', 
    		command=partial(set_UV_ratio, 1))
    	UV_shell_but = cmds.button( label='Set Checker Size of shells (Single object)', en = True,annotation='Change checker size of object with several shells', 
    		command=partial(set_shell_button))
    	cmds.rowLayout( numberOfColumns=2, columnWidth2=(100, 100))
    	radio_col=cmds.radioCollection()
    	cmds.radioButton('radio_Face', label = 'Face shells',  al =  'left')
    	cmds.radioButton('radio_UV', label = 'UV shells',al =  'left')
    	cmds.setParent( '..' )
    	cmds.setParent( '..' )
    	cmds.setParent( '..' )
    	cmds.columnLayout( adjustableColumn=True )
    	progressControl = cmds.progressBar(maxValue=20, width=300)
    	cmds.progressBar(progressControl, edit=True, visible=False)
    	cmds.text(w = 175 , l = 'varunbondwal@yahoo.com  ' , al =  'right')
    	cmds.setParent( '..' )
    	cmds.setParent( '..' )
     
    	cmds.showWindow( UV_window ) 

     Hope that makes sense. Let me know if that fixes your problem.

Post a comment: