我有这部法典,以建立一个接口和一些纽扣州(在市长中排出)
class mrShadowMapChangerUI:
def __init__(self):
smAttrs = [ shadowMap , smapResolution , smapSamples , smapSoftness , smapBias ]
smNiceAttrs = [ Active , Resolution , Samples , Softness , Bias ]
attrs = zip(smAttrs,smNiceAttrs)
self.form = mc.columnLayout()
self.smapResolutionField = mc.textFieldButtonGrp( label=attrs[1][1], text=int(defaultLightValues[1]), bc=Callback(self.setSmValue, attrs[1][0]))
self.smapSamplesField = mc.textFieldButtonGrp( label=attrs[2][1], text=int(defaultLightValues[2]), bc=Callback(self.setSmValue, attrs[2][0]))
self.smapSoftnessField = mc.textFieldButtonGrp( label=attrs[3][1], text=( %.3f % defaultLightValues[3]), bc=Callback(self.setSmValue, attrs[3][0]))
self.smapBiasField = mc.textFieldButtonGrp( label=attrs[4][1], text=( %.3f % defaultLightValues[4]), bc=Callback(self.setSmValue, attrs[4][0]))
并且我要谈谈这样一些事情,以自动地创建纽特州,知道他们的名字(因此,我可以稍后地向他们提问)。
class mrShadowMapChangerUI:
def __init__(self):
smAttrs = [ shadowMap , smapResolution , smapSamples , smapSoftness , smapBias ]
smNiceAttrs = [ Active , Resolution , Samples , Softness , Bias ]
attrs = zip(smAttrs,smNiceAttrs)
self.form = mc.columnLayout()
for attr in attrs:
self.( %s % attr[0]) = mc.textFieldButtonGrp( label=attr[1], text=int(defaultLightValues[1]), bc=Callback(self.setSmValue, attr[0]))
mc.showWindow(self.window)
我确实在理解所有这些“自食其力”的工作方面遇到麻烦,因此,我大概没有基本的东西,但我迄今所尝试的所有东西都没有奏效。
感谢!