POV-Ray : Newsgroups : povray.beta-test : selective component loading..... : Re: selective component loading..... Server Time
28 Jul 2024 18:14:36 EDT (-0400)
  Re: selective component loading.....  
From: David Wallace
Date: 19 Nov 2007 16:10:27
Message: <4741fbc3$1@news.povray.org>
Andycadd wrote:
> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> Andycadd escribió:
>>> is there such a system in the scene control language?
>>>
>>> IE...  a very large file of many textures takes up too much memory
>>> is there anyway to only load "specific" lines from an include file? not the
>>> whole file.
>>>
>>>
>> Totally wrong newsgroup; setting followup to povray.general.
>>
>> You could either keep it in separate files, or use #if statements.
>>
>> On main scene:
>> #declare UseHighQualityModels=no;
>> #declare UseHighQualityTextures=no;
>>
>> On an included file:
>> #if(UseHighQualityModels)
>>   #declare Model = union {
>>    ...something BIG
>>   }
>> #else
>>   #declare Model = union {
>>    ...simplified model...
>>   }
>> #end
>>
>> object {
>>   Model
>>   #if(UseHighQualityTextures)
>>    texture {
>>     ...something BIG
>>    }
>>   #else
>>   pigment {
>>    color Yellow
>>   }
>>   #end
>> }
> 
> Thank you for your very useful routines for step 2
> 
> BUT....    step 1.  Is there a partial load possible for ".inc" files?
> a file access keyword to let me search for specific textures/materials from
> within the parser, rather than loading the entire ".inc" file.
> 
> the SCENE DESCRIPTION LANGUAGE equivalent to:
> (fileopen "XXX" "rw")
> (wcmatch "XXXX" file)
> (readfile ....  " xx ;" )
> 
> I want to do this because I have a few thousand texture maps and definitions
> which overload the stack if I load them all simultaneously.
> 
> Or better would be a "purge" type function to clear out unused textures from
> the stack before rendering.
> 
> I have a collection of many thousand finishes and architectural elements, in
> texture/material definitions some are in bitmap form.  I slapped them
> together with excel into a dozen or so ".inc" files that are cumbersome to
> work with.  So selective loading would minimize my cumber with regards to
> using my library.
> 
> The best would be a "purge" type function, to remove the excess items.  This
> would be the most useful and trouble free, especially if it could be called
> repeatedly from within an ".inc" file.
> 
> oh and where is the proper group for this discussion?
> 
> 
I tend to keep a global variable, IsTest, in the scene file, prior to any 
includes.  The include files can then use this variable to use "final" and 
"test" versions of their objects.

Any object, texture, etc. that wanted to use this functionality would use the 
#if directive.  You could just as easily use several test variables for 
"stubbing" various groups of objects.

-- 
--------------
David Wallace
TenArbor Consulting
"Just In Time Cash"
www.tenarbor.com
1-866-572-CASH


Post a reply to this message

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