simple exprfill question

Jan 1, 2007 at 3:42pm

simple exprfill question

Hello and Happy New Year,

Simple question, maybe someone can ignore their hangover for a minute
and post me a reply.

I want to use jit.matrix with the “exprfill” message to replace a
jit.bfg in my patch, but I can’t seem to get the right arguments to
exprfill to duplicate the jit.bfg object’s output. Please see the
patch below – in particular, the “scale” message in exprfill doesn’t
seem to change the output in any noticeable way, perhaps I’m not
using it correctly. I can’t seem to find any docs that explain what
the input range of jit.bfg should be, but I assume that since it
takes float32 data they are something like 1- to 1, or snorm[0] (in
jit.expr-speak)?

thanks in advance,
evan

max v2;
#N vpatcher 609 361 1401 717;
#P origin 157 77;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P message 448 89 314 196617 exprfill “noise.gradient(snorm[0]\,
snorm[1]\, snorm[2]\, @scale 1. 1. 1.\, @offset -2.25 0.24 1.2\
, @seed -1138)”;
#P window linecount 5;
#P message 290 218 105 196617 weight 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.;
#P window linecount 1;
#P newex 290 193 62 196617 prepend set;
#P newex 94 124 72 196617 sprintf get%s;
#P newex 155 259 78 196617 prepend append;
#P newex 155 237 27 196617 iter;
#P newex 155 214 46 196617 t l clear;
#P newex 155 191 87 196617 route attributes;
#P user ubumenu 96 100 93 196617 0 1 1 0;
#X add outputmode;
#X add adapt;
#X add out_name;
#X add type;
#X add dim;
#X add planecount;
#X add align;
#X add autocenter;
#X add basis;
#X add classname;
#X add offset;
#X add origin;
#X add precision;
#X add rotation;
#X add scale;
#X add seed;
#X add weight;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P message 19 101 69 196617 getattributes;
#P newex 208 216 38 196617 print;
#P message 19 123 52 196617 summary;
#P button 410 139 15 0;
#P button 24 80 15 0;
#P user jit.pwindow 431 188 66 66 0 0 0 0 1 0;
#P window linecount 2;
#P message 448 127 314 196617 exprfill “noise.gradient(snorm[0]\,
snorm[1]\, snorm[2]\, @scale 5.77 5.77 5.77\, @offset -2.25
0.24 1.2\, @seed -1138)”;
#P window linecount 1;
#P newex 432 163 191 196617 jit.matrix spherish 1 char 128 128 128;
#P user jit.pwindow 35 196 66 66 0 0 0 0 1 0;
#P window linecount 2;
#P newex 10 147 249 196617 jit.bfg 1 char 128 128 128 @basis
noise.gradient @scale 5.77 5.77 5.77 @offset -2.25 0.24 1.2;
#P comment 109 41 184 196617 how do you get these to be the same?
(jit.bfg –> exprfill??);
#P window linecount 4;
#P comment 332 85 100 196617 how come changing the scale argument
doesn’t seem to make a difference?;
#P fasten 17 0 2 0 99 144 15 144;
#P fasten 11 0 2 0 24 119 15 119;
#P fasten 9 0 2 0 24 141 15 141;
#P fasten 7 0 2 0 29 98 15 98;
#P fasten 2 0 3 0 15 189 41 189;
#P fasten 12 1 17 0 142 121 99 121;
#P fasten 16 0 12 0 160 282 279 282 279 93 101 93;
#P fasten 14 1 12 0 196 238 279 238 279 93 101 93;
#P fasten 2 1 13 0 254 183 160 183;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 16 0;
#P fasten 13 1 10 0 237 212 213 212;
#P connect 13 1 18 0;
#P connect 18 0 19 0;
#P fasten 20 0 4 0 453 120 437 120;
#P connect 8 0 4 0;
#P fasten 5 0 4 0 453 158 437 158;
#P connect 4 0 6 0;
#P pop;

#29455
Jan 1, 2007 at 6:49pm

Hi Evan,
Check out the patch below. You have to supply scaled and offset
coordinates to the functions instead of using the attrbiutes.

wes

