ScriptSpot

Forum topic · General Scripting

Linking Spline Knots

By W DIGITAL · 2010-10-16

Description

Hi, i was wondering if it is possible to link spline knots to objects or dummy helpers? I know one can bake spline knots to an object or particle position, but is it possible to run a script so they are linked? That would lead to the effect that the spline would be controlled by helper objects in realtime, and not neeing to be baked..

Any help is appreciated, just need to know if its possible-

Thanks!

Comments (7)

Poker · 2010-11-20

also you could skin the spline to some helpers, if you need more control over the "deformation"

Hey

JokerMartini · 2010-11-16

Yeah you can do this very simple in max. You using the SplineIK Control which links any number of knots that you want to helpers.

W DIGITAL · 2010-11-17

hey,
but thats the other way around as i understand it,
doesnt create a spline linked to the objects i already have, or?

Poker · 2010-10-23

if I understand the problem probably then you could also just use Spline IK modifier.

decon · 2010-10-22

maybe something like this:

(
 -- add a dummy
 mydummy = dummy pos:[0,0,0] name: (uniqueName "myDummy")
 
 -- draw a line
 myspline = splineShape name: (uniqueName "mySpline") wirecolor:(color 255 0 0)
 addnewspline myspline
 addknot myspline 1 #corner #curve [-20,0,0]
 addknot myspline 1 #smooth #curve [0,0,0]
 addknot myspline 1 #corner #line [20,0,0]
 
 -- make controllers
 for i = 1 to (3*(numKnots myspline)) do
 (
   animatevertex myspline (i)
 )
 updateshape myspline

 -- change controller type
 myspline[#Object__Editable_Spline][#Master][5].controller = Point3_XYZ()
 
 -- assign controller
 dCntX = mydummy.position.controller[1].controller
 dCntY = mydummy.position.controller[2].controller
 dCntZ = mydummy.position.controller[3].controller
 
 myspline[#Object__Editable_Spline][#Master][5].controller[1].controller = dCntX
 myspline[#Object__Editable_Spline][#Master][5].controller[2].controller = dCntY
 myspline[#Object__Editable_Spline][#Master][5].controller[3].controller = dCntZ
 
-- testing
 test = false
 if test do
 (
  startframe = animationRange.start
  endframe = animationRange.end
  for t = startframe to endframe do
  (
   animate on
   (
    at time t
    (
     mydummy.position.y = random 0 20
    )
   )
  )
 )
)

W DIGITAL · 2010-10-20

thanks, thats great, but i need a solution for hundreds of objects:)
but maybe anubis has found the solution

decon · 2010-10-16

Just select vertex (via Splineselect) and add Linked XForm mod.

Cheers,
d