[Bf-blender-cvs] [2d9948f] testbuild: hair_immediate_fixes test build

Lukas Tönne noreply at git.blender.org
Fri Nov 14 04:32:16 CET 2014


Commit: 2d9948f82c09ca4bd2e260a5f35564c880b6b1d2
Author: Lukas Tönne
Date:   Thu Sep 18 10:36:28 2014 +0200
Branches: testbuild
https://developer.blender.org/rB2d9948f82c09ca4bd2e260a5f35564c880b6b1d2

hair_immediate_fixes test build

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

M	build_files/cmake/macros.cmake
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_texture.py
M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/BKE_cloth.h
M	source/blender/blenkernel/BKE_collision.h
M	source/blender/blenkernel/BKE_effect.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/SConscript
M	source/blender/blenkernel/intern/cloth.c
M	source/blender/blenkernel/intern/collision.c
M	source/blender/blenkernel/intern/effect.c
D	source/blender/blenkernel/intern/implicit.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenlib/BLI_math_matrix.h
M	source/blender/blenlib/intern/math_matrix.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/object/object_bake_api.c
M	source/blender/editors/space_view3d/CMakeLists.txt
M	source/blender/editors/space_view3d/drawobject.c
A	source/blender/editors/space_view3d/drawsimdebug.c
M	source/blender/editors/space_view3d/view3d_intern.h
M	source/blender/makesdna/DNA_cloth_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_texture_types.h
M	source/blender/makesrna/intern/rna_cloth.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_texture.c
M	source/blender/modifiers/intern/MOD_cloth.c
A	source/blender/physics/BPH_mass_spring.h
A	source/blender/physics/CMakeLists.txt
A	source/blender/physics/SConscript
A	source/blender/physics/intern/BPH_mass_spring.cpp
A	source/blender/physics/intern/ConstrainedConjugateGradient.h
A	source/blender/physics/intern/hair_volume.c
A	source/blender/physics/intern/implicit.h
A	source/blender/physics/intern/implicit_blender.c
A	source/blender/physics/intern/implicit_eigen.cpp
M	source/blender/render/intern/source/voxeldata.c

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

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index adbba81..0ede486 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -498,6 +498,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
 		bf_modifiers
 		bf_bmesh
 		bf_blenkernel
+		bf_physics
 		bf_nodes
 		bf_rna
 		bf_gpu
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 30fc3a9..d8a0ab2 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -278,7 +278,8 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
         if not psys.cloth:
             return
 
-        cloth = psys.cloth.settings
+        cloth_md = psys.cloth
+        cloth = cloth_md.settings
 
         layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
 
@@ -292,6 +293,12 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
         sub.prop(cloth, "bending_stiffness", text="Bending")
         sub.prop(cloth, "internal_friction", slider=True)
         sub.prop(cloth, "collider_friction", slider=True)
+        sub.prop(cloth, "pressure", slider=True)
+        sub.prop(cloth, "pressure_threshold", slider=True)
+
+        sub.separator()
+        
+        sub.prop(cloth, "voxel_resolution")
 
         col = split.column()
         col.label(text="Damping:")
@@ -302,6 +309,9 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
         col.label(text="Quality:")
         col.prop(cloth, "quality", text="Steps", slider=True)
 
+        col.prop(cloth_md, "show_debug_data", text="Debug")
+
+
 
 class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
     bl_label = "Cache"
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index faf0d4c..4f5d22d 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -771,6 +771,9 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel):
         elif vd.file_format == 'SMOKE':
             layout.prop(vd, "domain_object")
             layout.prop(vd, "smoke_data_type")
+        elif vd.file_format == 'HAIR':
+            layout.prop(vd, "domain_object")
+            layout.prop(vd, "hair_data_type")
         elif vd.file_format == 'IMAGE_SEQUENCE':
             layout.template_ID(tex, "image", open="image.open")
             layout.template_image(tex, "image", tex.image_user, compact=True)
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 0d30952..1cc232a 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -102,6 +102,7 @@ add_subdirectory(render)
 add_subdirectory(blenfont)
 add_subdirectory(blenloader)
 add_subdirectory(ikplugin)
+add_subdirectory(physics)
 add_subdirectory(gpu)
 add_subdirectory(imbuf)
 add_subdirectory(nodes)
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 757d63e..571c0ec 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -41,7 +41,10 @@ struct Scene;
 struct MFace;
 struct DerivedMesh;
 struct ClothModifierData;
+struct CollisionModifierData;
 struct CollisionTree;
+struct VoxelData;
+struct PartDeflect;
 
 #define DO_INLINE MALWAYS_INLINE
 
@@ -56,6 +59,11 @@ struct CollisionTree;
 #define CLOTH_VERT_FLAG_PINNED 1
 #define CLOTH_VERT_FLAG_NOSELFCOLL 2 /* vertex NOT used for self collisions */
 
+typedef struct ClothHairRoot {
+	float loc[3];
+	float rot[3][3];
+} ClothHairRoot;
+
 /**
  * This structure describes a cloth object against which the
  * simulation can run.
@@ -158,6 +166,7 @@ typedef enum {
 typedef enum {
 	CLOTH_COLLSETTINGS_FLAG_ENABLED = ( 1 << 1 ), /* enables cloth - object collisions */
 	CLOTH_COLLSETTINGS_FLAG_SELF = ( 1 << 2 ), /* enables selfcollisions */
+	CLOTH_COLLSETTINGS_FLAG_POINTS = ( 1 << 3 ), /* enables point collisions (hair) */
 } CLOTH_COLLISIONSETTINGS_FLAGS;
 
 /* Spring types as defined in the paper.*/
