if (do_name() != 'Home') : ?>
endif ?>
Posted by Josh Caswell on Dec 28, 2009
Jimmy,
I haven't tried NB2 yet, so I don't know exactly where you would plug this in, however, there's a function called range that will give you various lists of numbers.
Some examples:
>>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(0, 10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(7, 20) [ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] >>> range(-10, 10) [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(0, 10, 2) [0, 2, 4, 6, 8] >>> range(-20, 0, 4) [-20, -16, -12, -8, -4] >>> range(20, 200, 10) [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190] >>> range(200, 20, -10) [200, 190, 180, 170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70, 60, 50, 40, 30] >>> range(200, 20, 10) [] >>> range(10, -10) [] >>> range(10, -10, -1) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9] The basics of this are: if you give range 1 argument, it counts from 0 until that number (the argument is the upper limit; notice that range(10) gives you the numbers up to 9). If you give range 2 arguments, it counts up from the first until the second in the same way. If you give it three arguments, the first is the starting point, the second the upper limit, and the third is the "step"; instead of just counting by 1's you can count by 2's or 3's or whatever you want. By giving a negative step, you can count down from a first argument to a smaller second argument. Hope that's helpful to you!
Posted by Josh Caswell on Dec 28, 2009
Hope that's helpful to you!
(Boy, I wish this forum had a preview button!)
Jimmy,
I haven't tried NB2 yet, so I don't know exactly where you would plug this in, however, there's a function called range that will give you various lists of numbers.
Some examples:
>>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(0, 10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(7, 20) [ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] >>> range(-10, 10) [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(0, 10, 2) [0, 2, 4, 6, 8] >>> range(-20, 0, 4) [-20, -16, -12, -8, -4] >>> range(20, 200, 10) [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190] >>> range(200, 20, -10) [200, 190, 180, 170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70, 60, 50, 40, 30] >>> range(200, 20, 10) [] >>> range(10, -10) [] >>> range(10, -10, -1) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9]The basics of this are: if you give range 1 argument, it counts from 0 until that number (the argument is the upper limit; notice that range(10) gives you the numbers up to 9). If you give range 2 arguments, it counts up from the first until the second in the same way. If you give it three arguments, the first is the starting point, the second the upper limit, and the third is the "step"; instead of just counting by 1's you can count by 2's or 3's or whatever you want. By giving a negative step, you can count down from a first argument to a smaller second argument.
Hope that's helpful to you!
Posted by Josh Caswell on Dec 28, 2009
include("util/comment.php"); ?>
Note that the result lists in my post above are cut off, but if you use python in Terminal, you can easily try things for yourself.
Newbie Question: Number
Posted by Jimmy Gunawan on Dec 25, 2009It's me again. I am trying to get some kind of value order and play around with the stamping.
So far, I only understand the basic that:
CNUM in stamping means 0,1,2,3,4,5,6,7,8....and so on.
What if I wanted to get value that goes like this:
..., -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, ....
Or perhaps SIN/COS kind of way?
I actually tried % (modulus), plugged into variable for stamping, for example:
CNUM%5
This gives stamping like: 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3... maybe not exactly correct, but it does show the result.
CNUM%10 - 5
Gives an interesting result like a wave pattern. Maybe this is what I could use to get: -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5.
I wonder if there is a better way to create repeating pattern of value. At the moment I could think of this kind of thing in term of gradient. I don't think there is a node that does this yet. Maybe in the future, there will be gradient node that could plug the value easily into parameter of other node?
So, in short, my question is: What kind of Math expression could be used for creating random value in variable, in relation to stamping? Is there a reference or library page that could help with this?
In the way, this would easily relates to FRAME or TIME.
Thank you.