|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am writing an editor for POV that can fire up raytraces.
It is written with Tkinter (a GUI for Python).
I have been stuck for a week with a problem and can't get over it.
I asked a python newsgroup, but they were not able to help me.
I think the problem comes from the way POV outputs both the rendered
line to the console and the raytraced image.
After the raytrace, there is still another output about the stats.
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 there someone out there who can tell me how POV pipes its streams?
(pipe in, pipe out, pipe err,....)
Thanks
Here is the code
cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"
pin,pout,perr=popen2.popen3(cmd) # three pipes are generated
# from this command
pipe_out=pout.readlines() # this is the output
self.text.insert('end',pipe_out) # redirect the output to the Tkinter #
application
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Fabien HENON wrote:
> I am writing an editor for POV that can fire up raytraces.
>
> It is written with Tkinter (a GUI for Python).
> I have been stuck for a week with a problem and can't get over it.
> I asked a python newsgroup, but they were not able to help me.
> I think the problem comes from the way POV outputs both the rendered
> line to the console and the raytraced image.
> After the raytrace, there is still another output about the stats.
>
>
> 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 there someone out there who can tell me how POV pipes its streams?
> (pipe in, pipe out, pipe err,....)
>
> Thanks
> Here is the code
>
>
> cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"
>
> pin,pout,perr=popen2.popen3(cmd) # three pipes are generated
> # from this command
>
> pipe_out=pout.readlines() # this is the output
>
>
> self.text.insert('end',pipe_out) # redirect the output to the
> Tkinter # application
>
I forgot to say : I use Linux ( with pipes that was nearly obvious)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 09 Apr 2002 07:02:26 +0930, Fabien HENON wrote:
> I am writing an editor for POV that can fire up raytraces.
>
> It is written with Tkinter (a GUI for Python). I have been stuck for a
> week with a problem and can't get over it. I asked a python newsgroup,
> but they were not able to help me. I think the problem comes from the
> way POV outputs both the rendered line to the console and the raytraced
> image. After the raytrace, there is still another output about the
> stats.
>
>
> 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 there someone out there who can tell me how POV pipes its streams?
> (pipe in, pipe out, pipe err,....)
>
> Thanks
> Here is the code
>
>
> cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"
>
> pin,pout,perr=popen2.popen3(cmd) # three pipes are generated
> # from this command
>
> pipe_out=pout.readlines() # this is the output
>
>
> self.text.insert('end',pipe_out) # redirect the output to the Tkinter
> # application
Maybe not entirely what you want but quite some time ago, just as an
experiment, I created a named pipe for each of POV's streams and catted
each of them in a seperate xterm, then ran POV with each stream
redirected to the appropriate pipe, and it worked fine.
One xterm had warnings, one had #DEBUG etc.
--
PoD.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yes, I'd like to have a look at your script. It may help.
I might redirect all the streams into what I want.
Thanks
I look forward to hear from you.
Fabien
> On Tue, 09 Apr 2002 07:02:26 +0930, Fabien HENON wrote:
>
> > I am writing an editor for POV that can fire up raytraces.
> >
> > It is written with Tkinter (a GUI for Python). I have been stuck for a
> > week with a problem and can't get over it. I asked a python newsgroup,
> > but they were not able to help me. I think the problem comes from the
> > way POV outputs both the rendered line to the console and the raytraced
> > image. After the raytrace, there is still another output about the
> > stats.
> >
> >
> > 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 there someone out there who can tell me how POV pipes its streams?
> > (pipe in, pipe out, pipe err,....)
> >
> > Thanks
> > Here is the code
> >
> >
> > cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"
> >
> > pin,pout,perr=popen2.popen3(cmd) # three pipes are generated
> > # from this command
> >
> > pipe_out=pout.readlines() # this is the output
> >
> >
> > self.text.insert('end',pipe_out) # redirect the output to the Tkinter
> > # application
>
> Maybe not entirely what you want but quite some time ago, just as an
> experiment, I created a named pipe for each of POV's streams and catted
> each of them in a seperate xterm, then ran POV with each stream
> redirected to the appropriate pipe, and it worked fine.
> One xterm had warnings, one had #DEBUG etc.
>
> --
> PoD.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yes, I'd like to have a look at your script. It may help.
I might redirect all the streams into what I want.
Thanks
I look forward to hear from you.
Fabien
> On Tue, 09 Apr 2002 07:02:26 +0930, Fabien HENON wrote:
>
> > I am writing an editor for POV that can fire up raytraces.
> >
> > It is written with Tkinter (a GUI for Python). I have been stuck for a
> > week with a problem and can't get over it. I asked a python newsgroup,
> > but they were not able to help me. I think the problem comes from the
> > way POV outputs both the rendered line to the console and the raytraced
> > image. After the raytrace, there is still another output about the
> > stats.
> >
> >
> > 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 there someone out there who can tell me how POV pipes its streams?
> > (pipe in, pipe out, pipe err,....)
> >
> > Thanks
> > Here is the code
> >
> >
> > cmd= "/bin/sh x-povray +i/mnt/win_c/image/pov/7.pov +w320 +h240 -f +dgt"
> >
> > pin,pout,perr=popen2.popen3(cmd) # three pipes are generated
> > # from this command
> >
> > pipe_out=pout.readlines() # this is the output
> >
> >
> > self.text.insert('end',pipe_out) # redirect the output to the Tkinter
> > # application
>
> Maybe not entirely what you want but quite some time ago, just as an
> experiment, I created a named pipe for each of POV's streams and catted
> each of them in a seperate xterm, then ran POV with each stream
> redirected to the appropriate pipe, and it worked fine.
> One xterm had warnings, one had #DEBUG etc.
>
> --
> PoD.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Actually the problem not merely the lack of picture.
I never managed to get both the stats(eg output to the console) and the
picture.
It was always either the picture or the output to the console.
Anyway I'll give your tip a try.
Thanks
Fabien
> > 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Yes, I'd like to have a look at your script. It may help. I might
> redirect all the streams into what I want.
>
> Thanks
> I look forward to hear from you.
>
> Fabien
>
Well I don't have a script as such, I just did
mkfifo povdebug povfatal povrender povstats povwarning
started 5 xterms
xterm 1: cat povdebug
xterm 2: cat povfatal
etc.
run povray with these options added
+GDpovdebug +GFpovfatal +GRpovrender +GSpovstats +GWpovwarning
You could easily open each fifo in your python script and display the
output of each in a text widget.
Hope this helps.
--
PoD.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|