POV-Ray : Newsgroups : povray.general : Scripting guidance Server Time
19 Nov 2024 01:35:18 EST (-0500)
  Scripting guidance (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Chris Friedl
Subject: Scripting guidance
Date: 19 Jun 2002 07:36:57
Message: <3d106cd9@news.povray.org>
Hi All

I was wondering about what is good form in regards to writing pov scripts
(do you call them scripts?). With lots of objects, especially of type mesh,
cameras, lights, textures etc, I can image that pov fies get really big. Any
clues somewhere on how a good pov file could be laid out to make development
and maintenance easier?

Also, I'm working on animations, and have discovered some of the animation
options (Final_Frame etc). It seems that I have to put these in my
povray.ini file to work. However whenever I want to switch from generating
all images of the animation sequence, to say, only one image, I have to edit
this file and change the value of Final_Frame to 1. Same is true if I want
to switch on or off writing of rendered image output files in a working
session. Is there any easier way to do this than editing povray.ini? Can
these controls be placed in the pov script I am working on. It wasn't clear
to me how to do this from the documentation.

Thanks for any guidance.

Be Well and Happy Always

Chris


Post a reply to this message

From: Bonsai
Subject: Re: Scripting guidance
Date: 19 Jun 2002 09:42:51
Message: <3D1089FA.8000905@b0n541.net>
> With lots of objects, especially of type mesh,
> cameras, lights, textures etc, I can image that pov fies get really big. Any
> clues somewhere on how a good pov file could be laid out to make development
> and maintenance easier?

You can separate the textures, meshes and other objects into different 
files with the extension .inc (this is not required, but easier to 
recognize which is the global POV-Ray-File). Use the #declare function 
to give them a name:

#declare MyBestTextureIEverMade = texture
   {
   pigment
   ...
   ...
   }

Then make a global scene and include all necessary files with #include 
"filename.inc". Now you can use your defined textures, meshes and what ever.

e.g. a Mesh-Object

#include "mymeshes.inc"
#include "mytextures.inc"

object
   {
   TheBigMesh

   texture
     {
     MyBestTextureIEverMade
     }
   }

Hope that helps...

So long,

Bonsai


-- 
<--------------------------->
    ___ __ __  _ ___ ___  _
   | _ )  \  \( )  _) _ )( )
   | _ \() |\ \ |\ \/ _ \| |
   |___/__/_)\__)___)/ \_)_)

        www.b0n541.net
<--------------------------->


Post a reply to this message

From: Arthur Flint
Subject: Re: Scripting guidance
Date: 19 Jun 2002 11:16:34
Message: <Xns9232739086B32mrartchesapeakenet@204.213.191.226>
Chris Friedl scribis news:3d106cd9@news.povray.org:

> I can image that pov files get really big. Any
> clues somewhere on how a good pov file could be laid out to make
> development and maintenance easier?
> 

I tend to model smaller parts of whatever it is I
am working on and save each small part in its own
.inc file. 
An example:
// park scene
#include "bench.inc" object {bench rotate <,,> translate <,,>.....}
#include "trees.inc" object {Tree35 ......}
#include "outdoorlamps.inc"object {StreetLamp2 .....}

camera{...}

In this way I can see the overall layout of the scene without
a lot of clutter to distract me.

I also have a setup for each file that allowes me to render each
peice or object in its .inc file and still use the .inc file
without modification in the main scene file.
An example:

#include "Colors.inc"
#include "Global_Settings.inc"
#include "FileInUse.inc"
// development code goes here.
#if	(FileInUse=0)
	camera		{.....}
	#include	"Sun.inc"	object{Sun scale 1 rotate <+45,-15,0>}
	object		{ Jayhawk rotate y*0} //Jayhawk is a ship in Traveller
#end
#include "FileNotInUse.inc"

FileInUse.inc is
#ifndef(FileInUse)#declare FileInUse=0; 
#else #declare FileInUse=FileInUse+1;
#end