@@ -180,21 +189,25 @@ typedef enum {
 // collision.c
 ////////////////////////////////////////////////
 
+struct CollPair;
+
+typedef struct ColliderContacts {
+	struct Object *ob;
+	struct CollisionModifierData *collmd;
+	
+	struct CollPair *collisions;
+	int totcollisions;
+} ColliderContacts;
+
 // needed for implicit.c
 int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData *clmd, float step, float dt );
+int cloth_points_objcollision(struct Object *ob, struct ClothModifierData *clmd, float step, float dt);
 
-////////////////////////////////////////////////
-
+void cloth_find_point_contacts(struct Object *ob, struct ClothModifierData *clmd, float step, float dt,
+                               ColliderContacts **r_collider_contacts, int *r_totcolliders);
+void cloth_free_contacts(ColliderContacts *collider_contacts, int totcolliders);
 
 ////////////////////////////////////////////////
-// implicit.c
-////////////////////////////////////////////////
-
-// needed for cloth.c
-int implicit_init (struct Object *ob, struct ClothModifierData *clmd );
-int implicit_free (struct ClothModifierData *clmd );
-int implicit_solver (struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors );
-void implicit_set_positions (struct ClothModifierData *clmd );
 
 /////////////////////////////////////////////////
 // cloth.c
@@ -233,9 +246,9 @@ typedef enum {
 typedef struct {
 	const char		*name;
 	CM_SOLVER_ID	id;
-	int	( *init ) (struct Object *ob, struct ClothModifierData *clmd );
-	int	( *solver ) (struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors );
-	int	( *free ) (struct ClothModifierData *clmd );
+	int ( *init ) (struct Object *ob, struct ClothModifierData *clmd );
+	int ( *solver ) (struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors );
+	void ( *free ) (struct ClothModifierData *clmd );
 }
 CM_SOLVER_DEF;
 
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index ec257a2..b81b8f0 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -81,6 +81,8 @@ typedef struct CollPair {
 	float pa[3], pb[3]; // collision point p1 on face1, p2 on face2
 	int flag;
 	float time; // collision time, from 0 up to 1
+
+	/* mesh-mesh collision */
 #ifdef WITH_ELTOPO /*either ap* or bp* can be set, but not both*/
 	float bary[3];
 	int ap1, ap2, ap3, collp, bp1, bp2, bp3;
@@ -135,6 +137,8 @@ void bvhtree_update_from_mvert(BVHTree *bvhtree, struct MFace *faces, int numfac
 // defined in collisions.c
 void collision_move_object(struct CollisionModifierData *collmd, float step, float prevstep);
 
+void collision_get_collider_velocity(float vel_old[3], float vel_new[3], struct CollisionModifierData *collmd, struct CollPair *collpair);
+
 /////////////////////////////////////////////////
 // used in effect.c
 /////////////////////////////////////////////////
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index d5e54d8..04853bb 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -136,6 +136,36 @@ int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struc
 /* EffectorData->flag */
 #define PE_VELOCITY_TO_IMPULSE  1
 
+/* ======== Simulation Debugging ======== */
+
+typedef struct SimDebugElement {
+	int category_hash;
+	int hash;
+	
+	int type;
+	float color[3];
+	
+	float v1[3], v2[3];
+} SimDebugElement;
+
+typedef enum eSimDebugElement_Type {
+	SIM_DEBUG_ELEM_DOT,
+	SIM_DEBUG_ELEM_LINE,
+	SIM_DEBUG_ELEM_VECTOR,
+} eSimDebugElement_Type;
+
+typedef struct SimDebugData {
+	struct GHash *gh;
+} SimDebugData;
+
+struct SimDebugData *BKE_sim_debug_data_new(void);
+void BKE_sim_debug_data_add_dot(struct SimDebugData *debug_data, const float p[3], float r, float g, float b, const char *category, int hash);
+void BKE_sim_debug_data_add_line(struct SimDebugData *debug_data, const float p1[3], const float p2[3], float r, float g, float b, const char *category, int hash);
+void BKE_sim_debug_data_add_vector(struct SimDebugData *debug_data, const float p[3], const float d[3], float r, float g, float b, const char *category, int hash);
+void BKE_sim_debug_data_remove(struct SimDebugData *debug_data, int hash);
+void BKE_sim_debug_data_clear(struct SimDebugData *debug_data);
+void BKE_sim_debug_data_clear_category(struct SimDebugData *debug_data, const char *category);
+void BKE_sim_debug_data_free(struct SimDebugData *debug_data);
 
 #endif
 
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index fd201fe..0a5b194 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -36,6 +36,7 @@ set(INC
 	../bmesh
 	../modifiers
 	../nodes
+	../physics
 	../render/extern/include
 	../../../intern/guardedalloc
 	../../../intern/iksolver/extern
@@ -43,8 +44,8 @@ set(INC
 	../../../intern/mikktspace
 	../../../intern/raskter
 	../../../intern/smoke/extern
-	../../../extern/libmv
 	../../../intern/atomic
+	../../../extern/libmv
 
 	# XXX - BAD LEVEL CALL WM_api.h
 	../windowmanager
@@ -102,7 +103,6 @@ set(SRC
 	intern/idprop.c
 	intern/image.c
 	intern/image_gen.c
-	intern/implicit.c
 	intern/ipo.c
 	intern/key.c
 	intern/lamp.c
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 25f8422..6406d13 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -63,6 +63,7 @@ incs = [
     '../makesrna',
     '../modifiers',
     '../nodes',
+    '../physics',
     '../render/extern/include',
     '../windowmanager',
     env['BF_OPENGL_INC'],
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 885f186..0072405 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -47,6 +47,8 @@
 #include "BKE_modifier.h"
 #include "BKE_pointcache.h"
 
+#inc

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list