Kevin Camp
Forum Replies Created
-
Kevin Camp
November 6, 2013 at 8:05 pm in reply to: Instantiating a color via expressions: possible?your rgb values need to be in values 0-1 rather than 0-255. so if you want to stick with entering 0-255 values you just need to divide that array by 255…
var myColor = rgbToHsl([159,27,41,255]/255);note, i did assume that you wante the alpha component to be full (255) not 1. if i guessed wrong, change the alpha back to 1.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
November 4, 2013 at 11:14 pm in reply to: Switching Effects on & off by a Checkbox controlleri think i’d definitely put this into one expression on one fill layer…
instead of color = [rgb-array-for-reds]
red = [rgb-array-for-red]
green = [rgb-array-for-green]
etc…then use something to control which rgb array is used. if or elseif statements linked to a slider value would work well if you need to keyframe the slider to change…
layer markers or layer marker comments could be another way to drive the selection.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
to create the type on effect, you can use an expression like this on the source text property:
rate = 10; // value in characters per second
txt = text.sourceText;
txt.substr(0,Math.min(txt.length,Math.floor(time*rate)));set the rate value as needed.
then for position try this expression:
offset = 100; // value in pixels
returns = text.sourceText.split('\r').length - 1;
value - [0, returns * offset]you’ll need to adjust the offset value based on the size and line spacing of the text used.
the expression looks for returns (‘/r’) to advance the text, so you will need to use hard returns for each new line when you type the text.
=====EDIT==========
you can make your life easier by manually setting the leading in the character palette, then use that value as the offset.Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
November 4, 2013 at 9:35 pm in reply to: Particle playground wall and layer map (ANSWERED)the particle size when using the layer map, should be the size of the the layer being used as a layer map. so you want your strawberry to fill that layer as much as possible, touching each edge if possible.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
October 31, 2013 at 9:33 pm in reply to: Random Number Counter with expression slider not pass zeroclamp() would also work here…
w = wiggle(1,50);
clamp(w,0,99)Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
October 31, 2013 at 9:23 pm in reply to: weird problem with velocity and keyframes on every frameyou could try velocityAtTime() to pull the velocity between keys… something like this:
thisLayer.position.velocityAtTime(time-thisComp.frameDuration/2)[0]
the only other thing i can think of is that the velocity is negative, and getting clamped to zero since opacity can’t be negative… though the graph doesn’t support that.to test, you could try this:
Math.abs(position.velocity[0])
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
it could also be that the brush spacing value is very low, forcing the effect to draw more dots than it needs.
you could try to increase the spacing until the line starts to break up into a string of dots.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
October 30, 2013 at 11:35 pm in reply to: weird problem with velocity and keyframes on every framewhat type of keyframe does newton generate?
if it creates hold keyframes or ease keyframes. then to velocity at each keyframe would be 0.
if that’s the case, try converting those keyframes to linear (animation>keyframe interpolation, set temporal interpolation to ‘linear’)
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
to see if the expression is causing the issue, try converting the expression to keyframes (animation>keyframe assistant>convert expression to keyframes).
it won’t delete the expression, just disable the expression, so if you need it back just re-enable the expression (click the ≠).
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Kevin Camp
October 28, 2013 at 6:44 pm in reply to: Random Number Counter with expression slider not pass zeroMath.min() and Math.max() need two values (unless they assume zero as one value if only one value is present).
so for your first expression you’d want something like this:
w = wiggle(1,50);
Math.max(0,w)you’d use Math.max() since you want it to return zero if w is less than zero.
to values to a range (0-99), you’d use both Math.min() and Math.max(), and you can embed one inside the other:
w = wiggle(1,50);
Math.max(0,Math.min(99,w))Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW