[Bf-blender-cvs] [a19fc285c76] PSketch-279: Cleanup: Remove the "transform_mode" property from psculpt brush

Joshua Leung noreply at git.blender.org
Tue May 8 18:03:08 CEST 2018


Commit: a19fc285c7680dc631fa5d52da90397747e08bc6
Author: Joshua Leung
Date:   Sun Dec 31 16:53:47 2017 +1300
Branches: PSketch-279
https://developer.blender.org/rBa19fc285c7680dc631fa5d52da90397747e08bc6

Cleanup: Remove the "transform_mode" property from psculpt brush

This isn't going to be used anymore now (in the meantime at least).
Instead, we'll put these back only if they're actually needed.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/armature/pose_sculpt.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 3b8e43ef905..1feb40a5346 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -928,9 +928,6 @@ class VIEW3D_PT_tools_posemode_sculpt(View3DPanel, Panel):
         if tool in ('CURL', 'STRETCH'):
             layout.row().prop(brush, "xz_mode", expand=True)
 
-        if tool in ('GRAB', 'PUSH', 'DRAW', 'ADJUST', 'TWIST', 'STRETCH', 'RESET'):
-            layout.row().prop(brush, "transform_mode", expand=True)
-
         if tool == 'STRETCH':
             layout.separator()
             layout.prop(brush, "use_volume_preserve")
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index ae370a80b58..aeb29a22a72 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -958,7 +958,7 @@ static void psculpt_brush_grab_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
 			fac = tab->fac;
 		}
 	}
-	printf("%s: %f (%d)\n", pchan->name, fac, pso->is_first);
+	//printf("%s: %f (%d)\n", pchan->name, fac, pso->is_first);
 	
 	/* compute inverse matrix to convert from screen-space to bone space */
 	mul_m4_m4m4(mat, pso->ob->obmat, pchan->bone->arm_mat);
@@ -969,24 +969,16 @@ static void psculpt_brush_grab_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
 	mul_mat3_m4_v3(imat, cvec);
 	mul_v3_fl(cvec, fac);
 	
-	/* apply to bone location? */
-	if ((brush->tfmMode & PSCULPT_BRUSH_NO_TFM) == 0) {
-		/* knock out invalid transforms */
-		if (pchan->protectflag & OB_LOCK_LOCX)
-			cvec[0] = 0.0f;
-		if (pchan->protectflag & OB_LOCK_LOCY)
-			cvec[1] = 0.0f;
-		if (pchan->protectflag & OB_LOCK_LOCZ)
-			cvec[2] = 0.0f;
-		
-		/* apply to bone */
-		add_v3_v3(pchan->loc, cvec);
-	}
+	/* knock out invalid transforms */
+	if (pchan->protectflag & OB_LOCK_LOCX)
+		cvec[0] = 0.0f;
+	if (pchan->protectflag & OB_LOCK_LOCY)
+		cvec[1] = 0.0f;
+	if (pchan->protectflag & OB_LOCK_LOCZ)
+		cvec[2] = 0.0f;
 	
-	/* apply to bendy bone points? */
-	if ((brush->tfmMode & PSCULPT_BRUSH_NO_BBONE) == 0) {
-		// TODO: How to figure out which point to affect?
-	}
+	/* apply to bone */
+	add_v3_v3(pchan->loc, cvec);
 }
 
 /* Adjust ---------------------------------------------- */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 8750463fa9b..fcc1ecf17bb 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1133,7 +1133,7 @@ typedef struct PSculptBrushData {
 	
 	/* Brush Specific Settings */
 	short xzMode;	  /* ePSculptBrush_XZMode */
-	short tfmMode;    /* ePSculptBrush_TransformMode */
+	short pad;
 	
 	/* Volume Preserve Settings */
 	float bulge;
@@ -2368,14 +2368,6 @@ typedef enum ePSculptBrush_XZMode {
 	PSCULPT_BRUSH_DO_Z  = 2
 } ePSculptBrush_XZMode;
 
-/* PSculptBrushData.tfmMode - which set of transforms (normal/bbone) do we affect */
-typedef enum ePSculptBrush_TransformMode {
-	PSCULPT_BRUSH_NO_BBONE = (1 << 0),
-	PSCULPT_BRUSH_NO_TFM   = (1 << 1),
-	
-	PSCULPT_BRUSH_TFM_BOTH = 0,
-} ePSculptBrush_TransformMode;
-
 
 /* toolsettings->skgen_options */
 #define SKGEN_FILTER_INTERNAL	(1 << 0)
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 8e946aad2a4..0882f96d0a3 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1173,12 +1173,6 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
 		{PSCULPT_BRUSH_DO_X, "X", 0, "X", "Affect X axis only"},
 		{PSCULPT_BRUSH_DO_Z, "Z", 0, "Z", "Affect Z axis only"},
 		{0, NULL, 0, NULL, NULL}};
-		
-	static EnumPropertyItem prop_tfm_mode_items[]= {
-		{0, "All", 0, "All", "Affect both normal transforms and Bendy Bones"},
-		{PSCULPT_BRUSH_NO_BBONE, "TRANSFORMS", 0, "Transform", "Affect bone transforms only"},
-		{PSCULPT_BRUSH_NO_TFM,   "BBONES", 0, "BBones", "Affect Bendy Bone properties only"},
-		{0, NULL, 0, NULL, NULL}};
 	
 	StructRNA *srna;
 	PropertyRNA *prop;
@@ -1255,13 +1249,6 @@ static void rna_def_pose_sculpt(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "XZ Axis Behaviour", "Which axes (X and Z) get affected by brush");
 	RNA_def_property_update(prop, 0, "rna_PSculptBrush_update");
 	
-	/* which transforms should get affected */
-	prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE);
-	RNA_def_property_enum_sdna(prop, NULL, "tfmMode");
-	RNA_def_property_enum_items(prop, prop_tfm_mode_items);
-	RNA_def_property_ui_text(prop, "Affect", "Which transforms (normal, Bendy Bones) get affected");
-	RNA_def_property_update(prop, 0, "rna_PSculptBrush_update");
-	
 	/* only include initial bones */
 	prop = RNA_def_property(srna, "use_initial_only", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PSCULPT_BRUSH_FLAG_GRAB_INITIAL);



More information about the Bf-blender-cvs mailing list