FileNotInUse.inc is
#declare FileInUse=FileInUse-1;

As you can see, if the inc file is not included but rendered
directly,the camera and scene building statements at the bottom
are used.

If the .inc file IS included in another scene file that uses
this same setup, the camera and scene setup at the bottom is
ignored and it is up to the main scene file to define the camera
and such.

In this way I can work on one small part of an object or scene
without having to work on one large file.
-- 
Gis poste, Arto.


Post a reply to this message

From: John VanSickle
Subject: Re: Scripting guidance
Date: 19 Jun 2002 17:48:53
Message: <3D10FC53.EC10D11@hotmail.com>
Chris Friedl wrote:
> 
> Hi All
> 
> I was wondering about what is good form in regards to writing pov
> scripts (do you call them scripts?). With lots of objects,
> especially of type mesh, cameras, lights, textures etc, I can image
> that pov fies get really big. Any clues somewhere on how a good pov
> file could be laid out to make development and maintenance easier?

Put each model in a separate .INC file.

Put your most commonly used textures into one .INC file.

Divide each major project into functional lines.  For instance, I
am now working on my 16th Rusty animation.  I have the following
files to accomplish this:

r#16.pov -- the main file
r#16_s01.inc -- a file defining the scenery for several shots
r#16_s02.inc -- more scenery files
r#16_c01.inc -- a file containing the camera
r#16_l01.inc -- a file defining the lighting
r#16_p01.inc -- a file defining the props in each shot
r#16_r01.inc -- this file places and animates the robots
r#16_t01.inc -- a file defining the subtitling, camera fades, etc.

r#16.pov contains code that determines which shot is being rendered,
based on the clock value; the other files have switch statements
to control which scenery items get placed.

> Also, I'm working on animations, and have discovered some of the
> animation options (Final_Frame etc). It seems that I have to put
> these in my povray.ini file to work. However whenever I want to
> switch from generating all images of the animation sequence, to
> say, only one image, I have to edit this file and change the value
> of Final_Frame to 1. Same is true if I want to switch on or off
> writing of rendered image output files in a working session. Is
> there any easier way to do this than editing povray.ini?

Copy povray.ini to another file, such as test.ini, still.ini,
final.ini, etc.  Edit them to do what you want.  Run the one that's
set up to do what you want.

Regards,
John


Post a reply to this message

From: Hugo
Subject: Re: Scripting guidance
Date: 19 Jun 2002 18:07:34
Message: <3d1100a6$1@news.povray.org>
I'd recommend using proper indention, put comments before each block of
code, and use descriptive variable names but not with very long names,
instead write additional comments to describe their use.

Some people write a lot of empty lines, or nearly empty lines, but I don't
recommend you do that. On the other hand, lines can become too crowded with
keywords or several brackets. Try to find a golden 'middle way'.. (Is that
proper english?)

I also recommend that you try to declare many variables for your objects,
when ever possible. It's easier to change the overall size, thickness or
roundness for a complex object ,when it was build around a set of variables,
instead of putting the numbers directly into the code.

Another advice would be to declare the variables in 'clusters'.. I mean,
instead of having them spread around the script, collect them next to each
other.. Then it's easier to find them later.. Similar with #include files:
put them in clusters when possible.

Enough now.  :o)
Regards,
Hugo


Post a reply to this message

From: Harold Baize
Subject: Re: Scripting guidance
Date: 19 Jun 2002 20:18:08
Message: <3d111f40$1@news.povray.org>
"Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
news:3d106cd9@news.povray.org...
> Also, I'm working on animations, and have discovered some of the animation
> options (Final_Frame etc). It seems that I have to put these in my
> povray.ini file to work. However whenever I want to switch from generating
> all images of the animation sequence, to say, only one image, I have to
edit
> this file and change the value of Final_Frame to 1. Same is true if I want
> to switch on or off writing of rendered image output files in a working
> session. Is there any easier way to do this than editing povray.ini? Can
> these controls be placed in the pov script I am working on. It wasn't
clear
> to me how to do this from the documentation.

