Fix code (if not found should not have been nest into the for loop) + simplify logic

This commit is contained in:
Roy Nieterau 2023-09-06 23:31:33 +02:00
parent e79f1ef4b9
commit c1b305a446

View file

@ -37,13 +37,10 @@ class RenderSettings(object):
def set_render_camera(self, selection):
for sel in selection:
# to avoid Attribute Error from pymxs wrapper
found = False
if rt.classOf(sel) in rt.Camera.classes:
found = True
rt.viewport.setCamera(sel)
break
if not found:
raise RuntimeError("Active Camera not found")
return
raise RuntimeError("Active Camera not found")
def render_output(self, container):
folder = rt.maxFilePath