POV-Ray : Newsgroups : povray.windows : Include color-changes in ini-files. possible? : Re: Include color-changes in ini-files. possible? Server Time
15 Jun 2024 00:03:32 EDT (-0400)
  Re: Include color-changes in ini-files. possible?  
From: Charles C
Date: 21 Oct 2006 14:20:00
Message: <web.453a610fbb20a150632e613b0@news.povray.org>
Olaf,
I know you've got real-life stress going on but don't give up now. Take a
break from it for a bit first as Stephen suggested, but I think you'll be
able to do this and when you do it'll be worth it.  Anyway sorry about the
confusion.  I didn't know how exactly your lego brick files were named so I
gave an example.  I should've made it clear that if your files look
something like "Lego_123.pov" (for example) the general approach will work.
 If your files don't start with "Lego_" you need to remove that and change
it to whatever it is.  In your case there is no word portion before it, so
you can just delete "Lego_",.

A quick mention of some of the things in that line:
The purpose of concat() is to combine multiple text strings.
str() converts a number into a string which can, eg, be used in concat().
#include just needs to be followed by a string, and it better match a real
file name.  So, there is no difference between #include "1.pov" and
#include concat("1.pov")

The tricky part about using str() when dealing with numbered files is to get
the  0-padding right.   If for example, the numbers are like "001.pov"
"002.pov" you need to set str() differently than if it's "1.pov" "2.pov"
Details on that are in the docs.  Anyway I think, based on how your files
are actually named the line should look like:

#include concat(str(frame_number,0,0), ".pov")


Now about the names of the rendered images...  If you can compromise a
little on the name it might be easy, or it might not be as easy. To use the
above approach and get "1.bmp" etc would be trickier than if it were ok to
get for example "Brick_1.bmp" etc.   So first of all you can change
General_Lego_Renderer.pov to something closer to what you want the final
name to be, again this is if something like "Something_1.bmp" rather than
"1.bmp" etc is acceptable.



If Pov-Ray is using the animation feature it'll add numbers to the end of
the image file name before the ".bmp" extension. If your master .pov file
is "Brick_.pov" and you have 400something individual brickfiles you need to
render, then add the following to the .ini file.:

Initial_Frame=1 ; starting at 1
Final_Frame=450 ; change to whatever it should be
Initial_Clock=0 ; clock not needed for today but it's here
Final_Clock=1   ; clock not needed for today but it's here

Pov-Ray will create "Brick_001.bmp" as the first image. Note that it's
padded by 0's. And it'll create "Brick_450.bmp" as the last image. (That
is, depending on what your main .pov file is named.)

BTW if you're currently using the Quickres.ini file (i.e. the dropdown menu
in windows), make a new .ini file just for this project and use it instead.
Put it in the directory with what you're trying to render. With the new
..ini file open in Pov-Ray's editor hit "Render". Here's an example of what
it might contain:

;----------

;note that comments in .ini files are after any ";"
Antialias=Off
Width=400
Height=300

;Anti-alias settings only relevant if AA is on:
Jitter=On
Sampling_Method=2
Antialias_Threshold=0.2
Antialias_Depth=2

Input_File_Name="myfile.pov" ;change to whatever...

;Another way to change the output, if desired, but I recommend not here:
;Output_File_Name=

;if changing background:
Declare=Color_R=1
Declare=Color_G=1
Declare=Color_B=0

Initial_Frame=1
Final_Frame=450
Initial_Clock=0
Final_Clock=1

;uncomment if you want to re-render certain frames:
 ;Subset_Start_Frame=1
 ;Subset_End_Frame=27

;This changes the clock slightly to make loops work better,
;but leave it off or commented-out normally:
;Cyclic_Animation=on

;You can add paths here as well as in POVRAY.INI:
;Library_Path=c:p-scenesmy_inc

;--------------


A side suggestion/option would be to use .png rather than .bmp   +fn in the
...ini will change that.  It's a lossless format but a lot more compressed.

Anyway, goodluck!

Charles



"Olaf I." <ola### [at] ewetelnet> wrote:
> Dear Stephen,
>
> Near ready.
> In the moment I have this error-notes:
>
> (...)
> File: C:LegoPovFilesGeneral_Lego_Renderer.pov  Line: 4
> Possible Parse Error: Could not find file 'Lego_0.pov'
> File: C:LegoPovFilesGeneral_Lego_Renderer.pov  Line: 4
> File Context (5 lines):
> #include concat("Lego_", str(frame_number,0,0), ".pov")
>
> background { color rgb <1,1,1>} //however you want to redefine it...
>
> Parse Error: Cannot open include file Lego_0.pov.
> File: C:LegoPovFilesGeneral_Lego_Renderer.pov  Line: 4
> Parse Warning: Check that the file is in a directory specified with a +L
> switch or 'Library_Path=' .INI item. Standard include files are in the
> include directory or folder.
> (...)
>
> Only when I change this row
> #include concat("Lego_", str(frame_number,0,0), ".pov")
> in
> #include concat("1.pov")
> it works.
> But them I get not the file General_Lego_Renderer.bmp not 1.bmp!
>
> Can you help me by this last (I hope so) problem?
>
> Regards,
>
> Olaf


Post a reply to this message

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