2
$\begingroup$

Please consider the following animation:

enter image description here

It is created with the help of the screw modifier applied to a simple broken line shown here:

enter image description here

What I need, however, is for this broken line to start out and end up as a flat vertical line, so that the final model would look like this:

enter image description here

In other words, I need to animate the creation of a surface formed by the screw motion of a broken line that changes shape from a straight line to a broken line and to a straight line again.

Can this be done? Thanks in advance.

$\endgroup$
2
  • 3
    $\begingroup$ What about a boolean modifier to cut a fragment out of the beginning and end of the screw? $\endgroup$ Jun 12, 2021 at 17:16
  • $\begingroup$ or putting the screw inside a cube for Boolean instead, so the caps get filled? $\endgroup$
    – TheLabCat
    Jun 12, 2021 at 22:23

1 Answer 1

2
$\begingroup$

An array modifier allows to add caps, but you might as well manually position caps to your screw modifier and animate their visibility - which will only work if you're fine with the entire cap showing in a single frame. This is similar to the srew modifier, which makes entire segments appear suddenly.

An alternative is to add shape keys to the caps and animate them before (start cap) and after (end cap) the main screw animation. But it can be tricky to tweak the animations speed so the caps appear with consistent speed to the screw.

Yet another option is to apply the modifier, then flatten the ends of the screw, sort the faces from bottom of the screw to its top, and apply the Build modifier.

The problem is, if you use Mesh -> Sort Elements, you will get the effect like below on the left. You need to tell Blender to respect the connections of the faces. For that, add two shape keys (base and temporary), edit the mesh in the 2nd shape key (temporary), enable proportional editing with linear falloff (most falloffs probably work) and connected only enabled, select starting or ending edge and move it a lot (10000 m) to the side. Now sort elements horizontally. The shape keys can be removed or they can stay to e.g. re-sort after adding some loopcuts.

sort stretch, then sort python script

Remember to set the length of the build modifier to the number of faces divided by the number of faces per each segment. As you can see below, in my case that's 640/4 = 160:

As for the Python solution, select whole segment (column) at the start or end of the screw, then run the script below:

import bpy, bmesh

limit = 10_000  # protect from infinite loop if something goes wrong

me = bpy.context.active_object.data
bm = bmesh.from_edit_mesh(me)
previous = set()
current = {f for f in bm.faces if f.select}
stride = len(current)
for i in range(limit):
    for j, f in enumerate(current):
        f.index = i * stride + j
    neighbors = {n for f in current for e in f.edges for n in e.link_faces}
    next_faces = neighbors - current - previous
    if not next_faces:
        break
    previous, current = current, next_faces
bm.faces.sort()
bmesh.update_edit_mesh(me)
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .