[Bf-blender-cvs] [ebcb822] gooseberry: Merge branch 'alembic' into gooseberry

Lukas Tönne noreply at git.blender.org
Wed May 6 14:02:35 CEST 2015


Commit: ebcb8223bd886fd327cddae1394436e10f1f7a73
Author: Lukas Tönne
Date:   Wed May 6 14:02:29 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBebcb8223bd886fd327cddae1394436e10f1f7a73

Merge branch 'alembic' into gooseberry

Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/blenkernel/intern/customdata.c
	source/blender/blenkernel/intern/key.c
	source/blender/editors/object/object_shapekey.c
	source/blender/makesdna/DNA_customdata_types.h
	source/blender/makesrna/intern/rna_key.c

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



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

diff --cc source/blender/blenkernel/BKE_key.h
index fc7ab6a,4b8e357..906964c
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@@ -40,7 -40,7 +40,8 @@@ struct Curve
  struct Object;
  struct Lattice;
  struct Mesh;
 +struct ParticleSystem;
+ struct Strands;
  struct WeightsArrayCache;
  
  /* Kernel prototypes */
@@@ -51,7 -51,7 +52,8 @@@ extern "C" 
  void        BKE_key_free(struct Key *sc);
  void        BKE_key_free_nolib(struct Key *key);
  struct Key *BKE_key_add(struct ID *id);
+ struct Key *BKE_key_add_ex(struct ID *from, short fromtype);
 +struct Key *BKE_key_add_particles(struct Object *ob, struct ParticleSystem *psys);
  struct Key *BKE_key_copy(struct Key *key);
  struct Key *BKE_key_copy_nolib(struct Key *key);
  void        BKE_key_make_local(struct Key *key);
@@@ -69,11 -66,12 +71,17 @@@ float *BKE_key_evaluate_object_ex
          float *arr, size_t arr_size);
  float *BKE_key_evaluate_object(
          struct Object *ob, int *r_totelem);
+ float *BKE_key_evaluate_strands_ex(
+         struct Strands *strands, struct Key *key, struct KeyBlock *actkb, bool lock_shape,
+         int *r_totelem, float *arr, size_t arr_size);
+ float *BKE_key_evaluate_strands(
+         struct Strands *strand, struct Key *key, struct KeyBlock *actkbs, bool lock_shape,
+         int *r_totelem);
 +float *BKE_key_evaluate_particles_ex(
 +        struct Object *ob, struct ParticleSystem *psys, float cfra, int *r_totelem,
 +        float *arr, size_t arr_size);
 +float *BKE_key_evaluate_particles(
 +        struct Object *ob, struct ParticleSystem *psys, float cfra, int *r_totelem);
  
  struct Key      *BKE_key_from_object(struct Object *ob);
  struct KeyBlock *BKE_keyblock_from_object(struct Object *ob);
@@@ -94,8 -90,8 +102,9 @@@ typedef struct WeightsArrayCache 
  	float **defgroup_weights;
  } WeightsArrayCache;
  
 -float **BKE_keyblock_get_per_block_weights(struct Object *ob, struct Key *key, struct WeightsArrayCache *cache);
 +float **BKE_keyblock_get_per_block_object_weights(struct Object *ob, struct Key *key, struct WeightsArrayCache *cache);
+ float **BKE_keyblock_strands_get_per_block_weights(struct Strands *strands, struct Key *key, struct WeightsArrayCache *cache);
 +float **BKE_keyblock_get_per_block_particle_weights(struct Object *ob, struct ParticleSystem *psys, float cfra, struct Key *key, struct WeightsArrayCache *cache);
  void BKE_keyblock_free_per_block_weights(struct Key *key, float **per_keyblock_weights, struct WeightsArrayCache *cache);
  void BKE_key_evaluate_relative(const int start, int end, const int tot, char *basispoin, struct Key *key, struct KeyBlock *actkb,
                                 float **per_keyblock_weights, const int mode);
@@@ -120,11 -122,9 +135,12 @@@ float (*BKE_keyblock_convert_to_vertcos
  
  void    BKE_keyblock_update_from_offset(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]);
  
 +void    BKE_keyblock_convert_to_hair_keys(struct KeyBlock *kb, struct Object *ob, struct ParticleSystem *psys);
 +void    BKE_keyblock_convert_from_hair_keys(struct Object *ob, struct ParticleSystem *psys, struct KeyBlock *kb);
 +
  /* other management */
  bool    BKE_keyblock_move(struct Object *ob, int org_index, int new_index);
+ bool    BKE_keyblock_move_ex(struct Key *key, int *shapenr, int org_index, int new_index);
  
  bool    BKE_keyblock_is_basis(struct Key *key, const int index);
  
