3
$\begingroup$

Is it possible to set a vertex's location to be relative to another?

For example, A-B-C; I want B to always be exactly halfway between A and C, so that if I move A or C, B moves to stay halfway.

Ideally, I could then move B, and the delta between old/new is preserved, so that if I move A/C, then B moves to halfway + delta changes.

$\endgroup$
  • $\begingroup$ Okay, the first part is just about scaling a line with A or C as center of operation... right ? Then I'm confused about the second part of the question; if it's supposed to stay in-between A and C then moving B should just move the whole line around. $\endgroup$ – Yvain Aug 1 '16 at 15:03
  • $\begingroup$ Static or Dynamic situation? Edit Mode operation or animation? Have you used Proportional Editing or Simple Scaling? $\endgroup$ – atomicbezierslinger Aug 1 '16 at 17:09
  • $\begingroup$ The first part is doable via mutantbob's solution. I'm pretty sure the second part is impossible to do exactly like that, though you could have another "fader-like" empty which controls the delta. $\endgroup$ – PGmath Aug 31 '16 at 20:55
2
$\begingroup$

There is a way to achieve this using three empties and two contraints. However it is only possible to manipulate the vertex positions in Object Mode, in Edit Mode it won't be possible for reasons I'll try to explain at the end of this answer.

The basic setup can be tested in this Blend File here:

As you can see, there are three Emties and a subdivided plane in there. First I created the Empties and snapped them to the vertex locations. Then, I added two Copy Location Object Constraints on the Center Empty. One copies the location of Empty A, the other one empty B. To make the Center Empty really centered between the two, set the Influence Parameter of the second constraint to 0.5

setup

Next, Hook the three vertices to the corresponding Empties. You can do this in Edit Mode using Hook to Selected. Now, if you change the value of the influence slider, the Empty Center slides towards Empty B or A, depending on the value:

slide empties

If you move A or B, this happens, while the sliding value still works:

moving sources

Making it dependant on Edit Mode position fails because of the way the Dependency Graph is evaluated. The current DepsGraph still works on an Object level, meaning if you move a vertex in Edit Mode, Blender is informed about a change of the Mesh object. Blender then would trigger an update cycle on it. Now, if that results in something, say an Empty, to be moved, and this Empty again had some kind of relationship via Drivers, Constraints, Vertex Parenting, whatnot, back to the Mesh object, this would mean that the Mesh object has to be updated AGAIN. This is not allowed, as that would trigger another evaluation cycle, and the game would go on forever. It's therefore called a 'Dependency Cycle' and has to be avoided at all cost.

$\endgroup$
0
$\begingroup$

My first instinct is to hook the point to an empty, and then let the empty's location have drivers that calculate the average of the coordinates of A and C. Constructing that driver requires some knowledge of python.

A related question is: What is causing A and C to move? Depending on the answer, there may be simpler solutions.

$\endgroup$
  • $\begingroup$ Ideally A or C could be moved by anything, hooks, bones, edit mode, and B would recalculate. $\endgroup$ – Karric Aug 2 '16 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.