4
$\begingroup$

I want to make an object move along the vertex of another object. I converted the object into a path and used a follow path, but I didn't move along the vertex and moved along the edge, so I couldn't get the movement I wanted. How can we make it move only along with the vertex?

enter image description here

This is what I want to make.

enter image description here

And This is something I've tried, but I don't want to.

$\endgroup$
1
  • $\begingroup$ Just ocurred to me, in case of a cube the length of the animation can probably be adjusted so that all frames happen to catch the sphere at the corners... $\endgroup$ Nov 27 '21 at 2:25
5
$\begingroup$

With animation nodes it is sooooo easy :)

Use this node setup:

enter image description here

With the B value you can vary your speed.

Result:

enter image description here

Note: The advantage of this solution is: Just add two other objects, choose these two objects in the node tree and you are good to go. No extra work. I appreciate the other solutions...but they are a lot of work...

$\endgroup$
2
  • 1
    $\begingroup$ Nice! I never learned animation nodes, wondering if maybe it's time to do that... $\endgroup$ Nov 27 '21 at 9:45
  • 1
    $\begingroup$ @MarkusvonBroady: I just can say from my experience: it is just awesome. One of top 5 add-ons for Blender at all - in my opinion. I just know 5% of it (and 0.1% of Blender) but this is already blowing my mind!!!! Watch the Showreels for it...youtube.com/watch?v=UB8R_xPpaSc ...if you aren't falling in love with it...i cannot help you. Jacques is a fucking genius. And by the way...that guy is now co-developing geometry nodes...so, i think, there is a lot to come... $\endgroup$
    – Chris
    Nov 27 '21 at 9:48
6
$\begingroup$

Give the object a shrinkwrap constraint. Target object with the vertices you want to follow. Set the shrinkwrap constraint to "nearest vertex". Move and keyframe the object; you'll see that it snaps to the nearest vertex of the object you've designated.

enter image description here

$\endgroup$
5
$\begingroup$

It's a hacky solution, it relies on the order in which modifiers are evaluated, and it produces an error for the first vertex...

Name your Cube Main. ShiftD duplicate it. Hide Main and name the copy Instancer. Tab and in Edit Mode select everything if it's not selected already, X Delete, O Only Edges and Faces. Add a vertex group and assign all vertices to it. Tab in Object Mode add Build modifier, set its length to the number of vertices (8 for a cube) and set scene's frame end to the same number.

AltD to make a linked copy of the Instancer. Name the copy Mask and hide it. Select the Instancer again, set Build's modifier starting frame to 0. Add Vertex Weight Proximity modifier, set the vertex group, the target to Mask and Proximity Mode to Geometry. Add Mask modifier and set the vertex group.

In Object Properties > Instancing choose Vertices. Create a UV Sphere and parent it to the Instancer. Hide the Instancer and unhide Main. In the outliner, disable rendering of all currently hidden objects.

One corner is being missed... A workaround: select Instancer Tab for Edit Mode, AA to deselect all, CtrlRight Click to create a new vertex, menu Mesh > Sort Elements > Selected to put it in front, also increase the Build modifiers lengths by 1 (to 9 in case of the cube) and decrease their start by 1 (to -1 and 0).

Replacing with a more complex object is surprisingly easy: delete Main, insert the new object (I added Suzanne), select Instancer, in Object Data Properties switch the mesh to the new Main's mesh, make a single-user copy, remove edges and faces, add a vertex, move it in front, use statistics to count vertices, update the Build Modifiers length and scene.frame_end, change Mask's mesh to the same the Instancer uses. Done.

$\endgroup$
1
  • 1
    $\begingroup$ Man...you are just toooo intelligent. You missed the easy solutions :) +1 but i love hacky... ;) $\endgroup$
    – Chris
    Nov 27 '21 at 9:31
2
$\begingroup$

The way I would do that is by giving a keyframe for each location by snapping the sphere to the cube vertices in the viewport.

Then on the Timeline from the animation menu selecting all the keyframes pressing T and setting the interpolation to Constant.

Also here is the blend file:

$\endgroup$

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.