Mask from a matrix

Mar 5, 2008 at 3:26pm

Mask from a matrix

Hi everybody

i wonder why i can’t use a matrix as mask. Look the patch below. Based on the tutorial 29 i modified the idea and realised that using a matrix as mask is not possible! is it?

I appreciate any suggestion that helps me understand

Demi

#P button 515 470 15 0;
#P user gswitch 515 504 41 32 0 0;
#P user jit.pwindow 601 375 82 62 1 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 688 368 100 196617 Mask “two”;
#P number 448 283 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 448 329 76 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 448 307 87 196617 zmap 0 10 0 256;
#P newex 496 229 27 196617 -;
#P message 448 231 43 196617 size $1;
#P user hslider 448 259 18 128 3216 1 0 0;
#P window setfont “Sans Serif” 14.;
#P comment 458 106 157 196622 Pixel Generator;
#P window setfont “Sans Serif” 9.;
#P newex 602 346 66 196617 jit.rgb2luma;
#P number 791 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 753 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 753 271 48 196617 pack 0 0;
#P message 753 292 56 196617 dim $1 $2;
#P message 806 112 20 196617 $1;
#B color 13;
#P message 265 226 30 196617 read;
#P newex 222 249 63 196617 jit.qt.movie;
#P window setfont “Sans Serif” 10.;
#P newex 514 540 59 196618 s maskque;
#B color 4;
#P user jit.pwindow 221 311 82 62 0 1 0 0 1 0;
#P user jit.pwindow 76 309 82 62 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P message 654 137 62 196617 0 , $1 1000;
#B color 13;
#P newex 654 154 71 196617 line 0 4 1000;
#B color 13;
#P window setfont “Sans Serif” 10.;
#P newex 5 218 60 196618 r maskque;
#B color 4;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 67 218 26 1441802 t b;
#P window setfont “Sans Serif” 9.;
#P newex 222 274 66 196617 jit.rgb2luma;
#P number 726 180 35 9 0 0 0 3 0 0 0 153 102 153 222 222 222 0 0 0;
#P newex 618 206 157 196617 pack 0 0 0 0 0;
#B color 13;
#P number 654 180 28 9 0 0 0 3 0 0 0 153 102 153 222 222 222 0 0 0;
#P number 690 180 28 9 0 0 0 3 0 0 0 153 102 153 222 222 222 0 0 0;
#P message 618 228 162 196617 setcell $2 $3 $4 val 0 $1 $1 $1;
#B color 13;
#P newex 602 320 117 196617 jit.matrix 4 char 12 12;
#B color 13;
#P number 518 196 55 9 0 0 0 3 0 0 0 153 102 153 222 222 222 0 0 0;
#P number 119 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 448 197 63 9 0 0 0 3 0 0 0 153 102 153 222 222 222 0 0 0;
#P newex 448 168 150 196617 route duration time;
#B color 13;
#P message 382 109 61 196617 getduration;
#P number 324 90 35 9 0 2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 324 109 41 196617 loop $1;
#P newex 77 244 53 196617 jit.pack;
#P newex 77 189 66 196617 jit.unpack;
#P user jit.pwindow 322 445 82 62 0 1 0 0 1 0;
#P user jit.pwindow 240 445 82 62 0 1 0 0 1 0;
#P user jit.pwindow 158 445 82 62 0 1 0 0 1 0;
#P user jit.pwindow 76 445 82 62 0 1 0 0 1 0;
#P newex 77 410 340 196617 jit.scissors @rows 1 @columns 4;
#P message 135 110 30 196617 read;
#P newex 77 145 105 196617 jit.qt.movie 320 240;
#P toggle 77 79 15 0;
#P newex 77 108 52 196617 metro 20;
#P message 373 88 44 196617 gettime;
#P newex 758 136 58 196617 random 12;
#B color 13;
#P hidden newex 78 55 106 196617 bgcolor 230 235 190;
#P window linecount 4;
#P comment 494 367 100 196617 How do i convert the matrix-Object , so that i can use it as mask?;
#P user panel 445 99 399 400;
#X brgb 241 208 206;
#X frgb 0 0 0;
#X border 0;
#X rounded 30;
#X shadow 0;
#X done;
#P window setfont “Fixedwidth Serif” 10.;
#P window linecount 1;
#P newex 77 274 112 1441802 jit.alphablend;
#B color 5;
#P window setfont “Sans Serif” 9.;
#P comment 315 313 100 196617 Mask “one”;
#P fasten 41 0 35 0 811 130 659 130;
#P connect 41 0 5 1;
#P connect 44 0 43 0;
#P fasten 44 0 41 0 758 269 837 269 837 105 811 105;
#P connect 45 0 43 1;
#P hidden connect 7 0 9 0;
#P fasten 7 0 39 0 82 129 227 129;
#P fasten 7 0 6 0 82 128 306 128 306 73 378 73;
#P fasten 7 0 20 0 82 133 307 133 307 74 367 74 367 109;
#P fasten 7 0 25 0 82 131 607 131;
#P fasten 7 0 5 0 82 130 763 130;
#P connect 43 0 42 0;
#P connect 30 0 29 3;
#P connect 27 0 29 2;
#P fasten 5 0 27 0 763 177 695 177;
#P connect 28 0 29 1;
#P connect 34 0 28 0;
#P connect 35 0 34 0;
#P fasten 34 1 35 0 720 174 730 174 730 129 659 129;
#P connect 29 0 26 0;
#P fasten 52 0 29 0 453 350 595 350 595 198 623 198;
#P connect 46 0 55 0;
#P connect 25 0 46 0;
#P fasten 26 0 25 0 623 252 607 252;
#P fasten 42 0 25 0 758 309 607 309;
#P connect 55 0 56 2;
#P connect 37 0 56 1;
#P connect 21 1 24 0;
#P connect 57 0 56 0;
#P connect 56 0 38 0;
#P fasten 24 0 50 1 523 220 518 220;
#P connect 22 0 49 0;
#P connect 22 0 51 2;
#P fasten 22 0 50 0 453 220 501 220;
#P connect 51 0 52 0;
#P connect 53 0 51 0;
#P connect 48 0 53 0;
#P connect 49 0 48 0;
#P fasten 50 0 48 0 501 252 453 252;
#P connect 21 0 22 0;
#P fasten 9 1 21 0 177 165 453 165;
#P hidden connect 19 0 18 0;
#P connect 11 3 15 0;
#P connect 11 2 14 0;
#P connect 31 0 37 0;
#P connect 39 0 31 0;
#P fasten 40 0 39 0 270 245 227 245;
#P connect 11 1 13 0;
#P connect 16 3 17 3;
#P connect 23 0 7 1;
#P connect 16 2 17 2;
#P connect 16 1 17 1;
#P connect 11 0 12 0;
#P connect 36 0 11 0;
#P connect 1 0 36 0;
#P connect 17 0 1 0;
#P connect 32 0 17 0;
#P connect 33 0 17 0;
#P connect 9 0 16 0;
#P fasten 6 0 9 0 378 133 82 133;
#P fasten 20 0 9 0 387 134 82 134;
#P hidden fasten 18 0 9 0 329 134 82 134;
#P hidden fasten 10 0 9 0 140 129 82 129;
#P connect 8 0 7 0;
#P connect 16 0 32 0;
#P window clipboard copycount 58;