Some of these could be accomplished by editing the POV QuickRes.ini file.
It isn't limited to resolution settings. I've customized mine to include
animation
settings for rendering stereo pairs. For example:

[800x600, AA 0.3]
Width=800
Height=600
Antialias=On
Antialias_Threshold=0.3

[Stereo 800x600]
Initial_Frame = 1
Final_Frame = 2
Initial_Clock = 0
Final_Clock = 1
Cyclic_Animation = off
Pause_when_Done = off
+w800 +h600
AntiAlias=On

I can chose to render just one image or a stereo pair by selecting
the corresponding "quickres" setting. The animation values result in
two images rendered, within the scene script file the clock value
moves the camera to give two view for stereo effect.

This is the camera definition that makes use of clock value:

//----- S t e r e o  C a m e r a -------\\
#declare dist=15;
#declare Camx=dist/60;
#if (clock)
  #declare Camx=-(dist/60);
#end
camera {location <Camx,-0.5, -15> look_at <Camx,0,0>
}

 You can do a lot with a customized quickres.ini file.

Harold


Post a reply to this message

From: Dennis Miller
Subject: Re: Scripting guidance
Date: 19 Jun 2002 21:29:12
Message: <3d112fe8$1@news.povray.org>
Sorry, can you clarify that a bit. I want to set up a batch of animations to
render during my vacation. Each scene file will be in a separate folder and
will need its own start and end frame, plus most importantly, its own clock
setting. I tried copying povray.ini to each folder, but it still rendered
using the default povray.ini in the Renderer folder
So how can I set up numerous ini files, one per folder, then run a Queue so
that each scene renders with its own settings? Do I need to add something to
the actual scene? I am using the GUI under Windows.
Thanks
D
"Harold Baize" <bai### [at] itsaucsfedu> wrote in message
news:3d111f40$1@news.povray.org...
>
> "Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
> news:3d106cd9@news.povray.org...
> > Also, I'm working on animations, and have discovered some of the
animation
> > options (Final_Frame etc). It seems that I have to put these in my
> > povray.ini file to work. However whenever I want to switch from
generating
> > all images of the animation sequence, to say, only one image, I have to
> edit
> > this file and change the value of Final_Frame to 1. Same is true if I
want
> > to switch on or off writing of rendered image output files in a working
> > session. Is there any easier way to do this than editing povray.ini? Can
> > these controls be placed in the pov script I am working on. It wasn't
> clear
> > to me how to do this from the documentation.
>
> Some of these could be accomplished by editing the POV QuickRes.ini file.
> It isn't limited to resolution settings. I've customized mine to include
> animation
> settings for rendering stereo pairs. For example:
>
> [800x600, AA 0.3]
> Width=800
> Height=600
> Antialias=On
> Antialias_Threshold=0.3
>
> [Stereo 800x600]
> Initial_Frame = 1
> Final_Frame = 2
> Initial_Clock = 0
> Final_Clock = 1
> Cyclic_Animation = off
> Pause_when_Done = off
> +w800 +h600
> AntiAlias=On
>
> I can chose to render just one image or a stereo pair by selecting
> the corresponding "quickres" setting. The animation values result in
> two images rendered, within the scene script file the clock value
> moves the camera to give two view for stereo effect.
>
> This is the camera definition that makes use of clock value:
>
> //----- S t e r e o  C a m e r a -------\\
> #declare dist=15;
> #declare Camx=dist/60;
> #if (clock)
>   #declare Camx=-(dist/60);
> #end
> camera {location <Camx,-0.5, -15> look_at <Camx,0,0>
> }
>
>  You can do a lot with a customized quickres.ini file.
>
> Harold
>
>


Post a reply to this message

