[Bf-blender-cvs] [5e2583a836d] custom-manipulators: Remove face-map / armature integration

Campbell Barton noreply at git.blender.org
Thu Jun 15 23:59:19 CEST 2017


Commit: 5e2583a836d66e3c9afdbb82f5bea645613c9fd5
Author: Campbell Barton
Date:   Fri Jun 16 07:58:09 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB5e2583a836d66e3c9afdbb82f5bea645613c9fd5

Remove face-map / armature integration

Since we're unlikely to use this, it's tedious to keep so many
differences from 'blender2.8' branch.

Currently the only difference between this
branch and 2.8 is RNA/Python work-in-progress integration.

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

M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/depsgraph/intern/depsgraph_query.cc
M	source/blender/draw/intern/draw_armature.c
M	source/blender/draw/intern/draw_common.h
M	source/blender/draw/modes/pose_mode.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/armature/pose_utils.c
M	source/blender/editors/include/ED_armature.h
M	source/blender/editors/interface/resources.c
M	source/blender/editors/manipulator_library/CMakeLists.txt
D	source/blender/editors/manipulator_library/facemap3d_manipulator.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/space_view3d/drawarmature.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_manipulators.c
M	source/blender/makesdna/DNA_action_types.h
M	source/blender/makesdna/DNA_armature_types.h
M	source/blender/makesdna/DNA_key_types.h
M	source/blender/makesrna/intern/rna_armature.c
M	source/blender/makesrna/intern/rna_key.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 6d3fa20467a..fa3bf0e79c9 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -34,9 +34,7 @@
  */
 
 struct bPose;
-struct Base;
 struct Bone;
-struct Depsgraph;
 struct GHash;
 struct Main;
 struct bArmature;
@@ -104,8 +102,6 @@ void BKE_pose_where_is(struct Scene *scene, struct Object *ob);
 void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, bool do_extra);
 void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
 
-void BKE_pose_fmap_cache_update(struct Depsgraph *graph, struct Object *ob);
-
 /* get_objectspace_bone_matrix has to be removed still */
 void get_objectspace_bone_matrix(struct Bone *bone, float M_accumulatedMatrix[4][4], int root, int posed);
 void vec_roll_to_mat3(const float vec[3], const float roll, float mat[3][3]);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index d9bc3580935..8a94d4b8666 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -581,7 +581,6 @@ void BKE_pose_copy_data(bPose **dst, const bPose *src, const bool copy_constrain
 		}
 
 		pchan->draw_data = NULL;  /* Drawing cache, no need to copy. */
-		pchan->fmap_data = NULL;  /* Face-Map cache, no need to copy. */
 	}
 
 	/* for now, duplicate Bone Groups too when doing this */
@@ -773,7 +772,6 @@ void BKE_pose_channel_free_ex(bPoseChannel *pchan, bool do_id_user)
 
 	/* Cached data, for new draw manager rendering code. */
 	MEM_SAFE_FREE(pchan->draw_data);
-	MEM_SAFE_FREE(pchan->fmap_data);
 }
 
 void BKE_pose_channel_free(bPoseChannel *pchan)
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 0ecb4522c3e..38b98f1eee6 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -38,7 +38,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_math.h"
-#include "BLI_iterator.h"
 #include "BLI_listbase.h"
 #include "BLI_string.h"
 #include "BLI_ghash.h"
@@ -71,13 +70,9 @@
 #include "BKE_library_remap.h"
 #include "BKE_lattice.h"
 #include "BKE_main.h"
-#include "BKE_modifier.h"
 #include "BKE_object.h"
 #include "BKE_scene.h"
 
-#include "DEG_depsgraph.h"
-#include "DEG_depsgraph_query.h"
-
 #include "BIK_api.h"
 #include "BKE_sketch.h"
 
@@ -2443,73 +2438,3 @@ bPoseChannel *BKE_armature_splineik_solver_find_root(
 	}
 	return rootchan;
 }