#P window setfont “Sans Serif” 9.;
#P window linecount 4;
#P comment 732 186 100 196617 you have to do it with you args to the
function , not atributes.;
#P window linecount 1;
#P comment 218 372 140 196617 compare this to your original;
#P button 363 371 15 0;
#P user jit.pwindow 437 411 66 66 0 0 0 0 1 0;
#P newex 412 362 392 196617 jit.bfg 1 char 128 128 128 @basis
noise.gradient @offset -1. -1. -1. @scale 2. 2. 2.;
#P window linecount 2;
#P message 508 149 314 196617 exprfill “noise.gradient(snorm[0]\,
snorm[1]\, snorm[2]\, @scale 1. 1. 1.\, @offset -2.25 0.24
1.2\, @seed -1138)”;
#P window linecount 5;
#P message 350 278 105 196617 weight 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.;
#P window linecount 1;
#P newex 350 253 62 196617 prepend set;
#P newex 154 184 72 196617 sprintf get%s;
#P newex 215 319 78 196617 prepend append;
#P newex 215 297 27 196617 iter;
#P newex 215 274 46 196617 t l clear;
#P newex 215 251 87 196617 route attributes;
#P user ubumenu 156 160 93 196617 0 1 1 0;
#X add outputmode;
#X add adapt;
#X add out_name;
#X add type;
#X add dim;
#X add planecount;
#X add align;
#X add autocenter;
#X add basis;
#X add classname;
#X add offset;
#X add origin;
#X add precision;
#X add rotation;
#X add scale;
#X add seed;
#X add weight;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P message 79 161 69 196617 getattributes;
#P newex 268 276 38 196617 print;
#P message 79 183 52 196617 summary;
#P button 470 199 15 0;
#P button 84 140 15 0;
#P user jit.pwindow 491 248 66 66 0 0 0 0 1 0;
#P window linecount 2;
#P message 508 187 217 196617 exprfill
“noise.gradient(5.77*norm[0]-2.25\, 5.77*norm[1]+0.24\,
5.77*norm[2]+1.2)”;
#P window linecount 1;
#P newex 492 223 191 196617 jit.matrix spherish 1 char 128 128 128;
#P user jit.pwindow 95 256 66 66 0 0 0 0 1 0;
#P window linecount 2;
#P newex 70 207 249 196617 jit.bfg 1 char 128 128 128 @basis
noise.gradient @scale 5.77 5.77 5.77 @offset -2.25 0.24 1.2;
#P comment 169 101 184 196617 how do you get these to be the same?
(jit.bfg –> exprfill??);
#P window linecount 4;
#P comment 405 115 100 196617 how come changing the scale argument
doesn’t seem to make a difference?;
#P connect 23 0 21 0;
#P fasten 21 0 22 0 417 404 443 404;
#P connect 4 0 6 0;
#P fasten 5 0 4 0 513 218 497 218;
#P connect 8 0 4 0;
#P fasten 20 0 4 0 513 180 497 180;
#P connect 18 0 19 0;
#P connect 13 1 18 0;
#P fasten 13 1 10 0 297 272 273 272;
#P connect 15 0 16 0;
#P connect 14 0 15 0;
#P connect 13 0 14 0;
#P fasten 2 1 13 0 314 243 220 243;
#P fasten 14 1 12 0 256 298 339 298 339 153 161 153;
#P fasten 16 0 12 0 220 342 339 342 339 153 161 153;
#P fasten 12 1 17 0 202 181 159 181;
#P fasten 2 0 3 0 75 249 101 249;
#P fasten 7 0 2 0 89 158 75 158;
#P fasten 9 0 2 0 84 201 75 201;
#P fasten 11 0 2 0 84 179 75 179;
#P fasten 17 0 2 0 159 204 75 204;
#P window clipboard copycount 26;

#92153
Jan 1, 2007 at 9:09pm

Hi Wes,

Thanks, that does it!

It would be great if this were in the documentation, especially the
docs for for jit.expr, because the helpfile for it gives the
impression that you can set these attributes using “@ATTRIBUTE VALUE”
like I tried in my original patch – the helpfile uses a messagebox
with: expr ” noise.gradient(norm[0]*2, norm[1]*2, @seed 313)”

Best
Evan

On Jan 1, 2007, at 6:49 PM, Wesley Smith wrote:

