Blender Git Loki

Blender Git "temp_hair_flow" branch commits.

Page: 2 / 32

December 27, 2014, 10:23 (GMT)
Fixed lib-linking for hair edit settings brush and object pointers.
December 27, 2014, 10:23 (GMT)
Fix for hair-to-particle export: need to set weight=1.0 for hair roots,
since the particle system uses this for pinning them to the mesh.
December 27, 2014, 10:23 (GMT)
Fix scons build files for new hair edit code parts.
December 27, 2014, 10:23 (GMT)
MSVC compiler cannot handle standard C code.
December 27, 2014, 10:23 (GMT)
Sanity check for strand root/tip checks, now supports single vertices.
December 27, 2014, 10:23 (GMT)
Renamed the edithair files in BKE to editstrands.

The rationale behind this is that the BKE code could be used for
modeling hair and fur as well as a number of other features such as
grass. The primary addition to BMesh is the limitation to strand-like
topology (simple vertex chains, optionally rooted on a mesh surface).

The editor code OTOH is quite hair specific, since the result should
be suitable for hair simulation, and the workflow should mimick actual
hair grooming intuitively. Eventually the hair edit mode could become
a generalized strand edit mode with slightly different tool sets for
various purposes, but for now it is quite specifically built for hair.
December 27, 2014, 10:23 (GMT)
Support for sim_debug drawing in hair edit mode (dev feature).
December 27, 2014, 10:23 (GMT)
Use a simple low-pass filter to generate a smoother, more stable
direction vector for the hair stroke tool.

This is necessary for directional tools such as combing, where the
stroke direction can lead to unwanted results if it changes too
abruptly.
December 27, 2014, 10:23 (GMT)
Improved hair combing tool, adjusting edge directions instead of
vertex positions.

This works a lot better with strokes perpendicular to the general hair
strand direction. With the previous comb tool such strokes would only
make a small dent in the hair curve and then vertices would slip out
of the tool circle. The edge combing affects the local direction of
strands, which acts as a kind of grabbing functionality by moving
further vertices in front of the tool circle. The result is that
drawing a curvy hair shape with the comb becomes much easier.

In addition, the new tool also uses edge filtering and weighting rather
than vertices. This means that small brushes also work well, instead
of having no effect when hitting the edge segments between vertices.

Further improvement could be achieved later by using a global strand
solver, which adjusts vertex positions based on an error metric along
the whole of the strand.
December 27, 2014, 10:23 (GMT)
Primitive transform operator support for strand vertices.

This does not yet prevent root transforms and/or length changes.
December 27, 2014, 10:23 (GMT)
Missing bmesh include path in scons files.
December 27, 2014, 10:23 (GMT)
Ported over the relaxation method for hair vertices from particle edit
mode.

This method is simple, but not really very usable. It works by
successively relaxing segments that are too long or too short, moving
both vertices along the edge between them. This is repeated N^2 times
(N: number of vertices on the strand).

A true IK solver could give a lot better results, as well as providing
many opportunities to apply weighting for targets (e.g. preferring to
move non-selected over selected vertices). Many different methods for
simple IK solvers exist, so there should be one that works well for
large number of simple strands. See e.g.
http://www.math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf
December 27, 2014, 10:23 (GMT)
IK solver for hair strands that provides a better solution for keeping
consistent segment lengths when transforming vertices.

Warning: The implementation is not correct yet, but all the steps should
be there.

The main idea is to treat strands as a sequence of joints that are
displaced out of their original locations by a transform or other tool.
The solver then tries to find a global per-strand solution that keeps
the segment lengths unmodified, with a minimum change in angles from
the original starting shape. Such a solution is much more usable and
efficient than the current O(n^2) attempt of "spreading the error"
across the strand.

The inverse kinematics method is very flexible. It can also include
stretching, which would be very welcome for features like the length
tool. Different parts of the strand could be weighted separately using
scaling factors for the angle/stretch parameters.
December 27, 2014, 10:23 (GMT)
Make sure tool input data is in object space.
December 27, 2014, 10:23 (GMT)
Enforce hair constraints (constant segment length) after applying a tool.

Currently uses the same approach as old particle edit mode (rescale
hair segments from the root on). A more sophisticated approach using
least-square error minimization of the displacement could yield better
results.
December 27, 2014, 10:23 (GMT)
Constrain hair root vertices to their mesh location after applying tools.
December 27, 2014, 10:23 (GMT)
Filter affected hair vertices in edit mode based on the brush size and
z depth.
December 27, 2014, 10:23 (GMT)
Use the "official" brush size calculated by blenkernel and subdivide
the stroke step to avoid tunneling.
December 27, 2014, 10:23 (GMT)
Display basic brush properties in the toolbar for hair edit mode.
December 27, 2014, 10:23 (GMT)
Primitive hair lighting in OpenGL solid shading, cleanup of strands
drawing code for edit mode.

The lighting uses the same method as the particle hair, interpreting
strand direction as the normal. This is nowhere near realistic hair
shading, but doing this with line shading alone in the fixed-function
pipeline is probably not possible. A GLSL shader could be used instead
for a more realistic alternative as part of the viewport project. At
least this simple shading mode gives some orientation feedback while
editing hair.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021