Notifications
Clear all

[Closed] Wire cylinder height to path length

I have a cylinder deformed by path deform.
Path is animated (it’s length is changing)
How can I wire cylinder height to path length?

2 Replies
1 Reply
(@gazybara)
Joined: 1 year ago

Posts: 0

Try this and move selected knot


 delete objects
 obj = Cylinder smooth:on heightsegs:1 capsegs:1 sides:18 height:50 radius:20 pos:[0,50,0] wirecolor:green
 spl = splineShape render_renderable:on render_displayRenderMesh:on wirecolor:yellow
 addNewSpline spl
 addKnot spl 1 #corner #line [0,0,0]
 addKnot spl 1 #corner #line [0,0,100]
 updateshape spl
 ctrl = obj[4][2].track = float_script () -- or obj.height.controller instead of obj[4][2].track
 ctrl.AddObject "spline" spl
 ctrl.script = "curvelength spline"
 select spl ; setKnotSelection spl 1 #(2)
 max modify mode ; subobjectLevel = 1
 

Very impressive! Thank you very much. You have helped me a lot.