Age | Commit message (Collapse) | Author |
|
Enable dynamic restlen recomputation based on sew flag and update the
shrink factor math within it to call the new utility function.
|
|
Originally the value was only needed when building the springs,
so a pointer to the input data was somewhat ok. However, recalculating
spring length dynamically requires keeping the actual value around.
|
|
A function that recalculates cloth spring lengths.
|
|
The average length is used to adjust self-collision and stiffness
to match mesh density, and in either case considering the always zero
restlen sewing springs doesn't actually make much sense.
The struct_springs variable is also used for other things like total
spring count, so a new one needed for the true struct springs.
|
|
This comes out of considering a one-dimensional transition in weight
on a rectangular cloth grid. At the transition face loop, one side
of each rectangular face would be scaled by k1, and the opposite one
by k2, thus turning the rectangle into a trapezoid. Averaging would
be used to choose the scale factor for the remaining two sides.
If Geometrical Mean, i.e. sqrt(k1*k2) is used, it so happens that the
diagonals of the trapezoid also end up scaled by sqrt(k1*k2) compared
to the original rectangle. This means that the same scale factor is
correct for both structural and shear springs, which is not the case
with simple average.
|
|
Previously it was all over the place: without a vertex group it was
always enabled, and with it it depended on the Self Collision option
due to a likely editing mistake. Now it should be in sync with what
disables the fields in the UI.
The verts->shrink_factor field is changed to just cache the vertex
weight, with the shrink_min/shrink_max interpolation done later.
This is because cloth_apply_vgroup only runs if there are vertex
groups, and thus the factor may not update after property changes.
In addition, bending springs are now also affected by the shrink
factor to avoid visible distortion in object shape at high shrink.
|
|
|
|
Note that the collision modifier doesn't have any use for Loop indices,
so to avoid duplicating the loop array too,
MVertTri has been added which simply stores vertex indices (runtime only).
|
|
For areas that require append, store the last node,
Previous behavior would too easily hide poorly performing code.
Also avoid (prepend, reverse) where possible.
|
|
|
|
This feature has been totally broken for a long time. It was added
originally because negative frames were not supported.
Giving simulations (cloth and others) time to settle before animation
starts needs to be solved in a much better and more generic way.
|
|
Cloth data is used both for hair and actual cloth, which makes things
really difficult. The face number was used for distinguishing the two
types (no faces == hair mesh), but the extra hair data necessary for
hair sim is generated by particles and not available for edge-only cloth
meshes. This really needs to be sanitized ...
Conflicts:
source/blender/physics/intern/BPH_mass_spring.cpp
|
|
This helps to create some variation in a hair system, which can
otherwise become very uniform and boring. It's yet another confusing
setting in a system that should have been nodified, but only option for
now (broken windows ...)
Conflicts:
source/blender/blenkernel/intern/particle_system.c
source/blender/physics/intern/BPH_mass_spring.cpp
|
|
to support multiple hash identifiers.
Using explicit hashing functions for every sim debug call defeats the
purpose of having a quick feedback system. Now this can be done simply
by passing an arbitrary number of hash inputs (integers) at the end of
the function calls, which are then combined by a system of variadic
macros (based on the ELEM feature). Up to 8 identifiers are supported
currently, but more could be added easily if needed.
Conflicts:
source/blender/blenkernel/intern/particle_system.c
source/blender/physics/intern/BPH_mass_spring.cpp
|
|
This is a bit more awkward for artists to use, but necessary for
a stable solution of the hair continuum calculation. The grid size is
defined by the user, the extent of the grid is then calculated based on
the hair geometry. A hard upper limit prevents bad memory allocation
in case too small values are entered.
Conflicts:
source/blender/physics/intern/BPH_mass_spring.cpp
|
|
one solver anyway), and split some particle cloth functions for clarity.
Conflicts:
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/intern/particle_system.c
source/blender/blenloader/intern/versioning_270.c
source/blender/makesdna/DNA_particle_types.h
source/blender/makesrna/intern/rna_particle.c
|
|
The bend damping factor was hardcoded to the same value as the stiffness.
Now it has its own factor in the settings and button in hair dynamics.
|
|
Bending springs are en-bloc and not interleaved with other springs, so
this can't be used as a test for hair roots. Use consecutive indices
instead.
|
|
Basically follows the Pixar approach from "Artistic Simulation of Curly
Hair".
|
|
This is more involved than using simple straight bending targets
constructed from the neighboring segments, but necessary for restoring
groomed rest shapes.
The targets are defined by parallel-transporting a coordinate frame
along the hair, which smoothly rotates to avoid sudden twisting (Frenet
frame problem). The rest positions of hair vertices defines the target
vectors relative to the frame. In the deformed motion state the frame
is then recalculated and the targets constructed in world/root space.
|
|
This makes the bending a truely local effect. Eventually target
directions should be based in a local coordinate frame that gets
parallel transported along the curve. This will allow non-straight
rest shapes for hairs as well as supporting twist forces. However,
calculating locally transformed spring forces is more complicated.
|
|
These are much better suited for creating stiff hair. The previous
bending springs are based on "push" type spring along the hypothenuse
of 3 hair vertices. This sort of spring requires a very large force
in the direction of the spring for any angular effect, and is still
unstable in the equilibrium.
The new bending spring model is based on "target" vectors defined in a
local hair frame, which generates a force perpendicular to the hair
segment. For further details see
"Artistic Simulation of Curly Hair" (Pixar technical memo #12-03a)
or
"A Mass Spring Model for Hair Simulation" (Selle, Lentine, Fedkiw 2008)
Currently the implementation uses a single root frame that is not yet
propagated along the hair, so the resulting rest shape is not very
natural. Also damping and derivatives are still missing.
|
|
the default to 32.
Conflicts:
source/blender/blenloader/intern/versioning_270.c
|
|
create/free functions for solver data off from the cloth solver.
|
|
code.
The implicit solver itself should remain agnostic to the specifics of
the Blender data (cloth vs. hair). This way we could avoid the bloated
data conversion chain from particles/hair to derived mesh to cloth
modifier to implicit solver data and back. Every step in this chain adds
overhead as well as rounding errors and a possibility for bugs, not to
speak of making the code horribly complicated.
The new subfolder is named "physics" since it should be the start of a
somewhat "unified" physics systems combining all the various solvers in
the same place and managing things like synchronized time steps.
|
|
Move powX functions from particle code into math library and use them.
|
|
|
|
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
|
|
|
|
|
|
updates.
This file crashes on loading with NULL pointer access to curve_cache:
{F77132}
The pdInitEffectors function was amalgamating the simple
collection of effector objects with an automatic precalculation for
curve guides and the like. This precalculation requires object data
that may not be available until the DAG has finished.
Since for DAG dependencies only the list of effectors is required,
added an argument to disable precalculation when collecting effectors.
|
|
|
|
Description:
--------------------------
Use loose edges marked as seams as sewing springs.
Usage:
-------------------------
All this patch does is set the rest length to 0 and the stiffness to 1 for springs for loose edges marked as seams so that during the cloth simulation they will be brought together.
Example Video:
-------------------------
http://www.youtube.com/watch?v=-Y_bC0gjoM0
Original Patch by thesleepless (+ git patch by codemanx)
Thank you!
|
|
|
|
- was ordering vertex args unnecessarily.
- was adding the same edges multiple times into the edgehash.
|
|
which orders on assignment.
|
|
- any error in cloth_build_springs wasn't freeing the edge-hash.
- was checking BLI_edgehash_haskey on matching vertices.
- was looping over setting NULL for all elements of a calloc'd array.
|
|
|
|
Don't return imediately when simulation has changed.
It's not needed and prevented proper initialization on startframe when
simulation changed.
|
|
also correct odd indentation.
|
|
not to confuse things.
|
|
This was left over from 2.4x days and is not used anymore.
Now simulations are always interactive.
|
|
|
|
modifers too!
|
|
|
|
also left bmesh decimator on in previous commit.
|
|
|
|
Problem occured when having more than one weight map available.
|
|
C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
|
|
This makes it looks like if part 1 of the Dynamic Paint regression blend file fails, but actually it's correct.
|