<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>Greetings All,<br><br>I have what appears to be an import phenomena that I can't seem to make work,<br>and was hoping someone here can help solve and explain...<br><br>The snippet below is output from Maya2011 as what's called a "precomp" script,<br>but it is from top to bottom a Python script. It is output from Maya, and intended to<br>be input into an image compositing program such as Nuke, and/or Maya's new Composite<br>program. The details of the data aren't important, but essentially it deals with how<br>image sequences should be handled,etc.<br><br>The snippet below is just a sample of the actual script. It basically contains a<br>a couple of Class definitions, and each Class has it's own set of dedicated functions,<br>most of them to return certain information about the database.<br>Below the class and function definitions are
actual data, that is laid out in such a way<br>(it seems to me) to be loaded/input into the class and functions...etc...<br><br>I'm actually attempting to use the data/class/functions in this file in a custom PyQt<br>application that performs other operations on the data. I'm parsing this file to get<br>what's called "renderLayer" information. But rather than simply parsing, it occurs to me<br>that I should be able to just import this file as a .py file and run/exec/etc...<br>My problem is,...if I just import it as is, nothing seems to happen so to speak, lol..<br>The data that is defined doesn't appear to have been defined at all, so I can't use the<br>functions,etc. What's missing? How can I import this into python and utilize/access<br>the data? Do I just need a "main"...and/or an "exec_()" ?<br><br>Any and all suggestions and advice is most greatly appreciated,<br>Cheers,<br>-Jim<br><br>#---------- snip
-------------------------------------------------------------------------<br>#!/usr/bin/env python<br># -*- coding: iso-8859-1 -*-<br><br><br>#-------------------------------------------------------------------------------<br>#<br>class RenderLayer:<br><br> def getName(self):<br> return self.name<br><br> def getVersion(self):<br> return self.version<br><br> def getDescription(self):<br> return self.description<br><br> etc,etc<br> .<br> .<br> .<br><br>#-------------------------------------------------------------------------------<br># Render
Layers<br><br>LayerNumberOne____CameraNumOne = RenderLayer()<br>LayerNumberOne____CameraNumOne.name = u"LayerNumberOne"<br>LayerNumberOne____CameraNumOne.anchor = u"LayerNumberOne"<br>LayerNumberOne____CameraNumOne.version = int(1)<br>LayerNumberOne____CameraNumOne.description = u""<br>LayerNumberOne____CameraNumOne.note = u''''''<br>LayerNumberOne____CameraNumOne.compositingOrder = int(5)<br>LayerNumberOne____CameraNumOne.blendMode = RenderLayer.BlendMode.Normal<br>LayerNumberOne____CameraNumOne.renderWidth = int(3000)<br>LayerNumberOne____CameraNumOne.renderHeight = int(1688)<br>LayerNumberOne____CameraNumOne.renderPixelRatio = float(1)<br>LayerNumberOne____CameraNumOne.templateFilePath = u""<br>LayerNumberOne____CameraNumOne.selectedForImport = bool(1)<br>LayerNumberOne____CameraNumOne.renderPasses = [ BeautyPass, DiffusePass, SpecularPass, EtcPass, EtcPass]<br><br>LayerNumberTwo____CameraNumTwo = RenderLayer()<br>etc,etc<br> .<br><br>#
--------- snip ---------------------------------------------------------------------<br><br><br><br></td></tr></table><br>