Two new skin modifier features

Pushed a couple updates to the skin-modifier branch: output-face attributes and non-square skin limbs. These have both been frequently requested.

Example of material and shading for skin output.

The skin modifier UI now has a material selector. It shows all the material slots of the active object, and the selection will be used for all faces output by the skin modifier.

Similarly, all faces will be either flat-shaded or smooth-shaded depending on the selection made in the combo box.

Example of non-square skin limbs.

The second change, non-square limbs, means that you can now scale the X and Y axes of vertices independently. It uses the usual scaling mechanism, so pressing (for example) SKEY, XKEY will work as expected. Note that rotation is still entirely automatic, so you can’t choose the exact angle of a non-square limb, but should be OK for many cases.

Code is in the usual place.

Update: as suggested here, I’ve removed the material selection in favor of simply using the object’s first material slot.

More fun with git-svn

As mentioned here frequently, I have been using git-svn and a public repository on Github for Blender development. That Github repository has a couple limitations though: the history only goes back to January 2011 (which was when I first created the git-svn clone), and the commit author information is incorrect. The latter problem is due to the difference between the way SVN and Git store author data; in SVN it’s a plain username (e.g. “nicholasbishop” is my Blender committer username.) Git on the other hand typically uses a full name and email address. By default git-svn imports the username and makes up the email address (here’s an example from JesterKing’s repository on Gitorious.)

Fortunately, git-svn does provide a way to map from svn committers to git committers in the form of an authors file. Probably you could use clever git commands to edit the existing Gitorious clone and fix commit author data, but since I am lazy I just re-cloned Blender’s trunk last night with my own authors mapping file.

I renamed my github “blender-bishop” repository to just “blender” since this is now a proper clone. To download it, run “git clone [email protected]:nicholasbishop/blender.git”.

After cloning it, you can let git-svn take over with a few commands. (These are adapted from these excellent git notes on the Blender wiki.)

git svn init https://svn.blender.org/svnroot/bf-blender/trunk/blender
git config svn-remote.svn.fetch :refs/remotes/origin/trunk
git config svn.authorsfile /path/to/authorsfile
git svn rebase

After running those commands, you can still pull updates from the Github repository:

git pull --rebase
git svn rebase

I’ve only just finished making these changes, so there may yet be some bugs to work out. I also haven’t set up any automatic updating of the Github repository, so it will probably lag behind SVN trunk sometimes (although as noted above, you can update your local copy regardless.)

Update: Automatic updates are now enabled, but nothing has been committed to trunk tonight, so not verified that updates are working yet.

Sculpt masking merged to trunk

At long last, sculpt masking is in trunk!

Big thanks to everyone who helped out with uploading test builds and providing feedback on features and bugs. Thanks in particular to Brecht for doing code review, and to the Blender Development Fund for sponsoring the work.

Documentation is on the wiki. We’re getting pretty close now to feature-parity with SharpConstruct ;)

Edit: With masking safely in trunk, I’ve removed the masking branch from github and merged the updates to the skin-modifier branch. If you have previously saved files using the skin-modifier branch, the skin data (i.e. vertex size and root markings) will be lost. This is due to the skin data and paint mask data sharing a CustomData layer identifier until now.

Southern Coding

Have been a bit silent here the past week; I just moved back to South Carolina with all the business that entails.

Work continues on the skin modifier though. If you try out the latest updates in the github branch, you should find that it’s a bit closer to the goal of always generating a manifold mesh. It also has a new smoothing option for smoothing the vertices around branch nodes. This needs further thought still; I’d prefer to just get the output looking nicer in the first place.

Some news regarding sculpt masking from the Sunday #blendercoders meeting, Brecht says he plans to review the patch next week (unless someone else can volunteer to do it.)

Also spent some time today playing with the code style checking script (“make test_style”, or “source/tools/check_style_c.py <paths>”.) Fixed up some of the sculpt/paint code in trunk, as well as updates to the masking and skin modifier code. Will try not to waste too much time on pedantic code formatting though :)

A day for patches

Spent most of today working on updates to the convex hull operator. As mentioned yesterday I submitted it for patch review; Campbell got on that right quick with helpful feedback. Finally got that work finished a half hour ago: lots of bug fixes and new options to control the output. Branch and code review updated if you’re curious.

In related news, reviewed a patch from Jason Wilkins that adds a handy feature for sculpt: pressing numpad period while in sculpt mode will center the view on the last sculpted area. Blender 2.4x had such a feature, but got lost somewhere along the way. You can expect that feature in trunk soon.

And lastly, the sculpt masking patch is now uploaded to code review.

 

Convex hull operator

The initial form created around branch nodes in the skin modifier is a convex hull. I think there are some useful cases for convex hull outside of the skin modifier, so I’ve split this code off into a new BMesh operator and added a corresponding user-accessible operator. The gif above shows an example of how a convex hull can be used as a bridge tool between faces (Blender’s current bridge tool only works if the faces have an equal number of vertices.)

I’ve pushed the code to a new github branch, it’s also in the code review tool.

I am a leaf on the wind (of topology)

 An update on my previous post about holes in the skin modifier.

I have made some significant progress on fixing these holes by applying various tricks to the topology using BMesh. The image at right shows a quick test that would have failed quite badly before these changes due to the four frames that sit partially inside the branch vertex’s convex hull. The new result gives a proper manifold mesh in this case, which you can see better in the lower subsurf’d version.

There are plenty of cases that still fail, but I believe I’m on a good track to fix many of these in a fairly generic way. Since this code is still very much in flux it’s not yet in my github branch; will post another update when that changes.

My immediate goal is to make it impossible to generate a non-manifold surface with the skin modifier. That will address 90% of the problem. Once that’s ready though, I’m wondering about the possibility of running further passes to clean up the topology. The “limbs” generated by the skin modifier already have really nice simple topology, just long lines of quads. While the branch node areas are inherently less “nice”, it might be possible to do a better job of relaxing the polygons in those areas, perhaps avoiding too much variance in the sizes of polygons, merging long skinny triangles, and turning ngons into quads. For now this is just ideas, not sure how it’ll pan out.

Another concern is symmetry. I expect that for most cases, users will want their skins to have symmetry across one of the axes; the current code attempts to generate symmetric quads (which is already flaky), and the problem gets even worse once these weird branch node topologies are allowed. Still pondering how best to address this issue, will post more when I figure something out.

Update:

I’ve pushed some of the new code to github. This update contains only the code for improving connected-ness, none of the fancier relaxation/symmetry ideas mentioned in the last two paragraphs above.

There are still cases that can fail (you may see printouts in the console like “no good face found” in these cases), so still more work to do here. It should now at least be significantly harder to create non-manifold meshes.