POV-Ray : Newsgroups : povray.programming : Who to start PovRay from another program and render a scenery... : Re: How to start PovRay from another program and render a scenery... Server Time
26 Apr 2024 06:29:36 EDT (-0400)
  Re: How to start PovRay from another program and render a scenery...  
From: m steiger
Date: 3 Jan 2011 07:51:18
Message: <4d21c646$1@news.povray.org>
How to start PovRay from a 3d-application coded with Pascal (Delphi)

1. set appropriate PovRay preferences
-------------------------------------
- Menu: Editor / Auto-Reload / * Always
- Menu: Options / * Keep single instance
- add '+FN' to command line option field to save PNG pictures

2. export a 3d-scenery as PovRay file
-------------------------------------
- build filename: povfilename = <name> + '.pov'
- save scenery as ASCII file named 'povfilename'

3. get PovRay execution path from registry
------------------------------------------
- get execution command from registry
   povStartCommand := GetRegistryString (HKEY_CLASSES_ROOT
        , '\Applications\pvengine.exe\shell\open\Command', '');
- from povStartCommand cut away the text after 'pvengine.exe'

4. start PovRay with saved PovRay file
--------------------------------------
- set execution parameter to:
   param := ' /EDIT ' + povfilename + ' /RENDER ' + povfilename;
- start povray without waiting for ending
   errorCode := ShellExecute (Application.Handle, 'open'
      ,PChar(povStartCommand), PChar(param), nil, SW_SHOWNORMAL);

5. handling PovRay after execution
----------------------------------
- if you want to restart rendering press 'Stop' at PovRay
   and continue with point 2
- to change resolution press 'Stop' change it and press 'Run'
- if rendering ends you can restart rendering
   during PovRay is still running


Post a reply to this message

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