POV-Ray : Newsgroups : povray.pov4.discussion.general : On new directive to stop after parsing. A near term trick. : On new directive to stop after parsing. A near term trick. Server Time
9 May 2024 06:46:07 EDT (-0400)
  On new directive to stop after parsing. A near term trick.  
From: William F Pokorny
Date: 14 Mar 2024 19:22:18
Message: <65f386aa$1@news.povray.org>
I often stop POV-Ray after parsing by adding an #error directive:

#error "Stopping after parse"

at the very bottom of some scene description language (SDL) code.

It works but, with the disadvantage of setting a non-zero return code; 
something which makes testing the parser harder.

I've a few times talked about adding a new (SDL) directive like '#exit 
<rc value>', perhaps.

Well, while continuing to work through the ini options and command line 
flags, I stumbled across the following trick. We can effectively run 
just the command line, ini file and scene file parsing with the command:

   povray scene.pov -d -p +wt0

Setting the thread count to zero causes POV-Ray to bail before rendering 
with a clean, 0 return code - so long as nothing is otherwise wrong with 
the scene set up.

It means I've got a better way to run parsing test cases and, should 
anyone want to do it, you can use SDL as a sort of scripting language to 
do other stuff.

The trick works too in v3.8 beta 2 and likely all recent, official 
versions.

Bill P.


Post a reply to this message

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