POV-Ray : Newsgroups : povray.newusers : <no subject> Server Time
1 Jul 2024 03:28:30 EDT (-0400)
  <no subject> (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: <no subject>
Date: 2 Jul 2011 16:09:29
Message: <4e0f7af9@news.povray.org>

> I've digged out through the Pov-ray help and found something like this
>
> #ifdef (User_Thing)
>    // This section is parsed if the
>    // identifier "User_Thing" was
>    // previously declared
>    object{User_Thing} // invoke identifier
>   #else
>    // This section is parsed if the
>    // identifier "User_Thing" was not
>    // previously declared
>    box{<0,0,0>,<1,1,1>} // use a default
>   #end
>    // End of conditional part
>
> is it usefull for the textures replacement?
>
>

It can be usefull for texture switching, but you must make the scene 
using that. Changing the scene to use those conditional statements can 
be very time consuming.

Your problem seems to be that EACH objects, or possibly component of 
complex objects, have it's own texture.
In that case, the texture explicitely writen in the definition of the 
object will always override any other texture that you try to apply.

In your case, your best bet is to do a search and replace from the 
actual texture to your texture.

Highlight the first
texture
    {
     uv_mapping
     pigment
     {
      color <0, 0, 0>
      transmit 0.5
      filter 1
     }
     finish
     {
      diffuse 1
      ambient 0
     }
    }
   }

Hit Ctrl + C

Launch the replace function in your text editor.
Paste that in the text to replace field with Ctrl + V
You can leave to replacement text field empty.

Click "Replace all"


Another possibility would be to ask your modeler to export the model 
untextured, or try using another modeler that #declare it's texture 
instead of inlining them.



Alain


Post a reply to this message

From: Christian Froeschlin
Subject: Re: <no subject>
Date: 9 Jul 2011 18:45:53
Message: <4e18da21$1@news.povray.org>
> the texture looks like that:
> 
> texture
>    {
..
>    }
>   }


If the exported code contains a literal embedded texture
for each object there is no easy solution I think. Basically
you need a perl script or similar to find the texture blocks
and replace them - this may require to count opening and closing
curly braces after texture keyword, although if the export is
consistently indented it may suffice to scan for "    }".

An alternative may be to use a different export format from your
source software (e.g. *.obj file) and convert using poseray.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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