> Hi Evan,
> Check out the patch below. You have to supply scaled and offset
> coordinates to the functions instead of using the attrbiutes.
>
> wes
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 4;
> #P comment 732 186 100 196617 you have to do it with you args to the
> function , not atributes.;
> #P window linecount 1;
> #P comment 218 372 140 196617 compare this to your original;
> #P button 363 371 15 0;
> #P user jit.pwindow 437 411 66 66 0 0 0 0 1 0;
> #P newex 412 362 392 196617 jit.bfg 1 char 128 128 128 @basis
> noise.gradient @offset -1. -1. -1. @scale 2. 2. 2.;
> #P window linecount 2;
> #P message 508 149 314 196617 exprfill “noise.gradient(snorm[0]\,
> snorm[1]\, snorm[2]\, @scale 1. 1. 1.\, @offset -2.25 0.24
> 1.2\, @seed -1138)”;
> #P window linecount 5;
> #P message 350 278 105 196617 weight 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
> 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.;
> #P window linecount 1;
> #P newex 350 253 62 196617 prepend set;
> #P newex 154 184 72 196617 sprintf get%s;
> #P newex 215 319 78 196617 prepend append;
> #P newex 215 297 27 196617 iter;
> #P newex 215 274 46 196617 t l clear;
> #P newex 215 251 87 196617 route attributes;
> #P user ubumenu 156 160 93 196617 0 1 1 0;
> #X add outputmode;
> #X add adapt;
> #X add out_name;
> #X add type;
> #X add dim;
> #X add planecount;
> #X add align;
> #X add autocenter;
> #X add basis;
> #X add classname;
> #X add offset;
> #X add origin;
> #X add precision;
> #X add rotation;
> #X add scale;
> #X add seed;
> #X add weight;
> #X prefix_set 0 0 0;
> #X pattrmode 1;
> #P message 79 161 69 196617 getattributes;
> #P newex 268 276 38 196617 print;
> #P message 79 183 52 196617 summary;
> #P button 470 199 15 0;
> #P button 84 140 15 0;
> #P user jit.pwindow 491 248 66 66 0 0 0 0 1 0;
> #P window linecount 2;
> #P message 508 187 217 196617 exprfill
> “noise.gradient(5.77*norm[0]-2.25\, 5.77*norm[1]+0.24\,
> 5.77*norm[2]+1.2)”;
> #P window linecount 1;
> #P newex 492 223 191 196617 jit.matrix spherish 1 char 128 128 128;
> #P user jit.pwindow 95 256 66 66 0 0 0 0 1 0;
> #P window linecount 2;
> #P newex 70 207 249 196617 jit.bfg 1 char 128 128 128 @basis
> noise.gradient @scale 5.77 5.77 5.77 @offset -2.25 0.24 1.2;
> #P comment 169 101 184 196617 how do you get these to be the same?
> (jit.bfg –> exprfill??);
> #P window linecount 4;
> #P comment 405 115 100 196617 how come changing the scale argument
> doesn’t seem to make a difference?;
> #P connect 23 0 21 0;
> #P fasten 21 0 22 0 417 404 443 404;
> #P connect 4 0 6 0;
> #P fasten 5 0 4 0 513 218 497 218;
> #P connect 8 0 4 0;
> #P fasten 20 0 4 0 513 180 497 180;
> #P connect 18 0 19 0;
> #P connect 13 1 18 0;
> #P fasten 13 1 10 0 297 272 273 272;
> #P connect 15 0 16 0;
> #P connect 14 0 15 0;
> #P connect 13 0 14 0;
> #P fasten 2 1 13 0 314 243 220 243;
> #P fasten 14 1 12 0 256 298 339 298 339 153 161 153;
> #P fasten 16 0 12 0 220 342 339 342 339 153 161 153;
> #P fasten 12 1 17 0 202 181 159 181;
> #P fasten 2 0 3 0 75 249 101 249;
> #P fasten 7 0 2 0 89 158 75 158;
> #P fasten 9 0 2 0 84 201 75 201;
> #P fasten 11 0 2 0 84 179 75 179;
> #P fasten 17 0 2 0 159 204 75 204;
> #P window clipboard copycount 26;

#92154
Jan 1, 2007 at 9:21pm

Something I thought to mention after my previous is that calling
noise.gradient is calling a functor and not calling jit.bfg. You can
pass in attributes to these functions like @seed because the functor
supports these attributes. If you look in the gnoise subpatch in
jit.bfg.help, you will see what messages/attributes noise.gradient can
handle. Notice that scale and offset aren’t in there. These are
global to jit.bfg which is why they didn’t have any effect in your
original patch. Hope this clarifies things a bit.

best,
wes

On 1/1/07, evan.raskob [lists]