diff --cc source/blender/blenkernel/CMakeLists.txt
index fb87aa8,3c74622..ca3a8fd
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -96,8 -96,8 +96,9 @@@ set(SR
  	intern/editderivedmesh.c
  	intern/editmesh.c
  	intern/editmesh_bvh.c
+ 	intern/editstrands.c
  	intern/effect.c
 +	intern/facemap.c
  	intern/fcurve.c
  	intern/fluidsim.c
  	intern/fmodifier.c
diff --cc source/blender/blenkernel/intern/customdata.c
index 724ca6d,0c57cdc..dac03ff
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@@ -1322,8 -1313,8 +1323,10 @@@ static const LayerTypeInfo LAYERTYPEINF
  	{sizeof(short[4][3]), "", 0, NULL, NULL, NULL, NULL, layerSwap_flnor, NULL},
  	/* 41: CD_CUSTOMLOOPNORMAL */
  	{sizeof(short[2]), "vec2s", 1, NULL, NULL, NULL, NULL, NULL, NULL},
 -	/* 42: CD_MESH_SAMPLE */
 +	/* 42: CD_FACEMAP */
 +	{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, layerDefault_fmap, NULL},
++	/* 43: CD_MSURFACE_SAMPLE */
+ 	{sizeof(MSurfaceSample), "MSurfaceSample", 1, NULL, NULL, NULL, NULL, NULL, NULL},
  };
  
  /* note, numbers are from trunk and need updating for bmesh */
@@@ -1340,7 -1331,7 +1343,8 @@@ static const char *LAYERTYPENAMES[CD_NU
  	/* 30-34 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDPreviewLoopCol", "CDBMElemPyPtr", "CDPaintMask",
  	/* 35-36 */ "CDGridPaintMask", "CDMVertSkin",
  	/* 37-38 */ "CDFreestyleEdge", "CDFreestyleFace",
 -	/* 39-42 */ "CDMLoopTangent", "CDTessLoopNormal", "CDCustomLoopNormal", "CDMSurfaceSample",
 +	/* 39-42 */ "CDMLoopTangent", "CDTessLoopNormal", "CDCustomLoopNormal", "CDFaceMap",
++	/* 43    */ "CDMSurfaceSample",
  };
  
  
@@@ -1389,7 -1391,7 +1404,7 @@@ const CustomDataMask CD_MASK_EVERYTHIN
      /* BMESH ONLY END */
      CD_MASK_PAINT_MASK | CD_MASK_GRID_PAINT_MASK | CD_MASK_MVERT_SKIN |
      CD_MASK_FREESTYLE_EDGE | CD_MASK_FREESTYLE_FACE |
-     CD_MASK_MLOOPTANGENT | CD_MASK_TESSLOOPNORMAL | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_FACEMAP;
 -    CD_MASK_MLOOPTANGENT | CD_MASK_TESSLOOPNORMAL | CD_MASK_CUSTOMLOOPNORMAL;
