Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting unexpected indent error when executing python script in script editor.

4 REPLIES 4
Reply
Message 1 of 5
hitecom8172
446 Views, 4 Replies

Getting unexpected indent error when executing python script in script editor.

2599-lpe-script-error.jpg

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 :

https://youtu.be/8Q35eXqkjWM

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!!!.

Tags (1)
Labels (1)
4 REPLIES 4
Message 2 of 5
Stephen.Blair
in reply to: hitecom8172

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)



// Stephen Blair
// Arnold Renderer Support
Message 3 of 5
hitecom8172
in reply to: hitecom8172

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.
Message 4 of 5

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.

Message 5 of 5
hitecom8172
in reply to: hitecom8172

um i did not understand can you explain in detail

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report