View Full Version : animating gradient ramp
Hello, from what I have read so far throughout this thread it is not possible to animate the Flag__x position of a gradient ramp with maxscript. Is that accurate?
|
|
Hello, from what I have read so far throughout this thread it is not possible to animate the Flag__x position of a gradient ramp with maxscript. Is that accurate?
Not true. You can animate the position of existing flags (starting with flag 3 which is not at the end of the gradient), but the creation of new flags is problematic.
Here is an example:
theTeapot = teapot() --create a teapot
theMat = standard() --create a material
theMap = Gradient_Ramp() --create a gradient
theMat.diffusemap = theMap --assign the gradient as diffuse
theTeapot.material = theMat --assign the material to the teapot
meditMaterials[1] = theMat --show the material in MEdit slot 1
--Animate the Position of the 3rd flag on frame 100 to 70 and the color to red
with animate on at time 100
(
theMap.Gradient_Ramp.Flag__3.position = 70
theMap.Gradient_Ramp.Flag__3.color = red
)
showTextureMap theMat theMap true --display in viewports
ahhh, thanks Bobo. I was doing all my testing on flags 1 and 2
q.Gradient_Ramp.flag__1.position = [0,50,0]
-- Unknown property: "position" in ReferenceTarget:ReferenceTarget
thanks a lot!
edit: The integer must be a percentage. I have a "wave" modifier moving across a plane and would like the gradient ramp flags to follow it's position which I am getting with:
with animate on ( at time 60 ( w.gizmo.pos.y = a.max[2] ))
with animate on ( at time 1 ( w.gizmo.pos.y = a.min[2] ))
so, to make sure the texture wiping on stays with the curve of the wave, I need to find the percentage of the keyframe relative to length of the wave animation....I think. Maybe that is for another thread though. :)
CGTalk Moderation
07-14-2011, 09:34 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.