From: Harold Baize
Subject: Re: Scripting guidance
Date: 19 Jun 2002 23:09:43
Message: <3d114777@news.povray.org>
That could be accomplished with an old fashioned
DOS batch file. Maybe someone else can describe
how to do it within the Windows GUI.

Harold

"Dennis Miller" <dhm### [at] attbicom> wrote in message
news:3d112fe8$1@news.povray.org...
> Sorry, can you clarify that a bit. I want to set up a batch of animations
to
> render during my vacation. Each scene file will be in a separate folder
and
> will need its own start and end frame, plus most importantly, its own
clock
> setting. I tried copying povray.ini to each folder, but it still rendered
> using the default povray.ini in the Renderer folder
> So how can I set up numerous ini files, one per folder, then run a Queue
so
> that each scene renders with its own settings? Do I need to add something
to
> the actual scene? I am using the GUI under Windows.
> Thanks
> D
> "Harold Baize" <bai### [at] itsaucsfedu> wrote in message
> news:3d111f40$1@news.povray.org...
> >
> > "Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
> > news:3d106cd9@news.povray.org...
> > > Also, I'm working on animations, and have discovered some of the
> animation
> > > options (Final_Frame etc). It seems that I have to put these in my
> > > povray.ini file to work. However whenever I want to switch from
> generating
> > > all images of the animation sequence, to say, only one image, I have
to
> > edit
> > > this file and change the value of Final_Frame to 1. Same is true if I
> want
> > > to switch on or off writing of rendered image output files in a
working
> > > session. Is there any easier way to do this than editing povray.ini?
Can
> > > these controls be placed in the pov script I am working on. It wasn't
> > clear
> > > to me how to do this from the documentation.
> >
> > Some of these could be accomplished by editing the POV QuickRes.ini
file.
> > It isn't limited to resolution settings. I've customized mine to include
> > animation
> > settings for rendering stereo pairs. For example:
> >
> > [800x600, AA 0.3]
> > Width=800
> > Height=600
> > Antialias=On
> > Antialias_Threshold=0.3
> >
> > [Stereo 800x600]
> > Initial_Frame = 1
> > Final_Frame = 2
> > Initial_Clock = 0
> > Final_Clock = 1
> > Cyclic_Animation = off
> > Pause_when_Done = off
> > +w800 +h600
> > AntiAlias=On
> >
> > I can chose to render just one image or a stereo pair by selecting
> > the corresponding "quickres" setting. The animation values result in
> > two images rendered, within the scene script file the clock value
> > moves the camera to give two view for stereo effect.
> >
> > This is the camera definition that makes use of clock value:
> >
> > //----- S t e r e o  C a m e r a -------\\
> > #declare dist=15;
> > #declare Camx=dist/60;
> > #if (clock)
> >   #declare Camx=-(dist/60);
> > #end
> > camera {location <Camx,-0.5, -15> look_at <Camx,0,0>
> > }
> >
> >  You can do a lot with a customized quickres.ini file.
> >
> > Harold
> >
> >
>
>


Post a reply to this message

From: bob h
Subject: Re: Scripting guidance
Date: 20 Jun 2002 03:17:58
Message: <3d1181a6@news.povray.org>
"Harold Baize" <bai### [at] itsaucsfedu> wrote in message
news:3d114777@news.povray.org...
>
> That could be accomplished with an old fashioned
> DOS batch file. Maybe someone else can describe
> how to do it within the Windows GUI.

Sure :-) Use the ini files in the Queue instead of the pov files, each with
a Input_File_Name= corresponding to the pov file. Of course that means you
need a ini for every pov, unless someone has another idea.

Oh yeah, Chris Cason had made it possible to render a list of pov files
(Insert Menu bitmaps) from within a single ini by using numbered block
sections. I thought I knew how to do that but I recall never getting it to
work and I think Chris coaxed POV-Ray to count through the settings blocks
internally through the program. Having checked it out again here I could
only get the first section of the ini to be seen if it is also set in the
Ini dialog. If it isn't, the 'object.pov not found' error happens.

