POV-Ray : Newsgroups : povray.programming : POV pipes : Re: POV pipes Server Time
28 Jul 2024 10:15:54 EDT (-0400)
  Re: POV pipes  
From: Ken Cecka
Date: 8 Apr 2002 20:40:36
Message: <3cb23884@news.povray.org>
> With the command below I can only get the credits as though I do a mere
> "x-povray". I don't get any picture.

Is the lack of a picture the only problem?  It may be that the shell in 
which the x-povray command is getting spawned doesn't have a DISPLAY 
variable set.  If you're not familiar with the DISPLAY variable, try 
opening a terminal window, enter the command 'unset DISPLAY' at the prompt, 
then try running x-povray.  You will no longer get a picture window when 
x-povray runs.  For any X application do open a window, it needs to know 
where to display the window - this is usually done by reading the DISPLAY 
environment variable.  Typically, its value is ':0.0' which causes the 
window to be displayed on the machine where x-povray is running on xserver 
zero screen zero.  I don't know enough about python to know how the 
environment gets passed to your popen command, but a quick hack would be to 
change

cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"

to

cmd= "/bin/sh -c '{ DISPLAY=:0.0; x-povray +i/mnt/win_c/image/pov/7.pov 
+w320 +h240 -f +dgt; }'"

A better solution would be to read the current value of the DISPLAY 
environment variable (not sure how to read environment variables in python) 
and pass that along instead.  There also might be a command-line flag to 
directly tell x-povray which display to use.

Ken


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.