- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i am getting an unexpected indent error in the script editor when trying to execute this python script.i didnt write this script just copied it from somewhere else cause i dont know how to write code.i want to create lpe for the light groups automatically.I will attach the script down below.
import pymel.core as pmc
import mtoa
interface = mtoa.aovs.AOVInterface()
class Aov(object):
def _init_(self,name,lpe):
self.name = name
self.lpe = lpe
self.lpeGroup = None
def addlightgroup(self,lightgroup):
self.ipegroup = self.lpe.replace('L.', *L.'()'*.format(lightgroup))
aovkeys = [ Aov("diffuse_direct". lpe = "C<RD>L"),
Aov("diffuse_indirect". lpe = "C<RD>[DSVOB].*"),
Aov("specular_direct". lpe = "C<RS[^'coat']>L"),
Aov("specular_indirect". lpe = "C<RS[^'coat']>[DSVOB].*"),
Aov("transmission_direct". lpe = "C<TS>L"),
Aov("transmission_indirect". lpe = "C<TS>[DSVOB].*"),
]
def getlights():
return pmc.ls(type['aiAreaLight', 'aiSkyDomeLight'])
def getlightgroup():
groups = []
for light in getlights():
groups.append(light.aiAov.get())
return groups
for aovKey in aovKeys:
for lightgroup in getlightgroups():
sceneAov = interface.addAOV("{}_{}*.format(lightgroup,aovKey.name))
aiAov = pmc.Pynode(sceneAov.node)
aovkey.addlightgroup(lightgroup)
aiAov.lightPathExpression.set(aovkey.lpeGroup)
also im attaching the the screen shot of the script editor.Please help ASAP!!!.
Solved! Go to Solution.