#36197
Mar 5, 2008 at 3:52pm

#124065
Mar 5, 2008 at 5:35pm

#124066
Mar 5, 2008 at 7:22pm

Hi,

i send you 3 version they should explain my idea. The 3th is the one i’m interested in. is it possible to show the resulting video without any flickering?

thank you and
best regards
Demi

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 10 59 527 628;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 335 184 109 196617 jit.noise 4 char 40 30;
#P newex 60 280 20 196617 t b;
#P newex 335 213 66 196617 jit.rgb2luma;
#P newex 315 74 52 196617 metro 20;
#P toggle 315 50 15 0;
#P user jit.pwindow 334 234 82 62 0 1 0 0 1 0;
#P message 105 359 48 196617 mode $1;
#P message 122 339 14 196617 0;
#P message 105 339 14 196617 1;
#P newex 60 311 53 196617 jit.pack 4;
#P newex 60 243 66 196617 jit.unpack 4;
#P user jit.pwindow 59 421 82 62 0 1 0 0 1 0;
#P newex 60 388 132 196617 jit.alphablend;
#P message 243 77 30 196617 read;
#P user jit.pwindow 181 137 82 62 0 1 0 0 1 0;
#P newex 182 105 108 196617 jit.qt.movie 320 240;
#P newex 182 76 52 196617 metro 20;
#P toggle 182 52 15 0;
#P message 121 76 30 196617 read;
#P user jit.pwindow 59 136 82 62 0 1 0 0 1 0;
#P newex 60 104 108 196617 jit.qt.movie 320 240;
#P newex 60 75 52 196617 metro 20;
#P toggle 60 51 15 0;
#P window setfont “Arial Black” 14.;
#P comment 176 428 144 791478286 Third Version;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 176 457 100 196617 Stopping the flickr seams inpossible;
#P user panel 25 40 450 479;
#X brgb 255 255 255;
#X frgb 181 181 181;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 3 0 4 0;
#P connect 7 0 5 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 15 0;
#P connect 15 0 24 0;
#P connect 20 0 16 0;
#P connect 24 0 16 0;
#P fasten 19 0 13 0 110 386 65 386;
#P connect 16 0 13 0;
#P connect 13 0 14 0;
#P connect 15 1 16 1;
#P connect 15 2 16 2;
#P connect 15 3 16 3;
#P fasten 18 0 19 0 127 356 110 356;
#P connect 17 0 19 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 12 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 13 1;
#P connect 21 0 22 0;
#P connect 22 0 25 0;
#P connect 25 0 23 0;
#P connect 23 0 20 0;
#P pop;
#P newobj 36 198 77 196617 p third version;
#N vpatcher 10 59 525 621;
#P window setfont “Sans Serif” 9.;
#P newex 56 284 20 196617 t b;
#P newex 329 159 66 196617 jit.rgb2luma;
#P message 390 81 30 196617 read;
#P user jit.pwindow 328 181 82 62 0 1 0 0 1 0;
#P newex 329 109 108 196617 jit.qt.movie 320 240;
#P newex 329 80 52 196617 metro 20;
#P toggle 329 56 15 0;
#P message 101 363 48 196617 mode $1;
#P message 118 343 14 196617 0;
#P message 101 343 14 196617 1;
#P newex 56 315 53 196617 jit.pack 4;
#P newex 56 247 66 196617 jit.unpack 4;
#P user jit.pwindow 55 425 82 62 0 1 0 0 1 0;
#P newex 56 392 132 196617 jit.alphablend;
#P message 239 81 30 196617 read;
#P user jit.pwindow 177 141 82 62 0 1 0 0 1 0;
#P newex 178 109 108 196617 jit.qt.movie 320 240;
#P newex 178 80 52 196617 metro 20;
#P toggle 178 56 15 0;
#P message 117 80 30 196617 read;
#P user jit.pwindow 55 140 82 62 0 1 0 0 1 0;
#P newex 56 108 108 196617 jit.qt.movie 320 240;
#P newex 56 79 52 196617 metro 20;
#P toggle 56 55 15 0;
#P window setfont “Arial Black” 14.;
#P comment 172 432 144 791478286 Second version;
#P user panel 24 43 450 479;
#X brgb 255 255 255;
#X frgb 181 181 181;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 6 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 14 0;
#P connect 14 0 25 0;
#P connect 22 0 15 0;
#P connect 25 0 15 0;
#P connect 15 0 12 0;
#P fasten 18 0 12 0 106 390 61 390;
#P connect 12 0 13 0;
#P connect 14 1 15 1;
#P connect 14 2 15 2;
#P connect 14 3 15 3;
#P connect 16 0 18 0;
#P fasten 17 0 18 0 123 360 106 360;
#P connect 7 0 8 0;
#P connect 11 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P fasten 10 0 12 1 183 297 183 297;
#P connect 19 0 20 0;
#P connect 20 0 21 0;
#P connect 23 0 21 0;
#P connect 21 0 24 0;
#P connect 24 0 22 0;
#P pop;
#P newobj 36 124 85 196617 p second version;
#N vpatcher 436 185 743 744;
#P window setfont “Sans Serif” 9.;
#P message 99 373 48 196617 mode $1;
#P message 116 353 14 196617 0;
#P message 99 353 14 196617 1;
#P newex 28 353 53 196617 jit.pack 4;
#P newex 28 257 66 196617 jit.unpack 4;
#P user jit.pwindow 27 435 82 62 0 1 0 0 1 0;
#P newex 28 402 132 196617 jit.alphablend;
#P message 211 91 30 196617 read;
#P user jit.pwindow 149 151 82 62 0 1 0 0 1 0;
#P newex 150 119 108 196617 jit.qt.movie 320 240;
#P newex 150 90 52 196617 metro 20;
#P toggle 150 66 15 0;
#P message 89 90 30 196617 read;
#P user jit.pwindow 27 150 82 62 0 1 0 0 1 0;
#P newex 28 118 108 196617 jit.qt.movie 320 240;
#P newex 28 89 52 196617 metro 20;
#P toggle 28 65 15 0;
#P window setfont “Arial Black” 14.;
#P comment 144 442 115 791478286 First version;
#P user panel 8 54 277 479;
#X brgb 255 255 255;
#X frgb 181 181 181;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 2 0 3 0;
#P connect 6 0 4 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 14 0;
#P connect 14 0 15 0;
#P fasten 18 0 12 0 104 400 33 400;
#P connect 15 0 12 0;
#P connect 12 0 13 0;
#P connect 14 1 15 1;
#P connect 14 2 15 2;
#P connect 14 3 15 3;
#P fasten 17 0 18 0 121 370 104 370;
#P connect 16 0 18 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 11 0 9 0;
#P connect 9 0 10 0;
#P fasten 10 0 12 1 155 307 155 307;
#P pop;
#P newobj 36 98 76 196617 p first version;
#P window linecount 4;
#P comment 165 98 100 196617 the first 2 versions play with the jit.qt.movie object as chanel mask;
#P window linecount 5;
#P comment 165 177 100 196617 this version tries to play with jit.noise matrix it does not work in this way , does it?;
#P window setfont “Sans Serif” 18.;
#P window linecount 1;
#P comment 34 40 267 196626 Question about Alpha Chanals;
#P window clipboard copycount 6;

#124067
Mar 5, 2008 at 7:27pm

try this:
(in response to your second patch)

#P toggle 405 122 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 405 144 52 196617 interp $1;
#P newex 293 174 129 196617 jit.matrix 1 char 320 240;
#P newex 68 102 40 196617 t b b b;
#P newex 178 173 108 196617 jit.qt.movie 320 240;
#P newex 67 290 70 196617 jit.alphablend;
#P user jit.pwindow 304 205 82 62 0 1 0 0 1 0;
#P newex 293 142 109 196617 jit.noise 1 char 12 12;
#P user jit.pwindow 66 323 322 242 0 1 0 0 1 0;
#P number 110 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 67 260 53 196617 jit.pack;
#P newex 67 205 66 196617 jit.unpack;
#P message 29 139 30 196617 read;
#P newex 67 173 108 196617 jit.qt.movie 320 240;
#P toggle 68 48 15 0;
#P newex 68 77 52 196617 metro 20;
#P fasten 3 0 2 0 34 165 72 165;
#P fasten 12 1 2 0 88 135 72 135;
#P connect 2 0 4 0;
#P fasten 13 0 5 0 298 245 72 245;
#P connect 5 0 10 0;
#P connect 10 0 7 0;
#P connect 1 0 0 0;
#P connect 0 0 12 0;
#P connect 4 1 5 1;
#P connect 4 2 5 2;
#P connect 4 3 5 3;
#P connect 6 0 0 1;
#P fasten 11 0 10 1 183 278 132 278;
#P fasten 3 0 11 0 34 165 183 165;
#P fasten 12 2 11 0 103 128 183 128;
#P fasten 12 0 8 0 73 132 298 132;
#P fasten 14 0 13 0 410 166 298 166;
#P connect 8 0 13 0;
#P connect 13 0 9 0;
#P connect 15 0 14 0;
#P window clipboard copycount 16;

#124068
Mar 5, 2008 at 7:31pm

my previous patch should answer the question regarding the flickering. look at my use of the trigger object, and exactly when the alpha mask is getting banged. order is important here (as in everything in max).

#124069
Mar 5, 2008 at 9:46pm

#124070
Mar 7, 2008 at 9:49am

Thanks to both of you. These are the solutions i was looking for. Especially the order of triggering bangs was important.

In my examples there was the first bang given to the jit.noise object. Did this cause the flickering (see 3th version of my last patch)? Meaning that two datastreams did “fight” for the place in jit.pwindow?

best wishes
Demi

#124071

You must be logged in to reply to this topic.