xchrisx

02-08-2013, 10:02 AM

I am starting to make the transition over to python however I find the docs confusing at best regarding certain commands. For example I want to query renderOpts however the python implementation doesn't seem to be working in which the same way Lscript does. I understand not a lot of highlevel access has been implemented yet, but I don't see how the current information can related to the values it should. For example:

@warnings

@version 2.7

@script generic

generic

{

info(Scene().renderopts[12]);

}

In the above code, my scene returns 0 since my SaveRGB is unchecked. However I now run the closest equivalent command in Python :

import lwsdk

lwsdk.LWSceneInfo().renderOpts

And now I receive a long integer, 270286855. So I see that the data is now stored into an integer rather than to an array. This is frustrating because I have no idea what to do with this number. If I check the SaveRGB and rerun the same command my value is 270288903 which I don't see how it relates to the first value. My main question is in this case, using this integer how do I extract the appropriate data out of it? I also dont know if I am even invoking the command properly, as I also tried to use the get property in various ways to no avail.

Any insights would be greatly appreciated.

-Chris

Information from PCore about this command:

renderOpts

LWSceneInfo_renderOpts_get(LWSceneInfo self) -> int

the C sdk describes renderOpts as follows:

#define LWROPT_SHADOWTRACE (1<<0)

#define LWROPT_REFLECTTRACE (1<<1)

#define LWROPT_REFRACTTRACE (1<<2)

#define LWROPT_FIELDS (1<<3)

#define LWROPT_EVENFIELDS (1<<4)

#define LWROPT_MOTIONBLUR (1<<5)

#define LWROPT_DEPTHOFFIELD (1<<6)

#define LWROPT_LIMITEDREGION (1<<7)

#define LWROPT_PARTICLEBLUR (1<<8)

#define LWROPT_ENHANCEDAA (1<<9)

#define LWROPT_SAVEANIM (1<<10)

#define LWROPT_SAVERGB (1<<11)

#define LWROPT_SAVEALPHA (1<<12)

#define LWROPT_ZBUFFERAA (1<<13) /* added 12/29/2004 */

#define LWROPT_RTTRANSPARENCIES (1<<14) /* added 11/01/2006 */

#define LWROPT_RADIOSITY (1<<15)

#define LWROPT_CAUSTICS (1<<16)

#define LWROPT_OCCLUSION (1<<17)

#define LWROPT_RENDERLINES (1<<18)

#define LWROPT_INTERPOLATED (1<<19)

#define LWROPT_BLURBACKGROUND (1<<20)

#define LWROPT_USETRANSPARENCY (1<<21)

#define LWROPT_VOLUMETRICRADIOSITY (1<<22)

#define LWROPT_USEAMBIENT (1<<23)

#define LWROPT_DIRECTIONALRAYS (1<<24)

#define LWROPT_LIMITDYNAMICRANGE (1<<25)

#define LWROPT_CACHERADIOSITY (1<<26)

#define LWROPT_USEGRADIENTS (1<<27)

#define LWROPT_USEBEHINDTEST (1<<28)

#define LWROPT_CAUSTICSCACHE (1<<29)

#define LWROPT_RENDERINSTANCES (1<<30)

#define LWROPT_UNPREMULTIPLIEDALPHA (1<<31)

@warnings

@version 2.7

@script generic

generic

{

info(Scene().renderopts[12]);

}

In the above code, my scene returns 0 since my SaveRGB is unchecked. However I now run the closest equivalent command in Python :

import lwsdk

lwsdk.LWSceneInfo().renderOpts

And now I receive a long integer, 270286855. So I see that the data is now stored into an integer rather than to an array. This is frustrating because I have no idea what to do with this number. If I check the SaveRGB and rerun the same command my value is 270288903 which I don't see how it relates to the first value. My main question is in this case, using this integer how do I extract the appropriate data out of it? I also dont know if I am even invoking the command properly, as I also tried to use the get property in various ways to no avail.

Any insights would be greatly appreciated.

-Chris

Information from PCore about this command:

renderOpts

LWSceneInfo_renderOpts_get(LWSceneInfo self) -> int

the C sdk describes renderOpts as follows:

#define LWROPT_SHADOWTRACE (1<<0)

#define LWROPT_REFLECTTRACE (1<<1)

#define LWROPT_REFRACTTRACE (1<<2)

#define LWROPT_FIELDS (1<<3)

#define LWROPT_EVENFIELDS (1<<4)

#define LWROPT_MOTIONBLUR (1<<5)

#define LWROPT_DEPTHOFFIELD (1<<6)

#define LWROPT_LIMITEDREGION (1<<7)

#define LWROPT_PARTICLEBLUR (1<<8)

#define LWROPT_ENHANCEDAA (1<<9)

#define LWROPT_SAVEANIM (1<<10)

#define LWROPT_SAVERGB (1<<11)

#define LWROPT_SAVEALPHA (1<<12)

#define LWROPT_ZBUFFERAA (1<<13) /* added 12/29/2004 */

#define LWROPT_RTTRANSPARENCIES (1<<14) /* added 11/01/2006 */

#define LWROPT_RADIOSITY (1<<15)

#define LWROPT_CAUSTICS (1<<16)

#define LWROPT_OCCLUSION (1<<17)

#define LWROPT_RENDERLINES (1<<18)

#define LWROPT_INTERPOLATED (1<<19)

#define LWROPT_BLURBACKGROUND (1<<20)

#define LWROPT_USETRANSPARENCY (1<<21)

#define LWROPT_VOLUMETRICRADIOSITY (1<<22)

#define LWROPT_USEAMBIENT (1<<23)

#define LWROPT_DIRECTIONALRAYS (1<<24)

#define LWROPT_LIMITDYNAMICRANGE (1<<25)

#define LWROPT_CACHERADIOSITY (1<<26)

#define LWROPT_USEGRADIENTS (1<<27)

#define LWROPT_USEBEHINDTEST (1<<28)

#define LWROPT_CAUSTICSCACHE (1<<29)

#define LWROPT_RENDERINSTANCES (1<<30)

#define LWROPT_UNPREMULTIPLIEDALPHA (1<<31)