Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-08Cleanup: remove useless `DM_ensure_looptri()`.Bastien Montagne
That one was doing exactly same thing as `dm->getLoopTriArray()`, no point in having twice the same code here...
2017-03-23Cloth refactor: Remove goal springs and some other cleanupLuca Rood
This removes the goal springs, in favor of simply calculating the goal forces on the vertices directly. The vertices already store all the necessary data for the goal forces, thus the springs were redundant, and just defined both ends as being the same vertex. The main advantage of removing the goal springs, is an increase in flexibility, allowing us to much more nicely do some neat dynamic stuff with the goals/pins, such as animated vertex weights. But this also has the advantage of simpler code, and a slightly reduced memory footprint. This also removes the `f`, `dfdx` and `dfdv` fields from the `ClothSpring` struct, as that data is only used by the solver, and is re-computed on each step, and thus does not need to be stored throughout the simulation. Reviewers: sergey Reviewed By: sergey Tags: #physics Differential Revision: https://developer.blender.org/D2514
2016-08-13Prevent max stiffness values from going under normal stiffness values in ↵Luca Rood
cloth stiffness scaling. When updating the max values under stiffness scaling, they clip at the normal stiffness values as expected, however when updating stiffness values, you could set them higher than the max values, and the max values weren't updated accordingly. As the stiffness scaling computes using the absolute difference between the max values and the stiffness values, you got higher stiffnesses in scaled areas even though your max is actually lower than the normal stiffness. This diff fixes that behaviour, by updating the max values to be equal to the stiffness whenever you set a higher stiffness than the max value. Also, I have initialized the max values to the same as the stiffnesses, as they were previously just set to zero, and caused the same problem described above. Reviewers: lukastoenne Reviewed By: lukastoenne Tags: #physics Differential Revision: https://developer.blender.org/D2147
2016-08-11Fix T49004 and motion blur of cloth, softbody, etc past the end frame.Alexander Gavrilov
Point cache read code contains checks designed to prevent it reading stale data when the relevant simulation code should instead compute the next frame from the previous one. However in some situations like motion blur subframes the simulation can't possibly do it and just exits. This causes completely incorrect motion blur at or after the last cached frame. To fix, add a parameter that tells the cache code whether it should apply the checks and exit, or read what it can even if stale (true means exactly same as old behavior). Doing this in cache rather than clamping the frame number better in the caller lets it handle the case of incomplete cache that stops before the official last frame. Reviewed By: mont29, lukastoenne Maniphest Tasks: T49004 Differential Revision: https://developer.blender.org/D2144
2016-07-30Cloth Simulation: add time scale propertyCampbell Barton
This setting can also be animated, to create a "time warp" effect. D2122 by @LucaRood
2016-07-30Cloth: option to use dynamic base meshCampbell Barton
This adds the ability for cloth simulations to respect changes in the underlying mesh. So you can for instance, animate shape keys, armatures, or add any deformation modifiers (above the cloth modifier). This is mainly useful for (but not limited to) cartoon animations, where your character might stretch or change shape, and you want the clothes to follow accordingly. D1903 by @LucaRood
2016-05-06Cloth: Fix shrinking to properly respond to animated min/max and weight.Alexander Gavrilov
Enable dynamic restlen recomputation based on sew flag and update the shrink factor math within it to call the new utility function.
2016-05-06Cloth: Change ClothVertex::xrest to actually store the rest position.Alexander Gavrilov
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.
2016-05-06Part of D1903: Dynamic base mesh for cloth simulationLuca Rood
A function that recalculates cloth spring lengths.
2016-05-06Cloth: Ignore zero-restlen sewing springs in average length computation.Alexander Gavrilov
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.
2016-05-06Cloth: Use Geometrical Mean for averaging cloth shrink factor.Alexander Gavrilov
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.
2016-05-06Cloth: Fix the shrink feature to be controlled by the sewing spring flag.Alexander Gavrilov
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.
2015-08-01Remove MFace use w/ clothCampbell Barton
2015-07-31Replace MFace w/ vert-tri's for collision modifierCampbell Barton
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).
2015-06-12BLI_linklist, avoid full list search for appendCampbell Barton
For areas that require append, store the last node, Previous behavior would too easily hide poorly performing code. Also avoid (prepend, reverse) where possible.
2015-03-11Cleanup: indentationCampbell Barton
2015-02-12Removed the cloth preroll feature.Lukas Tönne
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.
2015-01-20Fix for invalid access to undefined hair data in edge-only cloth meshes.Lukas Tönne
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
2015-01-20Randomness factor for hair bending stiffness.Lukas Tönne
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
2015-01-20Nicer hashing functionality for sim debugging using a variadic macroLukas Tönne
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
2015-01-20Use a fixed, uniform cell size for hair continuum grids.Lukas Tönne
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
2015-01-20Cleanup: Removed the unnecessary cloth solver abstraction (there is onlyLukas Tönne
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
2015-01-20Added separate damping for bending springs.Lukas Tönne
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.
2015-01-20Fix for hair chain testing in the cloth modifier.Lukas Tönne
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.
2015-01-20Completed the implementation of bent rest shapes for hair.Lukas Tönne
Basically follows the Pixar approach from "Artistic Simulation of Curly Hair".
2015-01-20Target calculation for local non-straight rest shapes.Lukas Tönne
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.
2015-01-20Calculate bending targets based on the direction of previous segments.Lukas Tönne
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.
2015-01-20Simple initial implementation of angular bending springs.Lukas Tönne
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.
2015-01-20Made the voxel grid size for hair interaction configurable and increasedLukas Tönne
the default to 32. Conflicts: source/blender/blenloader/intern/versioning_270.c
2015-01-20Renamed functions to make them explicitly refer to cloth, and split theLukas Tönne
create/free functions for solver data off from the cloth solver.
2015-01-20Moved the cloth solver code into a new subfolder/library inside BlenderLukas Tönne
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.
2014-11-11Avoid calling powf with integer exponent in more placesSergej Reich
Move powX functions from particle code into math library and use them.
2014-09-24Cleanup: boolCampbell Barton
2014-06-13GSet, GHash: Add BLI_gset_add, since its common to add members to a setCampbell Barton
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
2014-04-04Cloth: replace EdgeHash with EdgeSetCampbell Barton
2014-03-17Code cleanup: styleCampbell Barton
2014-02-14Fix for crash caused by effectors doing precalculation //during// DAGLukas Tönne
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.
2014-02-14Code cleanup: duplicate headersCampbell Barton
2014-02-06Patch T31269: Add sewing seams to cloth simulationDaniel Genrich
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!
2013-10-31code cleanup: spellingCampbell Barton
2013-08-24cloth was using edgehash not quite correctly:Campbell Barton
- was ordering vertex args unnecessarily. - was adding the same edges multiple times into the edgehash.
2013-08-24cloth spring building: replace MIN2/MAX2 in assignments with a function ↵Campbell Barton
which orders on assignment.
2013-08-24fix for leak in cloth modifierCampbell Barton
- 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.
2013-08-24edge hash: take an arg for the guarded-malloc string (as ghash does)Campbell Barton
2013-07-22cloth: Fix [#36224] Cloth Simulation Doesn't Work on Rearranging ModifiersSergej Reich
Don't return imediately when simulation has changed. It's not needed and prevented proper initialization on startframe when simulation changed.
2013-03-15code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,Campbell Barton
also correct odd indentation.
2013-03-05code cleanup: also change BKE_blender.h BLENDER_VERSION_CHAR to 'a' so as ↵Campbell Barton
not to confuse things.
2013-01-23sim: Remove "continue physics" codeSergej Reich
This was left over from 2.4x days and is not used anymore. Now simulations are always interactive.
2012-12-28style cleanupCampbell Barton
2012-10-27A few more BMesh errors messages translated, and "automated" translation for ↵Bastien Montagne
modifers too!