![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Povray is recognizing the texture "Milky" becouse I have made it in the Povray
so this is not the problem the thing is how to replace the imported texture (I
can not change it in the software I have exported the model from) with the
"Milky" that I have created in the Povray on the numerous of elements.
To make it straightforward:
1.How to replace one texture with the other one on the numerous of elements?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 07/01/2011 08:31 AM, rode wrote:
> Povray is recognizing the texture "Milky" becouse I have made it in the Povray
> so this is not the problem the thing is how to replace the imported texture (I
> can not change it in the software I have exported the model from) with the
> "Milky" that I have created in the Povray on the numerous of elements.
> To make it straightforward:
> 1.How to replace one texture with the other one on the numerous of elements?
>
>
>
unless you're handy with regex pattern matching and can write a
script/program to do it for you ... you will have to bite the bullet and
hand edit
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>then find all the occurrences of the original texture and replace
> them with texture { Milky }
that's exactly the point. Till now I have made it line by line (but it took me
hours and hours to replace just a few of the elements textures) also I have
tried FindReplace command but it doesn't work, is there a formula I can use for
such
action?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 07/01/2011 08:53 AM, rode wrote:
>> then find all the occurrences of the original texture and replace
>> them with texture { Milky }
>
> that's exactly the point. Till now I have made it line by line (but it took me
> hours and hours to replace just a few of the elements textures) also I have
> tried FindReplace command but it doesn't work, is there a formula I can use for
> such
> action?
>
>
try this ... find the 1st occurrence of the texture you want to replace
in your exported model (include) file. Select the /entire/ texture
statement and copy it into the copy & paste buffer, then paste that into
the find or search for dialog, then in the replace portion of the dialog
type texture {Milky} ... this worked in gedit (picked up invisible
characters like newline \n, \t ...), I'm not using windows version and
it's built-in editor, so I don't know if that will work
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> try this ... find the 1st occurrence of the texture you want to
> replace in your exported model (include) file. Select the /entire/
> texture statement and copy it into the copy & paste buffer, then
> paste that into the find or search for dialog, then in the replace
> portion of the dialog type texture {Milky} ... this worked in gedit
> (picked up invisible characters like newline \n, \t ...), I'm not
> using windows version and it's built-in editor, so I don't know if
> that will work
That also works great for me with SciTE... which is available for
Windows too.
--
Jaime Vives Piqueres
La Persistencia de la Ignorancia
http://www.ignorancia.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Hello Povray users!
> I have a quite annoying problem which I've been trying to figure out for the
> last
> month...please help. The thing is have exported model with given texture(and
> there are lots of elements with the same texture) the texture looks like that:
>
> texture
> {
> uv_mapping
> pigment
> {
> color<0, 0, 0>
> transmit 0.5
> filter 1
> }
> finish
> {
> diffuse 1
> ambient 0
> }
> }
> }
> I have declared another texture:
>
> #declare Milky =
> texture{
> pigment
> {
> rgbft<1, 1, 1, 0.4, 0.5>
> }
> finish
> {
> diffuse 1.5
> ambient 0
> specular 0.2
> phong 0.4
> roughness 0.1
> reflection 0.05
>
> }}
> And now the question is: HOW TO REPLACE THE EXPORTED TEXTURE WITH THE NEW ONE
> ON ALL THESE ELEMENTS??
>
>
>
>
If the texture is present as a texture block everywhere, you need to
replace is with: texture{Milky} everywhere it's used.
Do a search in the exported file for "texture".
Then, you replace the content of the texture with "Milky".
You also can remove all texture and use this:
IF the exported file #declare the objects:
object{ExportedObjectName texture{Milky}}
Or, like this:
union{object{Object001}
object{Object002}
...
texture{Milky}
// Optional transforms
scale<1,1,1>
rotate<0,0,0>
translate<0,0,0>
}
IF you include the file to place the objects (there are NO #declare in
the file):
union{
#include "ExportedFile.inc"
texture{Milky}
// Optional transforms
scale<1,1,1>
rotate<0,0,0>
translate<0,0,0>
}
If there is a #declare statement for it, you only need to change it's
#declare to read as: #declare Texture=texture{Milky}
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Alain <aze### [at] qwerty org> wrote:
> > Hello Povray users!
> > I have a quite annoying problem which I've been trying to figure out for the
> > last
> > month...please help. The thing is have exported model with given texture(and
> > there are lots of elements with the same texture) the texture looks like that:
> >
> > texture
> > {
> > uv_mapping
> > pigment
> > {
> > color<0, 0, 0>
> > transmit 0.5
> > filter 1
> > }
> > finish
> > {
> > diffuse 1
> > ambient 0
> > }
> > }
> > }
> > I have declared another texture:
> >
> > #declare Milky =
> > texture{
> > pigment
> > {
> > rgbft<1, 1, 1, 0.4, 0.5>
> > }
> > finish
> > {
> > diffuse 1.5
> > ambient 0
> > specular 0.2
> > phong 0.4
> > roughness 0.1
> > reflection 0.05
> >
> > }}
> > And now the question is: HOW TO REPLACE THE EXPORTED TEXTURE WITH THE NEW ONE
> > ON ALL THESE ELEMENTS??
> >
> >
> >
> >
>
> If the texture is present as a texture block everywhere, you need to
> replace is with: texture{Milky} everywhere it's used.
>
> Do a search in the exported file for "texture".
> Then, you replace the content of the texture with "Milky".
>
> You also can remove all texture and use this:
>
> IF the exported file #declare the objects:
> object{ExportedObjectName texture{Milky}}
>
> Or, like this:
> union{object{Object001}
> object{Object002}
> ...
> texture{Milky}
> // Optional transforms
> scale<1,1,1>
> rotate<0,0,0>
> translate<0,0,0>
> }
>
> IF you include the file to place the objects (there are NO #declare in
> the file):
> union{
> #include "ExportedFile.inc"
> texture{Milky}
> // Optional transforms
> scale<1,1,1>
> rotate<0,0,0>
> translate<0,0,0>
> }
>
> If there is a #declare statement for it, you only need to change it's
> #declare to read as: #declare Texture=texture{Milky}
>
>
>
>
> Alain
Alain thank you for your reply. Following your tips I have made something like
that (those are the initial lines from my scene):
#declare Milky =
texture{
pigment
{
rgbft <1, 1, 1, 0.4, 0.5>
}
finish
{
diffuse 1.5
ambient 0
specular 0.2
phong 0.4
roughness 0.1
reflection 0.05
}}
#declare Texture=texture{Milky}
unfortunately it doesn't work (the elements keep their original texture) Did I
miss something?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |