sabato 25 luglio 2015
venerdì 26 giugno 2015
MEL scripting - array decreasing procedure with random selection
I'm sharing a small algorithm I developed for the last production I've been working on. I needed to randomly select characters in a scene and assign a value, but I wanted to avoid to occasionally select twice the same character.
This procedure randomly select an element in an array and delete it so that the array size decrease until all elements are gone and the array is empty.
--
proc randDecreasArray(){
string $arr[] = {"a","b","c","d","e","f","g"};
string $nwArr[] = $arr;
int $sz = size($arr);
int $rm = $sz;
$prntArr = stringArrayToString($arr, ".");
print ($prntArr + "\n");
for ($i in $arr){
int $rnd = rand(0, $rm);
$nwArr = stringArrayRemove ({$nwArr[$rnd]},$nwArr);
$rm --;
$prnt = stringArrayToString($nwArr, ".");
print ($prnt + "\n");
}
}
randDecreasArray()
This procedure randomly select an element in an array and delete it so that the array size decrease until all elements are gone and the array is empty.
--
proc randDecreasArray(){
string $arr[] = {"a","b","c","d","e","f","g"};
string $nwArr[] = $arr;
int $sz = size($arr);
int $rm = $sz;
$prntArr = stringArrayToString($arr, ".");
print ($prntArr + "\n");
for ($i in $arr){
int $rnd = rand(0, $rm);
$nwArr = stringArrayRemove ({$nwArr[$rnd]},$nwArr);
$rm --;
$prnt = stringArrayToString($nwArr, ".");
print ($prnt + "\n");
}
}
randDecreasArray()
--
cheers
f.
domenica 15 febbraio 2015
2014 film reel
.
Reel
total time - 02:05
@ 00:05 Charlie and Chocolate Factory - keyframe animation
@ 00:14 Iron Man 2 - rigging & animation
@ 00:24 X Men iii - animation & rotomation
@ 00:50 King Arthur - ice breaking animation & camera + crowd agents setup
@ 01:15 10.000 BC - keyframe cycles animation & shot creation
@ 01:33 Iron Man 3 - animation, rigging & rotomation
@ 01:53 Harry Potter 4 - keyframe animation
@ 00:05 Charlie and Chocolate Factory - keyframe animation
@ 00:14 Iron Man 2 - rigging & animation
@ 00:24 X Men iii - animation & rotomation
@ 00:50 King Arthur - ice breaking animation & camera + crowd agents setup
@ 01:15 10.000 BC - keyframe cycles animation & shot creation
@ 01:33 Iron Man 3 - animation, rigging & rotomation
@ 01:53 Harry Potter 4 - keyframe animation
My
filmography also include (not in this reel):
Aardman's Pirates - previz artist (first act sequence)
The Day the Earth Stood Still - previz artist (spaceship landind sequence + final sequence)
The Day the Earth Stood Still - previz artist (spaceship landind sequence + final sequence)
.
lunedì 9 febbraio 2015
Iscriviti a:
Post (Atom)