11# --------------------------------
2- # Bake All Anim v1.0.0 Release
2+ # UV Randomizer v1.0.0 Release
33# --------------------------------
44
55# Destroys instances of the dialog before recreating it
@@ -82,7 +82,7 @@ def __init__(self, ui_file, pymxs, parent=MaxPlus.GetQMaxMainWindow()):
8282
8383 # Titling
8484
85- self ._window_title = 'UV Randomizer DEV BUILD '
85+ self ._window_title = 'UV Randomizer v1.0.0 '
8686 self .setWindowTitle (self ._window_title )
8787
8888 # ---------------------------------------------------
@@ -143,7 +143,8 @@ def __init__(self, ui_file, pymxs, parent=MaxPlus.GetQMaxMainWindow()):
143143 '%s The current modifier MUST be an Unwrap UVW with some elements selected!' % self ._wrn ,
144144 '%s Holding UV Selection...' % self ._grn ,
145145 '%s Randomizing UVs...' % self ._grn ,
146- '%s See Max Listener for details' % self ._err ]
146+ '%s See Max Listener for details' % self ._err ,
147+ '%s The object has changed since Holding UV Selection!' % self ._wrn ]
147148 # Set initial status label
148149 self ._lbl_status .setText (self ._status [0 ])
149150
@@ -155,7 +156,6 @@ def __init__(self, ui_file, pymxs, parent=MaxPlus.GetQMaxMainWindow()):
155156 # ---------------------------------------------------
156157
157158 def _get_settings (self ):
158- print '_get_settings()'
159159
160160 self ._settings ['translate' ] = self ._chk_t .isChecked ()
161161 self ._settings ['rotate' ] = self ._chk_r .isChecked ()
@@ -261,11 +261,15 @@ def randomize(self):
261261 rt = self ._rt
262262
263263 try :
264- # Check that the current modifier is an Unwrap_UVW
264+ # Validate the current modifier, element list, and object.
265265 # We use rt.classOf() to get the actual MaxScript class
266266 uv = rt .modPanel .getCurrentObject ()
267267 if rt .classOf (uv ) != rt .Unwrap_UVW :
268268 self ._lbl_status .setText (self ._status [2 ])
269+ elif len (self ._elements ) == 0 :
270+ self ._lbl_status .setText (self ._status [2 ])
271+ elif rt .getCurrentSelection ()[0 ] != self ._object :
272+ self ._lbl_status .setText (self ._status [6 ])
269273 else :
270274 self ._lbl_status .setText (self ._status [4 ])
271275
@@ -294,7 +298,6 @@ def randomize(self):
294298 tv = tv - (tv % t_range [2 ])
295299 t_uvw = rt .Point3 (tu , tv , 0 )
296300 uv .moveSelected (t_uvw )
297- print 'Translate %s' % t_uvw
298301
299302 if self ._settings ['rotate' ]:
300303 # Shorthand var
@@ -307,7 +310,6 @@ def randomize(self):
307310 # rotateSelectedCenter expects radians
308311 angle = radians (angle )
309312 uv .rotateSelectedCenter (angle )
310- print 'Rotate %sdeg' % angle
311313
312314 if self ._settings ['scale' ]:
313315 # Shorthand var
@@ -320,7 +322,8 @@ def randomize(self):
320322 # scaleSelectedCenter 0-1 == 0-100 percent, so scale these values accordingly
321323 scale = scale / 100
322324 uv .scaleSelectedCenter (scale , 0 )
323- print 'Scale %s' % scale
325+
326+ self ._lbl_status .setText (self ._status [1 ])
324327
325328
326329 except Exception as e :
@@ -341,4 +344,4 @@ def randomize(self):
341344ui .show ()
342345
343346# DEBUG
344- print "\r Test Version 35 "
347+ # print "\rTest Version 39 "
0 commit comments