POV-Ray : Newsgroups : povray.general : A question of Style Server Time
30 Jul 2024 18:19:41 EDT (-0400)
  A question of Style (Message 1 to 9 of 9)  
From: Leroy Whetstone
Subject: A question of Style
Date: 4 Jul 2008 12:57:46
Message: <486E7385.8010309@joplin.com>
I've made several models and other things(macro,functions...) with POV. 
Awhile back I got tired of having a test program for each of these. So 
now I use #ifndef(Get)in all my Pov models and include files to bracket 
a camera and lights and the object and what ever else I need to test the 
file. Before you include the file you have to #declare Get=1;.
  I was wondering do many use this trick?
  And if you do what type do you save the file as?
  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.


Post a reply to this message

From: Chris B
Subject: Re: A question of Style
Date: 4 Jul 2008 13:45:56
Message: <486e61d4@news.povray.org>
"Leroy Whetstone" <lrw### [at] joplincom> wrote in message 
news:486### [at] joplincom...
> I've made several models and other things(macro,functions...) with POV. 
> Awhile back I got tired of having a test program for each of these. So now 
> I use #ifndef(Get)in all my Pov models and include files to bracket a 
> camera and lights and the object and what ever else I need to test the 
> file. Before you include the file you have to #declare Get=1;.
>  I was wondering do many use this trick?

I think quite a lot of people use a fairly wide range of different but 
similar techniques to enable an include file to be rendered directly (for 
testing etc.). There was quite a long discussion a while ago about 
incorporating something into POV-Ray to enable the #include file chain to be 
interrogated when the file is parsed, so that a generic technique could be 
used to implement this. The discussion arose because having to declare 
variables in all of the scene files that use a particular include file is a 
bit of a pain.

I don't recall whether any concensus was ever reached or whether anything 
made it into the development stream. My vote would go for a read-only array 
listing the files in the #include chain. If the array is length 0 you know 
that the user has asked to render the current file and can add a camera, 
lights etc. It would also enable more sophisticated decisions to be made by 
examining the actual contents of the array.

>  And if you do what type do you save the file as?
>  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.

I store anything designed to be able to be included into scene files with an 
extension of '.inc'. Files designed as top-level files (scene files, 
examples, document image generators etc) as '.pov'.

Regards,
Chris B.


Post a reply to this message

From: Charles C
Subject: Re: A question of Style
Date: 4 Jul 2008 18:03:34
Message: <486e9e36@news.povray.org>
Chris B wrote:
> "Leroy Whetstone" <lrw### [at] joplincom> wrote in message 
> news:486### [at] joplincom...
>> I've made several models and other things(macro,functions...) with POV. 
>> Awhile back I got tired of having a test program for each of these. So now 
>> I use #ifndef(Get)in all my Pov models and include files to bracket a 
>> camera and lights and the object and what ever else I need to test the 
>> file. Before you include the file you have to #declare Get=1;.
>>  I was wondering do many use this trick?
> 
> I think quite a lot of people use a fairly wide range of different but 
> similar techniques to enable an include file to be rendered directly (for 
> testing etc.). There was quite a long discussion a while ago about 
> incorporating something into POV-Ray to enable the #include file chain to be 
> interrogated when the file is parsed, so that a generic technique could be 
> used to implement this. The discussion arose because having to declare 
> variables in all of the scene files that use a particular include file is a 
> bit of a pain.
> 
> I don't recall whether any concensus was ever reached or whether anything 
> made it into the development stream. My vote would go for a read-only array 
> listing the files in the #include chain. If the array is length 0 you know 
> that the user has asked to render the current file and can add a camera, 
> lights etc. It would also enable more sophisticated decisions to be made by 
> examining the actual contents of the array.
> 
>>  And if you do what type do you save the file as?
>>  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.
> 
> I store anything designed to be able to be included into scene files with an 
> extension of '.inc'. Files designed as top-level files (scene files, 
> examples, document image generators etc) as '.pov'.
> 
> Regards,
> Chris B. 
> 
> 

The only related change I know about so far is that POV-Ray for Windows 
now supports an 'alternate render file'.  Then again, I've been away for 
a while.  I've still been dreaming of having a main_scene_file keyword, 
but I do like your array (array of strings I hope) even better.   It can 
fill the same purpose, but also provide more information.

Charles


Post a reply to this message

From: John VanSickle
Subject: Re: A question of Style
Date: 4 Jul 2008 18:56:02
Message: <486eaa82@news.povray.org>
Chris B wrote:
> The discussion arose because having to declare 
> variables in all of the scene files that use a particular include file is a 
> bit of a pain.

For some variables in some models, I have an #ifndef-#end block to 
#local declare a default value.  I don't do this with everything because 
   I don't want to fall into the habit of using default values for 
everything.

Regards,
John


Post a reply to this message