-
-void BKE_pose_fmap_cache_update(Depsgraph *graph, Object *ob_pose)
-{
-	if (ELEM(NULL, ob_pose, ob_pose->pose)) {
-		return;
-	}
-
-	bool has_fmap = false;
-	for (bPoseChannel *pchan = ob_pose->pose->chanbase.first; pchan; pchan = pchan->next) {
-		MEM_SAFE_FREE(pchan->fmap_data);
-		if (pchan->bone->flag & BONE_DRAW_FMAP) {
-			has_fmap = true;
-		}
-	}
-
-	if (has_fmap == false) {
-		return;
-	}
-
-	BKE_pose_channels_hash_make(ob_pose->pose);
-
-	Scene *scene = DEG_get_scene(graph);
-
-	VirtualModifierData virtualModifierData;
-
-	DEG_OBJECT_ITER(graph, ob, 0)
-	{
-		if ((ob->type == OB_MESH) && !BLI_listbase_is_empty(&ob->fmaps)) {
-			bool use_ob_fmap = false;
-			ModifierData *md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
-			for (; md; md = md->next) {
-				if (modifier_isEnabled(scene, md, eModifierMode_Realtime) && md->type == eModifierType_Armature) {
-					ArmatureModifierData *amd = (ArmatureModifierData *)md;
-					if (amd->object && (amd->deformflag & ARM_DEF_FACEMAPS)) {
-						if (amd->object == ob_pose) {
-							use_ob_fmap = true;
-							break;
-						}
-					}
-				}
-			}
-
-			/* bone parent */
-			if (use_ob_fmap == false) {
-				if (ob->parent == ob_pose && ob->parsubstr[0]) {
-					use_ob_fmap = true;
-				}
-			}
-
-			if (use_ob_fmap) {
-				/* We know that 'ob' is a mesh that is deformed by 'ob_act'. */
-				for (bFaceMap *fmap = ob->fmaps.first; fmap; fmap = fmap->next) {
-					bPoseChannel *pchan = BKE_pose_channel_find_name(ob_pose->pose, fmap->name);
-					if (pchan && pchan->bone->flag & BONE_DRAW_FMAP) {
-						if (pchan->fmap_data != NULL) {
-							/* XXX, we could support multiple meshes per bone,
-							 * it's a corner-case so only add if users end up needing it. */
-							continue;
-						}
-
-						pchan->fmap_data = MEM_mallocN(sizeof(*pchan->fmap_data), __func__);
-						pchan->fmap_data->object = ob;
-						pchan->fmap_data->fmap = fmap;
-					}
-				}
-			}
-		}
-	}
-	DEG_OBJECT_ITER_END
-}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6b746a3cb67..fc97beb2c7e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5101,7 +5101,6 @@ static void direct_link_pose(FileData *fd, bPose *pose)
 		CLAMP(pchan->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
 
 		pchan->draw_data = NULL;
-		pchan->fmap_data = NULL;
 	}
 	pose->ikdata = NULL;
 	if (pose->ikparam != NULL) {
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 1b0f4158c2a..77542d8deb9 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -2286,6 +2286,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
 
 
 	if (!MAIN_VERSION_ATLEAST(main, 268, 4)) {
+		bScreen *sc;
 		Object *ob;
 
 		for (ob = main->object.first; ob; ob = ob->id.next) {
@@ -2315,6 +2316,26 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
 			}
 		}
 
+		/*
+		 * FIX some files have a zoom level of 0, and was checked during the drawing of the node space
+		 *
+		 * We moved this check to the do versions to be sure the value makes any sense.
+		 */
+		for (sc = main->screen.first; sc; sc = sc->id.next) {
+			ScrArea *sa;
+			for (sa = sc->areabase.first; sa; sa = sa->next) {
+				SpaceLink *sl;
+				for (sl = sa->spacedata.first; sl; sl = sl->next) {
+					if (sl->spacetype == SPACE_NODE) {
+						SpaceNode *snode = (SpaceNode *)sl;
+						if (snode->zoom < 0.02f) {
+							snode->zoom = 1.0;
+						}
+					}
+				}
+			}
+		}
+
 		for (ob = main->object.first; ob; ob = ob->id.next) {
 			bSensor *sens;
 			bTouchSensor *ts;
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 6276a68d050..c8d8e4ee37f 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -201,8 +201,7 @@ void DEG_objects_iterator_next(BLI_Iterator *iter)
 			/* Make sure we have the base collection settings is already populated.
 			 * This will fail when BKE_layer_eval_layer_collection_pre hasn't run yet
 			 * Which usually means a missing call to DAG_id_tag_update(). */
-			BLI_assert((base->collection_properties == NULL) ||
-			           !BLI_listbase_is_empty(&base->collection_properties->data.group));
+			BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group));
 
 			/* Flushing depsgraph data. */
 			deg_flush_base_flags_and_settings(ob,
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c
index 53fa713ffe6..47af8a3c8a4 100644
--- a/source/blender/draw/intern/draw_armature.c
+++ b/source/blender/draw/intern/draw_armature.c
@@ -1021,13 +1021,6 @@ static void draw_points(
 	}
 }
 
