Forum: Poser Python Scripting


Subject: how do i turn shadow rendering on from poserpython?

dennisharoldsen opened this issue on May 27, 2007 · 9 posts


dennisharoldsen posted Sun, 27 May 2007 at 7:12 PM

thanks to those who have helped me in the past.

i tried this:
scene.SetRenderCastShadows(1)

and this:
scene.SetGroundShadows(1)

what else is there?


nruddock posted Sun, 27 May 2007 at 8:08 PM

Quote - scene.SetGroundShadows(1)

This is for turning on or off the basic preview shadows.

Quote - scene.SetRenderCastShadows(1)

This is a global render setting, and you do need it, but it's not the whole story (see below). > Quote - what else is there ?

actor.SetCastsShadows(1) is required for an actor to cast shadows and
*light.*SetShadow(1) is required for a light to cast shadows.


dennisharoldsen posted Sun, 27 May 2007 at 8:14 PM

thank you


dennisharoldsen posted Sun, 27 May 2007 at 9:23 PM

i tried this:

scene = poser.Scene()
scene.SetRenderCastShadows(1)
aLights= scene.Lights()
for light in aLights:
  light.SetShadow(1)
actor = scene.CurrentActor()
actor.SetCastsShadows(1)

no shadows.
how can this be so hard?


svdl posted Sun, 27 May 2007 at 10:48 PM

Shadows must be cast onto something. If you only have one single actor in the scene, there's nothing that its shadow can be cast on.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


nruddock posted Mon, 28 May 2007 at 3:03 AM

Most (if not all) items will load set to cast shadows, so unless you've turned them off, it sounds like there's another problem with your scene.
You'll need to post more details (with screenshots) to assist with diagnosing the problem.


dennisharoldsen posted Mon, 28 May 2007 at 5:29 PM

back again. thanks for the input.

my projects are very simple. 1 standard figure or prop & shadow rendering off.
then i have a script that renders several rotations & exports the rendered images.
my purpose is to make more clipart for my grandsons to use in an image collage program.
i wanted to have a version of each file with and without shadows.

today i investigated turning shadows off.
that works by just setting the lights to not render shadows.
in the future i will not set shadows off when i save projects.
for now, i would need to manually correct and save each poser project.
if nothing else i will do that.

i think that scene.SetRenderCastShadows() should work according to the documentation.
it starts as 1 no matter what the render setting and when i change it, it has no effect.

i also found Shadows() & SetShadows(). No idea what object uses this property.
i tried scene, figure, and actor and got syntax error.

i checked out scene.RenderAntiAliased() as a comparison;
it seems to have a value inherent in the character and it can be changed with a result.

i am using poser7. it seems to have a few rough edges. a real object model would be nice.

thanks


nruddock posted Mon, 28 May 2007 at 7:01 PM

You may need to do this to make sure the FireFly options are in sync :-

ffopts = scene.CurrentFireFlyOptions()<br></br>ffopts.SetShadows(1)

dennisharoldsen posted Mon, 28 May 2007 at 8:39 PM

it works. thank you.

i did a basic script first. it changed the render options interface.
i put the code then into my autorender script and it works great.

after my last post, i realized that i had not tried the poser4 render machine.
it works with the code we had explored.

you (nruddock) have specifically answered two major questions that were stopping me.
in the process, i have also learned more about the syntax.
i don't know how you know this stuff but you seem to have a handle on it.

thanks again.