wrote:
> Hi Wes,
>
> Thanks, that does it!
>
> It would be great if this were in the documentation, especially the
> docs for for jit.expr, because the helpfile for it gives the
> impression that you can set these attributes using “@ATTRIBUTE VALUE”
> like I tried in my original patch – the helpfile uses a messagebox
> with: expr ” noise.gradient(norm[0]*2, norm[1]*2, @seed 313)”
>
> Best
> Evan
>
>
> On Jan 1, 2007, at 6:49 PM, Wesley Smith wrote:
>
> > Hi Evan,
> > Check out the patch below. You have to supply scaled and offset
> > coordinates to the functions instead of using the attrbiutes.
> >
> > wes
> >
> > #P window setfont “Sans Serif” 9.;
> > #P window linecount 4;
> > #P comment 732 186 100 196617 you have to do it with you args to the
> > function , not atributes.;
> > #P window linecount 1;
> > #P comment 218 372 140 196617 compare this to your original;
> > #P button 363 371 15 0;
> > #P user jit.pwindow 437 411 66 66 0 0 0 0 1 0;
> > #P newex 412 362 392 196617 jit.bfg 1 char 128 128 128 @basis
> > noise.gradient @offset -1. -1. -1. @scale 2. 2. 2.;
> > #P window linecount 2;
> > #P message 508 149 314 196617 exprfill “noise.gradient(snorm[0]\,
> > snorm[1]\, snorm[2]\, @scale 1. 1. 1.\, @offset -2.25 0.24
> > 1.2\, @seed -1138)”;
> > #P window linecount 5;
> > #P message 350 278 105 196617 weight 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
> > 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.;
> > #P window linecount 1;
> > #P newex 350 253 62 196617 prepend set;
> > #P newex 154 184 72 196617 sprintf get%s;
> > #P newex 215 319 78 196617 prepend append;
> > #P newex 215 297 27 196617 iter;
> > #P newex 215 274 46 196617 t l clear;
> > #P newex 215 251 87 196617 route attributes;
> > #P user ubumenu 156 160 93 196617 0 1 1 0;
> > #X add outputmode;
> > #X add adapt;
> > #X add out_name;
> > #X add type;
> > #X add dim;
> > #X add planecount;
> > #X add align;
> > #X add autocenter;
> > #X add basis;
> > #X add classname;
> > #X add offset;
> > #X add origin;
> > #X add precision;
> > #X add rotation;
> > #X add scale;
> > #X add seed;
> > #X add weight;
> > #X prefix_set 0 0 0;
> > #X pattrmode 1;
> > #P message 79 161 69 196617 getattributes;
> > #P newex 268 276 38 196617 print;
> > #P message 79 183 52 196617 summary;
> > #P button 470 199 15 0;
> > #P button 84 140 15 0;
> > #P user jit.pwindow 491 248 66 66 0 0 0 0 1 0;
> > #P window linecount 2;
> > #P message 508 187 217 196617 exprfill
> > “noise.gradient(5.77*norm[0]-2.25\, 5.77*norm[1]+0.24\,
> > 5.77*norm[2]+1.2)”;
> > #P window linecount 1;
> > #P newex 492 223 191 196617 jit.matrix spherish 1 char 128 128 128;
> > #P user jit.pwindow 95 256 66 66 0 0 0 0 1 0;
> > #P window linecount 2;
> > #P newex 70 207 249 196617 jit.bfg 1 char 128 128 128 @basis
> > noise.gradient @scale 5.77 5.77 5.77 @offset -2.25 0.24 1.2;
> > #P comment 169 101 184 196617 how do you get these to be the same?
> > (jit.bfg –> exprfill??);
> > #P window linecount 4;
> > #P comment 405 115 100 196617 how come changing the scale argument
> > doesn’t seem to make a difference?;
> > #P connect 23 0 21 0;
> > #P fasten 21 0 22 0 417 404 443 404;
> > #P connect 4 0 6 0;
> > #P fasten 5 0 4 0 513 218 497 218;
> > #P connect 8 0 4 0;
> > #P fasten 20 0 4 0 513 180 497 180;
> > #P connect 18 0 19 0;
> > #P connect 13 1 18 0;
> > #P fasten 13 1 10 0 297 272 273 272;
> > #P connect 15 0 16 0;
> > #P connect 14 0 15 0;
> > #P connect 13 0 14 0;
> > #P fasten 2 1 13 0 314 243 220 243;
> > #P fasten 14 1 12 0 256 298 339 298 339 153 161 153;
> > #P fasten 16 0 12 0 220 342 339 342 339 153 161 153;
> > #P fasten 12 1 17 0 202 181 159 181;
> > #P fasten 2 0 3 0 75 249 101 249;
> > #P fasten 7 0 2 0 89 158 75 158;
> > #P fasten 9 0 2 0 84 201 75 201;
> > #P fasten 11 0 2 0 84 179 75 179;
> > #P fasten 17 0 2 0 159 204 75 204;
> > #P window clipboard copycount 26;
>
>

#92155

You must be logged in to reply to this topic.