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 arvid schneiders mtoa 517 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 video link :
It seems to work for him but not me i copied the script letter to letter and rechecked multiple times but i keep getting the same error.
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!!!.
If you become a patron and support Arvid, you get access to the source files.
So you don't have to type it all out (you've got a number of syntax errors in there as well)
Um can you correct them out please it would be a great help to me i cant pay 59 dollars or 5000 rs every month. I cant contribute more than 100 rs.
the aovkeys list's last object can not have a comma at the end. in fact in python the last object in a list can't have a comma in the end.
see if this help, if your class indeed only have two function, and the last two is outside of the class, and this should be it.