POV-Ray : Newsgroups : povray.beta-test : macro issue : macro issue Server Time
29 Jul 2024 08:14:22 EDT (-0400)
  macro issue  
From: Scott Wasson
Date: 16 Jun 2002 22:54:08
Message: <3d0d4f50$1@news.povray.org>
I'm trying to declare a macro that defines a layered texture.  Here's a
simplified example:

#macro fooTexture()
 texture {
     pigment { Red }
 }
 texture {
     pigment { Blue }
}
#end //macro fooTexture

Please ignore the fact there's no transmit in the Blue layer...   Now, if I
add a #-something to the second layer:

 texture {
    #declare fooBar=2;
     pigment { Blue }
}

or:

 texture {
 #if ( 0 )
     pigment { Blue }
 #else
     pigment { Green}
 #end
}

or add any #'whatevers at all within the second layer, I get a parsing
error: "No matching } in 'texture', # found instead".

But if I do:

#macro fooTexture()
 texture {
  #declare fooBar=2;
     pigment { Red }
 }
 texture {
     pigment { Blue }
}
#end //macro fooTexture


It doesn't complain about #declares in the 1st layer.  What up?

-Scott


Post a reply to this message

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