-static bool pchan_is_draw_fmap_only(const bArmature *arm, const bPoseChannel *pchan)
-{
-	return ((arm->flag & ARM_POSEMODE) &&
-	        (pchan->fmap_data != NULL) &&
-	        (pchan->bone->flag & BONE_DRAW_FMAP_ONLY));
-}
-
 /** \} */
 
 
@@ -1283,7 +1276,7 @@ static void draw_armature_edit(Object *ob)
 }
 
 /* if const_color is NULL do pose mode coloring */
-static void draw_armature_pose(Object *ob, const float const_color[4], bool is_active)
+static void draw_armature_pose(Object *ob, const float const_color[4])
 {
 	bArmature *arm = ob->data;
 	bPoseChannel *pchan;
@@ -1298,7 +1291,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4], bool is_a
 	}
 
 	// if (!(base->flag & OB_FROMDUPLI)) // TODO
-	if (is_active) {
+	{
 		if (ob->mode & OB_MODE_POSE) {
 			arm->flag |= ARM_POSEMODE;
 		}
@@ -1319,9 +1312,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4], bool is_a
 		arm->layer_used |= bone->layer;
 
 		/* bone must be visible */
-		if ((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 &&
-		    (!pchan_is_draw_fmap_only(arm, pchan)))
-		{
+		if ((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) {
 			if (bone->layer & arm->layer) {
 				const int select_id = is_pose_select ? index : (unsigned int)-1;
 
@@ -1429,15 +1420,15 @@ void DRW_shgroup_armature_object(
 	DRW_object_wire_theme_get(ob, sl, &color);
 
 	DRW_shgroup_armature(ob, pass_bone_solid, pass_bone_wire, NULL, shgrp_relationship_lines);
-	draw_armature_pose(ob, color, OBACT_NEW == ob);
+	draw_armature_pose(ob, color);
 }
 
 void DRW_shgroup_armature_pose(
-        Object *ob, SceneLayer *sl, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *pass_bone_envelope,
+        Object *ob, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *pass_bone_envelope,
         DRWShadingGroup *shgrp_relationship_lines)
 {
 	DRW_shgroup_armature(ob, pass_bone_solid, pass_bone_wire, pass_bone_envelope, shgrp_relationship_lines);
-	draw_armature_pose(ob, NULL, OBACT_NEW == ob);
+	draw_armature_pose(ob, NULL);
 }
 
 void DRW_shgroup_armature_edit(
diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h
index 1ee3a51ccd0..2c597a175ff 100644
--- a/source/blender/draw/intern/draw_common.h
+++ b/source/blender/draw/intern/draw_common.h
@@ -115,7 +115,7 @@ void DRW_shgroup_armature_object(
         struct DRWShadingGroup *shgrp_relationship_lines);
 
 void DRW_shgroup_armature_pose(
-        struct Object *ob, SceneLayer *sl,
+        struct Object *ob,
         struct DRWPass *pass_bone_solid, struct DRWPass *pass_bone_wire, struct DRWPass *pass_bone_envelope,
         struct DRWShadingGroup *shgrp_relationship_lin

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list