|
|
Mathuin wrote:
> I have a scene file which has stuff like this:
>
> #macro bigthing(_this, _that, _other)
> ..... do this big thing
> #end // bigthing
>
> #macro blah(_index)
> bigthing(ThisArr[_index], ThatArr[_index], OtherArr[_index])
> #end // blah
>
> blah(1)
> blah(2)
> blah(3)
> ..... and so forth
>
> Is there any way I can condense the multiple blah() calls into something like:
>
> #for _index in 1..10
> blah(_index)
> #end // for
>
> That would rule. Thanks!
There's no "for" but you can use "while" for the same purpose. For example:
#declare Count = dimension_size(ThisArr, 1);
#declare Ct = 0;
#while(Ct < Count)
blah(Ct)
#declare Ct = Ct + 1;
#end
--
// The Mildly Infamous Blue Herring
#version 3.61;#include"functions.inc"global_settings{assumed_gamma
2.2}isosurface{function{-f_strophoid(x/2-.45,y,z*3,1,1.2,1,1.5)-.05}
contained_by{box{<-2.1,-1,-1/3>,<1.4,1,1/3>}}max_gradient 12inverse
hollow pigment{rgbf 1}interior{media{samples 8 emission<3,80,150>/255
density{crackle metric 1color_map{[0rgb 6][.03rgb 0][1rgb 0]}scale<1,
2,1>warp{turbulence<.5,.75,.5>}scale 1/3}}}translate z*3}
Post a reply to this message
|
|