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
diff options
context:
space:
mode:
authorLuca Rood <dev@lucarood.com>2018-09-14 16:46:55 +0300
committerLuca Rood <dev@lucarood.com>2018-09-14 16:52:00 +0300
commitc4ef2e2f2ebcd9967aa5d4b283ac7abe51156d51 (patch)
tree031fed256c5ccb0428011a583535f37a88e2eb27 /source/blender/physics
parent1287965089a851c46e9a1a23c55ebc90b00b4e14 (diff)
Cloth: Improve UI
This reorganizes the cloth UI, and changes some of the behaviour to be more reasonable. Changes included here: * Reorganized cloth panels * Improved some tooltips * Removed `vel_damping` option * Removed cloth pinning checkbox * Removed stiffness scaling checkbox * Separated shrinking from sewing * Separated self collisions from object collisions Reviewed By: brecht Differential Revision: http://developer.blender.org/D3691
Diffstat (limited to 'source/blender/physics')
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 9ab688a3670..c098cfd8d95 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -900,8 +900,9 @@ static void cloth_collision_solve_extra(
bool do_extra_solve;
int i;
- if (!(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED))
+ if (!(clmd->coll_parms->flags & (CLOTH_COLLSETTINGS_FLAG_ENABLED | CLOTH_COLLSETTINGS_FLAG_SELF)))
return;
+
if (!clmd->clothObject->bvhtree)
return;
@@ -939,7 +940,7 @@ static void cloth_collision_solve_extra(
float newv[3];
- if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
+ if ((clmd->sim_parms->vgroup_mass > 0) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
continue;
BPH_mass_spring_set_new_position(id, i, verts[i].tx);
@@ -1035,7 +1036,7 @@ int BPH_cloth_solve(Depsgraph *depsgraph, Object *ob, float frame, ClothModifier
clmd->solver_result = (ClothSolverResult *)MEM_callocN(sizeof(ClothSolverResult), "cloth solver result");
cloth_clear_result(clmd);
- if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) { /* do goal stuff */
+ if (clmd->sim_parms->vgroup_mass > 0) { /* Do goal stuff. */
for (i = 0; i < mvert_num; i++) {
// update velocities with constrained velocities from pinned verts
if (verts[i].flags & CLOTH_VERT_FLAG_PINNED) {
@@ -1075,17 +1076,6 @@ int BPH_cloth_solve(Depsgraph *depsgraph, Object *ob, float frame, ClothModifier
/* initialize forces to zero */
BPH_mass_spring_clear_forces(id);
- // damping velocity for artistic reasons
- // this is a bad way to do it, should be removed imo - lukas_t
- if (clmd->sim_parms->vel_damping != 1.0f) {
- for (i = 0; i < mvert_num; i++) {
- float v[3];
- BPH_mass_spring_get_motion_state(id, i, NULL, v);
- mul_v3_fl(v, clmd->sim_parms->vel_damping);
- BPH_mass_spring_set_velocity(id, i, v);
- }
- }
-
// calculate forces
cloth_calc_force(scene, clmd, frame, effectors, step);
@@ -1107,7 +1097,7 @@ int BPH_cloth_solve(Depsgraph *depsgraph, Object *ob, float frame, ClothModifier
/* move pinned verts to correct position */
for (i = 0; i < mvert_num; i++) {
- if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) {
+ if (clmd->sim_parms->vgroup_mass > 0) {
if (verts[i].flags & CLOTH_VERT_FLAG_PINNED) {
float x[3];
/* divide by time_scale to prevent pinned vertices' delta locations from being multiplied */