Holes in the skin modifier

I spent all of today trying to find solutions to the holes that can appear around branch vertices in the skin modifier. These holes have been a constant pain since I first started work on the modifier; I’ve sunk a lot of time trying to find solutions but with limited success. Automated merging around branches has helped, but it doesn’t address the core problem.

The problem itself is easy to describe: the polygons around branch nodes are created by generating a convex hull around all connected limb bases (the base of a limb is a frame, which is just four vertices arranged in a square.) Holes appear when one or more frame vertices is inside the convex hull. Holes also arise when one or more frame edges is not part of the convex hull (which can happen even if the edge’s endpoints are not inside the hull.)

The goal is to produce a manifold mesh, and the output should have the same general connectivity as the input (i.e. each set of connected vertices in the input should generate a nice manifold connected output.)

There are a number of possible approaches: more aggressive vertex merging, 3D intersection tests to cut holes in the hull, calculating geodesic shortest paths between hull verts to fix interior edges, reassignment of polygon loops to fix detached vertices, connecting limb bases to nearest existing polygon, and so on.

About the only concrete change I finished today was to convert the skin generation to BMesh. In and of itself, that doesn’t change much except to slow down skin calculation slightly, but it makes it much easier to experiment with topological manipulation. With so many possible input cases to deal with though, I’m not at all sure whether a good solution will be forthcoming from all this experimentation. Will probably give it at least another day though before going back to more “practical” coding.

Wire overlay for editmode

Example of wire overlay with skin and subsurf modifiers.

Some more updates for the skin modifier:

  • The “Wire” option in object draw properties now works in Edit Mode. A light wireframe is blended over solid mode when enabled.
  • Automatic weights have been improved a bit, long limbs should now bend less (avoiding “loopy” deformation.)
  • Generating armature now takes object transformation into account.


Recent skin modifier updates

New skin modifier UI options

Summary of recent changes for the skin modifier:

  • Simplified root-node marking. Rather than having to manually clear roots if there’s more than one in a tree, simply select the vertex you want to be root and click “Mark Roots”.
  • Generating an armature from skin will now automatically add an armature modifier too, so you can start posing immediately.
  • Constructive modifiers above skin modifier work better now; skin roots draw correctly (see for example mirror modifier.)
  • Improved quad generation for branch nodes, avoids merging triangles when the resulting quad would be non-symmetric.
  • Added RNA/UI for symmetric axis (X, Y, or Z).
  • Fix vertex merging, was sometimes creating weird polygons attached to vertex zero.
  • The usual set of code cleanups and minor bug fixes.

And thanks as always to the folks providing feedback!

Sculpt masking, last looks

The sculpt masking code is now finished-ish. I’ve just completed my own review of the code, checking each commit and fixing various bugs.

I’ll be submitting it for code review soon (no rush since it won’t be going into trunk until the start of the 2.64 release cycle), but before I do there’s time for more user testing. No doubt there are still bugs there just waiting for you to find them! Check also the masking documentation on the wiki in case there is anything missing there.

The code is as always available from the masking branch of my github repository. Post builds on GraphicAll if you got ’em.

Builds update:

Continue reading Sculpt masking, last looks

Blender coding: version control

Workflow Introduction

Recently there was a call for Blender development videos to help new developers find their way into Blender development. I think this is a good idea, and I might participate with videos at some point. For many purposes though, text is an easier way to convey this kind of workflow information. This is the first in what might be a series of posts describing some of my own development style. The information in this post is not necessarily very in-depth; you’ll want to make good use of Google if you aren’t familiar with some of the underlying concepts. That said, feel free to ask any questions in the comments.

Continue reading Blender coding: version control

Quick github reminder

As posted here a week ago, I am now using github to publish my work-in-progress code. Currently there are two branches of interest there: sculpt masking and the skin modifier. When I make larger changes (such as the recent skin-modifier work) I usually post here, but I am actually updating the branches fairly frequently at this point, at minimum pulling in the latest updates from trunk, as well as bugfixes. So if you are interested in making experimental builds, no need to wait for a post here, just watch the blender-bishop repository on github.

I’ve just pushed some updates to the masking branch (fixing an undo crash and increasing the mask brush strength.) I also want to point out the nice new mask brush icon contributed by Julio Iglesias.

Armature extraction for skin modifier

An armature generated from a mesh with the skin modifier.

As promised the skin modifier has returned. I’m overall pleased with our detour into armature-land, I think we all have a much clearer idea of what the direction of the tools should be.

Coming at this problem from the other side now, I’ve added an operator to convert the mesh structure into an armature and generate the appropriate vertex groups. You can then add an armature modifier and pose the skinned mesh.
Continue reading Armature extraction for skin modifier

Improvement for clay strips falloff

Just committed r45110 – “Better smoothing for sculpt cube falloff.”

This is a relatively small change that makes the brush falloff curve work better with clay strips. Clay strips uses a cube-shaped brush; at full strength it looks like the top-left brush stroke in the image. The brush curve can now be used to smooth it without losing the “cubishness” of the stroke.

The first stroke in the second row shows what clay strips now looks like with the default brush curve.