Hi guys,
Need a little help here. I’m trying to bake light info through scripting and I am having trouble with the ‘bakeAlpha’ attribute - I need to have it on.
This is a prototype code to reproduce the issue:
import pymel.core as pm
import maya.mel as mel
# create dummy cube
pm.polyCube()
# create bake set
x = "bakeSet"
if not pm.objExists(x):
x = mel.eval('createBakeSet '+ x +' textureBakeSet;')
y = pm.PyNode(x)
y.setAttr('colorMode', 0)
y.setAttr('bakeAlpha', 1)
y.setAttr('alphaMode', 0)
# bake
pm.convertLightmapSetup(camera="persp", bo=y.name(), showcpv=True)
The error I get when I run this is: # Error: RuntimeError: Maya command error #
If I change the ‘bakeAlpha’ to 0, the script works - with no alpha though. Any idea?
Thanks!