0

How would one go about attaching instances of a mesh to the ends of a bunch of bezier curves? Basically, I am modelling some cables, which should be terminated by ring terminals, and I'm looking for a low maintenance solution for adding these. Ideally, I only want one mesh defining the terminals' appearance, and these should align automatically with the direction of the vertices they're attached to.

Ola Tuvesson
  • 103
  • 5
  • 4
  • Related https://blender.stackexchange.com/questions/55302/rounded-caps-on-a-bezier-curve-pipe – Duarte Farrajota Ramos Jun 05 '18 at 11:27
  • 1
    @Duarte If there are lots of cable, this is not a low maintenance solution since every hook has to be placed by hand, right? – Leander Jun 05 '18 at 11:48
  • Its not very low maintenance on an absolute scale, but it is the lowest I could think of, if you set it up once then duplicate one instance. Not sure if this could be grouped and instaced from a dupligroup with an armature controlling the hooks – Duarte Farrajota Ramos Jun 05 '18 at 12:19
  • Thanks guys - I do have lots of cables (well, 20-30 or so), so I was hoping for some kind of inheritable method. Still, it's not so many that I couldn't "hook" them individually, given enough coffee :) – Ola Tuvesson Jun 05 '18 at 18:46
  • Makes me think, this would perhaps be a pretty useful "modifier"; one that allows you to select one or two objects to place at either or both ends of a curve, perhaps with transformations. Great for arrowheads, connectors and that sort of thing (or even snakes!). Most 2D vector drawing programs I've used have similar functions. Shame I'm not too hot on C++. Or would this type of add-on typically be written in Python? – Ola Tuvesson Jun 05 '18 at 18:51

1 Answers1

3

With the add-on Animation Nodes you can create copys of objects and automatically place them at specific locations.

result

The node setup shown below loops over all objects in a group with the cables in it.

  • The first loop “Get Splines” returns a list of all splines in the objects.
  • For every spline an instance of the desired object is created.
  • The second loop “Place Objects” evaluates each spline at the end (Parameter 1.00) and calculates location, tangent and normal. Parameter 0.0 would evaluate the spline at the start but then you will also have to mirror the tangent vector.
  • The tangent and normal are used to calculate the rotation angle for the object. You might want to replace the Guide with a random vector instead of using the spline's normal so that the terminals' orientation is more realistic.

node setup

binweg
  • 2,701
  • 1
  • 14
  • 17