[Bf-blender-cvs] [00d4bf4] gooseberry: Merge branch 'master' into gooseberry

Lukas Tönne noreply at git.blender.org
Tue Jan 20 11:10:58 CET 2015


Commit: 00d4bf4ce8c95c250bfeec277c51eca20a82f301
Author: Lukas Tönne
Date:   Tue Jan 20 11:10:39 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB00d4bf4ce8c95c250bfeec277c51eca20a82f301

Merge branch 'master' into gooseberry

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/blenkernel/BKE_cloth.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/collision.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/physics/particle_edit.c
	source/blender/makesdna/DNA_particle_types.h
	source/blender/physics/BPH_mass_spring.h
	source/blender/physics/intern/BPH_mass_spring.cpp
	source/blender/physics/intern/implicit_blender.c

===================================================================



===================================================================

diff --cc release/scripts/startup/bl_ui/properties_particle.py
index 50b8f17,7285151..9943566
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@@ -378,6 -375,6 +378,14 @@@ class PARTICLE_PT_hair_dynamics(Particl
  
          split.separator()
  
++        split.separator()
++
++        col = split.column()
++        col.label(text="Pinning")
++        col.prop(cloth, "pin_stiffness", text="Goal Strength")
++
++        split.separator()
++
          col = split.column()
          col.label(text="Quality:")
          col.prop(cloth, "quality", text="Steps", slider=True)
diff --cc source/blender/blenkernel/BKE_cloth.h
index 3b19a04,beb4f22..534747e
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@@ -56,14 -56,10 +56,11 @@@ struct PartDeflect
  #define ALMOST_ZERO		FLT_EPSILON
  
  /* Bits to or into the ClothVertex.flags. */
- //typedef enum eClothVertexFlag {
- //	CLOTH_VERT_FLAG_PINNED      = 1,
- //	CLOTH_VERT_FLAG_NOSELFCOLL  = 2, /* vertex NOT used for self collisions */
- //	CLOTH_VERT_FLAG_EXCLUDE     = 4, /* exclude vertex from the simulation */
- //} eClothVertexFlag;
- #define CLOTH_VERT_FLAG_PINNED      1
- #define CLOTH_VERT_FLAG_NOSELFCOLL  2 /* vertex NOT used for self collisions */
- #define CLOTH_VERT_FLAG_EXCLUDE     4 /* exclude vertex from the simulation */
+ typedef enum eClothVertexFlag {
+ 	CLOTH_VERT_FLAG_PINNED      = 1,
+ 	CLOTH_VERT_FLAG_NOSELFCOLL  = 2, /* vertex NOT used for self collisions */
++	CLOTH_VERT_FLAG_EXCLUDE     = 4, /* exclude vertex from the simulation */
+ } eClothVertexFlag;
  
  typedef struct ClothHairData {
  	float loc[3];
diff --cc source/blender/blenkernel/intern/particle.c
index c5bd232,c489dce..4541308
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@@ -1899,7 -1867,7 +1899,6 @@@ int do_guides(ParticleSettings *part, L
  	}
  	return 0;
  }
--
  static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec)
  {
  	float force[3] = {0.0f, 0.0f, 0.0f};
diff --cc source/blender/blenloader/intern/versioning_270.c
index 12d8383,c652f56..373ac05
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -509,7 -459,40 +509,77 @@@ void blo_do_versions_270(FileData *fd, 
  #undef BRUSH_RANDOM_ROTATION
  	}
  
 +	if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) {
++		ParticleSettings *part;
++		for (part = main->particle.first; part; part = part->id.next) {
++			part->clump_noise_size = 1.0f;
++		}
++	}
++
++	if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "int", "kink_extra_steps")) {
++		ParticleSettings *part;
++		for (part = main->particle.first; part; part = part->id.next) {
++			part->kink_extra_steps = 4;
++		}
++	}
++
++	if (!DNA_struct_elem_find(fd->filesdna, "MTex", "float", "kinkampfac")) {
++		ParticleSettings *part;
++		for (part = main->particle.first; part; part = part->id.next) {
++			int a;
++			for (a = 0; a < MAX_MTEX; a++) {
++				MTex *mtex = part->mtex[a];
++				if (mtex) {
++					mtex->kinkampfac = 1.0f;
++				}
++			}
++		}
++	}
++
++	if (!MAIN_VERSION_ATLEAST(main, 273, 3)) {
++		ParticleSettings *part;
++		for (part = main->particle.first; part; part = part->id.next) {
++			if (part->clumpcurve)
++				part->child_flag |= PART_CHILD_USE_CLUMP_CURVE;
++			if (part->roughcurve)
++				part->child_flag |= PART_CHILD_USE_ROUGH_CURVE;
++		}
++	}
++
+ 	/* Customizable Safe Areas */
+ 	if (!MAIN_VERSION_ATLEAST(main, 273, 2)) {
+ 		if (!DNA_struct_elem_find(fd->filesdna, "Scene", "DisplaySafeAreas", "safe_areas")) {
+ 			Scene *scene;
+ 
+ 			for (scene = main->scene.first; scene; scene = scene->id.next) {
+ 				copy_v2_fl2(scene->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f);
+ 				copy_v2_fl2(scene->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f);
+ 				copy_v2_fl2(scene->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f);
+ 				copy_v2_fl2(scene->safe_areas.action_center, 15.0f / 100.0f, 5.0f / 100.0f);
+ 			}
+ 		}
+ 	}
+ 	
+ 	if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "bending_damping")) {
+ 		Object *ob;
+ 		ModifierData *md;
+ 		for (ob = main->object.first; ob; ob = ob->id.next) {
+ 			for (md = ob->modifiers.first; md; md = md->next) {
+ 				if (md->type == eModifierType_Cloth) {
+ 					ClothModifierData *clmd = (ClothModifierData*) md;
+ 					clmd->sim_parms->bending_damping = 0.5f;
+ 				}
+ 				else if (md->type == eModifierType_ParticleSystem) {
+ 					ParticleSystemModifierData *pmd = (ParticleSystemModifierData*) md;
+ 					if (pmd->psys->clmd) {
+ 						pmd->psys->clmd->sim_parms->bending_damping = 0.5f;
+ 					}
+ 				}
+ 			}
+ 		}
+ 	}
+ 
+ 	if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) {
  		ParticleSettings *part;
  		for (part = main->particle.first; part; part = part->id.next) {
  			part->clump_noise_size = 1.0f;
diff --cc source/blender/editors/physics/particle_edit.c
index 821694f,29b9db2..d35b8fd
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@@ -4088,7 -4088,10 +4088,9 @@@ static bool shape_cut_test_point(PEDat
  {
  	BVHTreeFromMesh *shape_bvh = &data->shape_bvh;
  	const float dir[3] = {1.0f, 0.0f, 0.0f};
- 	PointInsideBVH userdata = { data->shape_bvh, 0 };
+ 	PointInsideBVH userdata;
 -	
+ 	userdata.bvhdata = data->shape_bvh;
+ 	userdata.num_hits = 0;
  	
  	BLI_bvhtree_ray_cast_all(shape_bvh->tree, key->co, dir, 0.0f, point_inside_bvh_cb, &userdata);
  	
diff --cc source/blender/physics/intern/BPH_mass_spring.cpp
index 9569fd0,c8e052c..30efb57
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@@ -1,1170 -1,1024 +1,1113 @@@
 -/*
 - * ***** BEGIN GPL LICENSE BLOCK *****
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version 2
 - * of the License, or (at your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful,
 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software Foundation,
 - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 - *
 - * The Original Code is Copyright (C) Blender Foundation
 - * All rights reserved.
 - *
 - * The Original Code is: all of this file.
 - *
 - * Contributor(s): Lukas Toenne
 - *
 - * ***** END GPL LICENSE BLOCK *****
 - */
 -
 -/** \file blender/blenkernel/intern/BPH_mass_spring.c
 - *  \ingroup bph
 - */
 -
 -extern "C" {
 -#include "MEM_guardedalloc.h"
 -
 -#include "DNA_cloth_types.h"
 -#include "DNA_scene_types.h"
 -#include "DNA_object_force.h"
 -#include "DNA_object_types.h"
 -#include "DNA_meshdata_types.h"
 -#include "DNA_modifier_types.h"
 -
 -#include "BLI_math.h"
 -#include "BLI_linklist.h"
 -#include "BLI_utildefines.h"
 -
 -#include "BKE_cloth.h"
 -#include "BKE_collision.h"
 -#include "BKE_effect.h"
 -}
 -
 -#include "BPH_mass_spring.h"
 -#include "implicit.h"
 -
 -static float I3[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}};
 -
 -/* Number of off-diagonal non-zero matrix blocks.
 - * Basically there is one of these for each vertex-vertex interaction.
 - */
 -static int cloth_count_nondiag_blocks(Cloth *cloth)
 -{
 -	LinkNode *link;
 -	int nondiag = 0;
 -	
 -	for (link = cloth->springs; link; link = link->next) {
 -		ClothSpring *spring = (ClothSpring *)link->link;
 -		switch (spring->type) {
 -			case CLOTH_SPRING_TYPE_BENDING_ANG:
 -				/* angular bending combines 3 vertices */
 -				nondiag += 3;
 -				break;
 -				
 -			default:
 -				/* all other springs depend on 2 vertices only */
 -				nondiag += 1;
 -				break;
 -		}
 -	}
 -	
 -	return nondiag;
 -}
 -
 -int BPH_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
 -{
 -	Cloth *cloth = clmd->clothObject;
 -	ClothVertex *verts = cloth->verts;
 -	const float ZERO[3] = {0.0f, 0.0f, 0.0f};
 -	Implicit_Data *id;
 -	unsigned int i, nondiag;
 -	
 -	nondiag = cloth_count_nondiag_blocks(cloth);
 -	cloth->implicit = id = BPH_mass_spring_solver_create(cloth->numverts, nondiag);
 -	
 -	for (i = 0; i < cloth->numverts; i++) {
 -		BPH_mass_spring_set_vertex_mass(id, i, verts[i].mass);
 -	}
 -	
 -	for (i = 0; i < cloth->numverts; i++) {
 -		BPH_mass_spring_set_motion_state(id, i, verts[i].x, ZERO);
 -	}
 -	
 -	return 1;
 -}
 -
 -void BPH_cloth_solver_free(ClothModifierData *clmd)
 -{
 -	Cloth *cloth = clmd->clothObject;
 -	
 -	if (cloth->implicit) {
 -		BPH_mass_spring_solver_free(cloth->implicit);
 -		cloth->implicit = NULL;
 -	}
 -}
 -
 -void BKE_cloth_solver_set_positions(ClothModifierData *clmd)
 -{
 -	Cloth *cloth = clmd->clothObject;
 -	ClothVertex *verts = cloth->verts;
 -	unsigned int numverts = cloth->numverts, i;
 -	ClothHairData *cloth_hairdata = clmd->hairdata;
 -	Implicit_Data *id = cloth->implicit;
 -	
 -	for (i = 0; i < numverts; i++) {
 -		if (cloth_hairdata) {
 -			ClothHairData *root = &cloth_hairdata[i];
 -			BPH_mass_spring_set_rest_transform(id, i, root->rot);
 -		}
 -		else
 -			BPH_mass_spring_set_rest_transform(id, i, I3);
 -		
 -		BPH_mass_spring_set_motion_state(id, i, verts[i].x, verts[i].v);
 -	}
 -}
 -
 -static bool collision_response(ClothModifierData *clmd, CollisionModifierData *collmd, CollPair *collpair, float dt, float restitution, float r_impulse[3])
 -{
 -	Cloth *cloth = clmd->clothObject;
 -	int index = collpair->ap1;
 -	bool result = false;
 -	
 -	float v1[3], v2_old[3], v2_new[3], v_rel_old[3], v_rel_new[3];
 -	float epsilon2 = BLI_bvhtree_getepsilon(collmd->bvhtree);
 -
 -	float margin_distance = collpair->distance - e

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list