++    CD_MASK_MLOOPTANGENT | CD_MASK_TESSLOOPNORMAL | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_FACEMAP | CD_MASK_MSURFACE_SAMPLE;
  
  static const LayerTypeInfo *layerType_getInfo(int type)
  {
diff --cc source/blender/blenkernel/intern/key.c
index a1d0680,91aabc1..23d9c07
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@@ -45,14 -45,11 +45,15 @@@
  #include "DNA_anim_types.h"
  #include "DNA_key_types.h"
  #include "DNA_lattice_types.h"
 +#include "DNA_material_types.h"
  #include "DNA_mesh_types.h"
  #include "DNA_meshdata_types.h"
 +#include "DNA_modifier_types.h"
  #include "DNA_object_types.h"
 +#include "DNA_particle_types.h"
  #include "DNA_scene_types.h"
+ #include "DNA_strands_types.h"
 +#include "DNA_texture_types.h"
  
  #include "BKE_animsys.h"
  #include "BKE_curve.h"
@@@ -63,18 -59,13 +64,15 @@@
  #include "BKE_key.h"
  #include "BKE_lattice.h"
  #include "BKE_library.h"
 +#include "BKE_particle.h"
  #include "BKE_editmesh.h"
  #include "BKE_scene.h"
+ #include "BKE_strands.h"
  
 -
  #include "RNA_access.h"
  
 +#include "RE_render_ext.h"
 +
- #define KEY_MODE_DUMMY      0 /* use where mode isn't checked for */
- #define KEY_MODE_BPOINT     1
- #define KEY_MODE_BEZTRIPLE  2
- 
  /* old defines from DNA_ipo_types.h for data-type, stored in DNA - don't modify! */
  #define IPO_FLOAT       4
  #define IPO_BEZTRIPLE   100
@@@ -112,7 -148,8 +155,8 @@@ Key *BKE_key_add_ex(ID *from, short fro
  	key = BKE_libblock_alloc(G.main, ID_KE, "Key");
  	
  	key->type = KEY_NORMAL;
- 	BKE_key_set_from_id(key, id);
 -	key->from = from;
++	BKE_key_set_from_id(key, from);
+ 	key->fromtype = fromtype;
  
  	key->uidgen = 1;
  	
@@@ -153,29 -158,11 +165,34 @@@
  	return key;
  }
  
+ Key *BKE_key_add(ID *id)
+ {
+ 	return BKE_key_add_ex(id, KEY_FROMTYPE_ID);
+ }
+ 
 +Key *BKE_key_add_particles(Object *ob, ParticleSystem *psys)    /* particles are "special" */
 +{
 +	Key *key;
 +	char *el;
 +	
 +	key = BKE_libblock_alloc(G.main, ID_KE, "Key");
 +	
 +	key->type = KEY_NORMAL;
 +	BKE_key_set_from_particles(key, ob, psys);
 +	
 +	key->uidgen = 1;
 +	
 +	el = key->elemstr;
 +	
 +	el[0] = 3;
 +	el[1] = IPO_FLOAT;
 +	el[2] = 0;
 +	
 +	key->elemsize = 12;
 +	
 +	return key;
 +}
 +
  Key *BKE_key_copy(Key *key)
  {
  	Key *keyn;
@@@ -566,7 -531,7 +583,7 @@@ static char *key_block_get_data(Key *ke
  	if (kb == actkb) {
  		/* this hack makes it possible to edit shape keys in
  		 * edit mode with shape keys blending applied */
- 		if (key->from_extra.type == KEY_OWNER_MESH) {
 -		if (key->from && GS(key->from->name) == ID_ME) {
++		if (key->from && key->from_extra.type == KEY_OWNER_MESH) {
  			Mesh *me;
  			BMVert *eve;
  			BMIter iter;
@@@ -598,26 -563,38 +615,42 @@@
  /* currently only the first value of 'ofs' may be set. */
  static bool key_pointer_size(const Key *key, const int mode, int *poinsize, int *ofs)
  {
- 	switch (key->from_extra.type) {
- 		case KEY_OWNER_MESH:
- 			*ofs = sizeof(float) * 3;
- 			*poinsize = *ofs;
- 			break;
- 		case KEY_OWNER_LATTICE:
- 			*ofs = sizeof(float) * 3;
- 			*poinsize = *ofs;
- 			break;
- 		case KEY_OWNER_CURVE:
- 			if (mode == KEY_MODE_BPOINT) {
- 				*ofs = sizeof(float) * 4;
- 				*poinsize = *ofs;
- 			}
- 			else {
- 				ofs[0] = sizeof(float) * 12;
- 				*poinsize = (*ofs) / 3;
+ 	switch (key->fromtype) {
+ 		case KEY_FROMTYPE_ID:
+ 			if (!key->from)
+ 				return false;
+ 			
+ 			switch (GS(key->from->name)) {
+ 				case ID_ME:
+ 					*ofs = sizeof(float) * 3;
+ 					*poinsize = *ofs;
+ 					break;
 -				case ID_LT:
++				case KEY_OWNER_LATTICE:
+ 					*ofs = sizeof(float) * 3;
+ 					*poinsize = *ofs;
+ 					break;
 -				case ID_CU:
++				case KEY_OWNER_CURVE:
+ 					if (mode == KEY_MODE_BPOINT) {
+ 						*ofs = sizeof(float) * 4;
+ 						*poinsize = *ofs;
+ 					}
+ 					else {
+ 						ofs[0] = sizeof(float) * 12;
+ 						*poinsize = (*ofs) / 3;
+ 					}
 -		
+ 					break;
++				case KEY_OWNER_PARTICLES:
++					*ofs = sizeof(float) * 3;
++					*poinsize = *ofs;
++					break;
++		
+ 				default:
+ 					BLI_assert(!"invalid 'key->from' ID type");
+ 					return false;
  			}
  			break;
- 		case KEY_OWNER_PARTICLES:
+ 		
+ 		case KEY_FROMTYPE_STRANDS:
  			*ofs = sizeof(float) * 3;
  			*poinsize = *ofs;
  			break;
@@@ -1174,7 -1161,22 +1217,22 @@@ static float *get_object_weights_array(
  	return NULL;
  }
  
+ static float *get_weights_array_strands(Strands *strands, const char *UNUSED(vgroup), bool is_refkey, WeightsArrayCache *UNUSED(cache))
+ {
+ 	int totvert = strands->totverts;
+ 	
+ 	if (is_refkey) {
+ 		/* for the refkey, return zero weights, so the refkey actually uses the unmodified data */
+ 		float *weights = MEM_callocN(totvert * sizeof(float),

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list