Announcement

Collapse
No announcement yet.

Position problem (script help?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Position problem (script help?)

    I have a long narrow cylinder -a beam, basically. It pivots at it's base, moves around, and it changes size according to some controller stuff that I have going on.

    I want to attach a sphere to the middle of the beam, but this must stay in the middle of it while it changes length.

    Anyone have a clue how to solve this?

    Thanks!
    - Geoff

  • #2
    There are about 5 or 6 ways I can think to tackle this off the top of my head but I'm waiting on some monster renders so can't test any of them right now.

    I'd look at creating a couple of point helpers, aligning them to the top & bottom of the cylinder & then assigning a script controller to link them to one of the verts.

    Something like this:

    "in coordsys world getVert $Cylinder xxx"

    Where xxx is the number of the vert. Then assign a Pos Contraint controller to the Sphere & pick the two dummies as targets.

    If you need the sphere to rotate with the cylinder then you'll need to use a lookat in the rotation and point it toward one of the dummies.

    There is bound to be a more elegant solution than this but off the top of my head, it should work.

    Good luck!
    MDI Digital
    moonjam

    Comment


    • #3
      if the cylinder has its scale or length animated, rather than having the end vertices animated, you could use the attachment constraint, and pick a face in the centre of your cylinder. that should stick it to one place on the cylinder. maybe having a few length divisions on the cylinder might help with placement.. then when you scale or adjust length, the central faces should stay central, and therefore the sphere.

      Comment

      Working...
      X