Sorath
03-08-2011, 07:27 PM
I'm trying to call inside a standalone mel script for submitting to the farm a python script..
and messing around for hours now.. wtf is wrong with this???
import sys sys.path.append('L:/_deadline/submission/Maya')
import checkGamma
checkGamma.gamma()
# Error: AttributeError: 'module' object has no attribute 'gamma' #
like that what I try from within mel
python("import checkGamma"); python("checkGamma.gamma()");
and the python code I am calling inside mel is this:
import maya.cmds as mc
def global gamma():
cams = mc.listCameras (p=True)
for i in cams:
isRenderable = mc.getAttr (i + '.renderable')
if isRenderable == True:
lensShader = mc.listConnections (i + '.miLensShader')
gamma = mc.getAttr (lensShader[0] + '.gamma')
if not gamma == 1:
request = mc.confirmDialog (title='note', message='gamma is set to 2.2 change to 1.0', button= ['yes', 'no'], defaultButton='yes', cancelButton='no', dismissString='no')
if request == 'yes':
mc.setAttr (lensShader[0] + '.gamma', 1)
print 'gamma was set to 1'
else:
print 'your lensShader is set to Gamma %s' %gamma
continue
else:
print 'your lensShader is set to Gamma %s' %gamma
continue
very thankfull for input!~
and messing around for hours now.. wtf is wrong with this???
import sys sys.path.append('L:/_deadline/submission/Maya')
import checkGamma
checkGamma.gamma()
# Error: AttributeError: 'module' object has no attribute 'gamma' #
like that what I try from within mel
python("import checkGamma"); python("checkGamma.gamma()");
and the python code I am calling inside mel is this:
import maya.cmds as mc
def global gamma():
cams = mc.listCameras (p=True)
for i in cams:
isRenderable = mc.getAttr (i + '.renderable')
if isRenderable == True:
lensShader = mc.listConnections (i + '.miLensShader')
gamma = mc.getAttr (lensShader[0] + '.gamma')
if not gamma == 1:
request = mc.confirmDialog (title='note', message='gamma is set to 2.2 change to 1.0', button= ['yes', 'no'], defaultButton='yes', cancelButton='no', dismissString='no')
if request == 'yes':
mc.setAttr (lensShader[0] + '.gamma', 1)
print 'gamma was set to 1'
else:
print 'your lensShader is set to Gamma %s' %gamma
continue
else:
print 'your lensShader is set to Gamma %s' %gamma
continue
very thankfull for input!~