From: Chris B
Subject: Re: A question of Style
Date: 4 Jul 2008 19:22:15
Message: <486eb0a7@news.povray.org>
"Charles C" <"nospam a nospam.com"> wrote in message 
news:486e9e36@news.povray.org...
> Chris B wrote:
>> My vote would go for a read-only array listing the files in the #include 
>> chain. If the array is length 0 you know that the user has asked to 
>> render the current file and can add a camera, lights etc. It would also 
>> enable more sophisticated decisions to be made by examining the actual 
>> contents of the array.
>>
> The only related change I know about so far is that POV-Ray for Windows 
> now supports an 'alternate render file'.

I'd missed that. I see it's described in the thread on 3.7 Beta 20b at: 
http://news.povray.org/povray.beta-test/thread/%3C461a2c3e@news.povray.org%3E/?ttop=277440&toff=50
 That certainly would address this particular issue for Windows users.

> I've still been dreaming of having a main_scene_file keyword, but I do 
> like your array (array of strings I hope) even better.

Yes. A read-only array of strings containing the file names was what I was 
thinking/dreaming of. I think this would solve this problem in a tidy little 
cross-platform way.

Regards,
Chris B.


Post a reply to this message

From: Charles C
Subject: Re: A question of Style
Date: 4 Jul 2008 19:48:25
Message: <486eb6c9@news.povray.org>
Chris B wrote:
> I'd missed that. I see it's described in the thread on 3.7 Beta 20b at: 
>
http://news.povray.org/povray.beta-test/thread/%3C461a2c3e@news.povray.org%3E/?ttop=277440&toff=50
>  That certainly would address this particular issue for Windows users.

See also: 
http://news.povray.org/povray.general/message/%3C45601108%241%40news.povray.org%3E/#%3C45601108%241%40news.povray.org%3E


> Yes. A read-only array of strings containing the file names was what I was 
> thinking/dreaming of. I think this would solve this problem in a tidy little 
> cross-platform way.

Sounds perfect to me :)

Charles


Post a reply to this message

From: Charles C
Subject: Re: A question of Style
Date: 4 Jul 2008 20:11:45
Message: <486ebc41@news.povray.org>
Leroy Whetstone wrote:

>  I was wondering do many use this trick?
>  And if you do what type do you save the file as?
>  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.

I name scene files .pov and just about everything else .inc.
I do something like #ifndef(Main_Scene_File)  ... Then check for other 
common variables like colors to be a little bit safe.... Then later in 
the include file, I give it it's own camera and lighting, maybe a floor 
etc all of which are ignored unless Main_Scene_File matches a string 
which happens to be the same as the file name of the include file.   I'm 
really into making object includes self-demonstrating.

For large include files which are themselves only part of something 
bigger and can't easily self-demonstrate, I do something like:
#ifndef(Main_Scene_File) #include "myscene.pov"
#else
...(else parse this file)....
...
...
#end //end "#ifndef(Main_Scene_File)" from beginning of file

Charles


Post a reply to this message

From: Jim Charter
Subject: Re: A question of Style
Date: 5 Jul 2008 12:05:37
Message: <486f9bd1$1@news.povray.org>
No I don't do that.

I keep everything related to a particular project (image | scene) on its 
own directory.  Each directory has separate copies of four 'standard' 
files: scene.ini, scene.pov, lightscamera.inc, and scene_setup.inc which 
contain roughly the same, but evolving, set of tools in the form of 
macros. I keep this discipline religously.  For the most flegling of 
projects I start a new directory and copy in these four files.  I always 
render from the .ini file, (nearly always.)  All includes are called in 
the scene.pov.

If I want a quick test I copy something from insert->scene templates 
menu and save it as 'test.pov' on a subdirectory. If the testfile takes 
on a life of its own I can either include the lightscamera from the main 
scene for better testing, or finally rename and refile it and include it 
in the main scene.

Not sure why this works for me but it seems to and I have kept it up 
with consistancy for years now. It sort of gives me the ability to start 
with the same basic template of elements and take them in slightly 
divergent directions without worrying about the impact on other things. 
  Psychicly and creatively this is very important to me.  As long as I 
maintain this basic working method it seems I am otherwise free of 
remembering the details of some detailed super-standard.

It does set up the arcane situation that work I do on new techniques is 
invariably catalogued under a particular project and I have to remember 
where it is accordingly.  But mysteriously, that seems to work best.


Post a reply to this message

From: SharkD
Subject: Re: A question of Style
Date: 7 Jul 2008 02:44:39
Message: <4871bb57$1@news.povray.org>
Leroy Whetstone wrote:
> I've made several models and other things(macro,functions...) with POV. 
> Awhile back I got tired of having a test program for each of these. So 
> now I use #ifndef(Get)in all my Pov models and include files to bracket 
> a camera and lights and the object and what ever else I need to test the 
> file. Before you include the file you have to #declare Get=1;.
>  I was wondering do many use this trick?
>  And if you do what type do you save the file as?
>  I save objects like a boat,rock as a '.pov' and macros as an '.inc'.
> 
> 

I do the reverse: I store camera, lights, and common variables in a 
central location, also using #ifndef statements wherever possible. Then, 
in the scene I want to render, I include this file. I can always 
override the default variable states by declaring them before I do the 
inclusion.

See the "Game Sprites" item in the Object Collection for an example.

-Mike


Post a reply to this message

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