bob h

> "Dennis Miller" <dhm### [at] attbicom> wrote in message
> news:3d112fe8$1@news.povray.org...
> > Sorry, can you clarify that a bit. I want to set up a batch of
animations
> to
> > render during my vacation. Each scene file will be in a separate folder
> and
> > will need its own start and end frame, plus most importantly, its own
> clock
> > setting. I tried copying povray.ini to each folder, but it still
rendered
> > using the default povray.ini in the Renderer folder
> > So how can I set up numerous ini files, one per folder, then run a Queue
> so
> > that each scene renders with its own settings? Do I need to add
something
> to
> > the actual scene? I am using the GUI under Windows.
> > Thanks
> > D
> > "Harold Baize" <bai### [at] itsaucsfedu> wrote in message
> > news:3d111f40$1@news.povray.org...
> > >
> > > "Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
> > > news:3d106cd9@news.povray.org...
> > > > Also, I'm working on animations, and have discovered some of the
> > animation
> > > > options (Final_Frame etc). It seems that I have to put these in my
> > > > povray.ini file to work. However whenever I want to switch from
> > generating
> > > > all images of the animation sequence, to say, only one image, I have
> to
> > > edit
> > > > this file and change the value of Final_Frame to 1. Same is true if
I
> > want
> > > > to switch on or off writing of rendered image output files in a
> working
> > > > session. Is there any easier way to do this than editing povray.ini?
> Can
> > > > these controls be placed in the pov script I am working on. It
wasn't
> > > clear
> > > > to me how to do this from the documentation.
> > >
> > > Some of these could be accomplished by editing the POV QuickRes.ini
> file.
> > > It isn't limited to resolution settings. I've customized mine to
include
> > > animation
> > > settings for rendering stereo pairs. For example:
> > >
> > > [800x600, AA 0.3]
> > > Width=800
> > > Height=600
> > > Antialias=On
> > > Antialias_Threshold=0.3
> > >
> > > [Stereo 800x600]
> > > Initial_Frame = 1
> > > Final_Frame = 2
> > > Initial_Clock = 0
> > > Final_Clock = 1
> > > Cyclic_Animation = off
> > > Pause_when_Done = off
> > > +w800 +h600
> > > AntiAlias=On
> > >
> > > I can chose to render just one image or a stereo pair by selecting
> > > the corresponding "quickres" setting. The animation values result in
> > > two images rendered, within the scene script file the clock value
> > > moves the camera to give two view for stereo effect.
> > >
> > > This is the camera definition that makes use of clock value:
> > >
> > > //----- S t e r e o  C a m e r a -------\\
> > > #declare dist=15;
> > > #declare Camx=dist/60;
> > > #if (clock)
> > >   #declare Camx=-(dist/60);
> > > #end
> > > camera {location <Camx,-0.5, -15> look_at <Camx,0,0>
> > > }
> > >
> > >  You can do a lot with a customized quickres.ini file.
> > >
> > > Harold
> > >
> > >
> >
> >
>
>


Post a reply to this message

From: Harold Baize
Subject: Re: Scripting guidance
Date: 20 Jun 2002 14:28:19
Message: <3d121ec3$1@news.povray.org>
"bob h" <omn### [at] charternet> wrote in message
news:3d1181a6@news.povray.org...
> "Harold Baize" <bai### [at] itsaucsfedu> wrote in message
> news:3d114777@news.povray.org...
> >
> > That could be accomplished with an old fashioned
> > DOS batch file. Maybe someone else can describe
> > how to do it within the Windows GUI.
>
> Sure :-) Use the ini files in the Queue instead of the pov files, each
with
> a Input_File_Name= corresponding to the pov file. Of course that means you
> need a ini for every pov, unless someone has another idea.

Bob,
Where do I find the Queue in MS Windows?

HB


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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