POV-Ray : Newsgroups : povray.general : IO restrictions when calling POV-Ray from .Net Server Time
1 Nov 2024 09:20:34 EDT (-0400)
  IO restrictions when calling POV-Ray from .Net (Message 1 to 3 of 3)  
From: Cypherspaceman
Subject: IO restrictions when calling POV-Ray from .Net
Date: 18 Nov 2016 08:45:00
Message: <web.582f04a1eccad996e7ad11040@news.povray.org>
Hi,

I'm creating a text file in POV, which works fine when I run from within the
Windows IDE.

When I try to call from c#, the render happens correctly, but the file is not
written to. The text file is in the same directory as the pov source file. Are
there any differences in IO restrictions when running from the IDE and being
called by an external program (effectively a command line call).




c# code:

System.Diagnostics.Process.Start(@"C:\Program
Files\POV-Ray\v3.7\bin\pvengine.exe", " \"" + @"B:\My
Pictures\POV\source\StructureSensor.pov" + "\" " + "/EXIT");




POV-Ray Code ("StructureSensor.pov")

#version 3.7;
text { ttf "arial.ttf", datetime(now), 0.02, 0.0  pigment{ color rgb<1,1,1> }
translate <-5,0,10>}
#fopen MyFile "depth.txt" write
#write (MyFile,datetime(now))
#fclose MyFile



pvengine.ini

[Permitted Output Paths]
1=%PROFILEDIR%\Insert Menu
2="B:\My Pictures\POV\source"





Running from the IDE, the datetime shown in the image is the same as that shown
in depth.txt.
Running the c# code rerenders the image with the current time, but does not
update the text file.

Any thoughts would be appreciated.

Thanks on advance.


Post a reply to this message

From: Cypherspaceman
Subject: Re: IO restrictions when calling POV-Ray from .Net
Date: 18 Nov 2016 16:40:00
Message: <web.582f746936a5170ce7ad11040@news.povray.org>
Answering my own post:

It seems that the default file path for files written when using the IDE is the
same path as the POV source file.

When calling from .NET, the default file path is the directory containing the
exe.

Just needed to specify a full file path in the #fopen line to fix the issue:
#fopen MyFile "B:\My Pictures\POV\source\depth.txt" write


Post a reply to this message

From: INVALID ADDRESS
Subject: Re: IO restrictions when calling POV-Ray from .Net
Date: 19 Nov 2016 01:42:00
Message: <875160131.501230427.436695.gdsHYPHENentropyAThotmaolDOTcom@news.povray.org>
Cypherspaceman <and### [at] gmailcom> wrote:
> Answering my own post:
> 
> It seems that the default file path for files written when using the IDE is the
> same path as the POV source file.
> 
> When calling from .NET, the default file path is the directory containing the
> exe.
> 
> Just needed to specify a full file path in the #fopen line to fix the issue:
> #fopen MyFile "B:\My Pictures\POV\source\depth.txt" write
> 

Have you ever successfully hooked the render output and shunted it into a
pictureBox or its WPF analogy?

Ian


Post a reply to this message

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