[cortex-vfx] r4610 committed - added 'precision' field to UI userdata of NumericParameterUI for contr...

0 views
Skip to first unread message

corte...@googlecode.com

unread,
Feb 29, 2012, 12:01:45 PM2/29/12
to cortex...@googlegroups.com
Revision: 4610
Author: david.im...@gmail.com
Date: Wed Feb 29 09:00:31 2012
Log: added 'precision' field to UI userdata of NumericParameterUI for
controlling the number of decimal places visible to the user
http://code.google.com/p/cortex-vfx/source/detail?r=4610

Modified:
/trunk/python/IECoreMaya/NumericParameterUI.py

=======================================
--- /trunk/python/IECoreMaya/NumericParameterUI.py Wed Apr 14 11:46:24 2010
+++ /trunk/python/IECoreMaya/NumericParameterUI.py Wed Feb 29 09:00:31 2012
@@ -81,6 +81,14 @@
if self.parameter.isInstanceOf( IECore.TypeId.DoubleParameter ) :

kw['precision'] = 12
+
+ if parameter.userData().has_key( 'UI' ) :
+
+ if self.parameter.isInstanceOf( IECore.TypeId.DoubleParameter ) or
self.parameter.isInstanceOf( IECore.TypeId.FloatParameter ):
+ precision = parameter.userData()['UI'].get( "precision", None )
+
+ if isinstance( precision, IECore.IntData ):
+ kw['precision'] = precision.value

self.__field = self.__fieldType()(
value = parameter.getNumericValue(),

Reply all
Reply to author
Forward
0 new messages