[Bf-blender-cvs] [dbb80f2] PSketch: PSculpt: "Reset" brush now respects strength setting

Joshua Leung noreply at git.blender.org
Sun Jan 31 14:29:15 CET 2016


Commit: dbb80f2e5baa6f3de8a0242d70763c0d306579a5
Author: Joshua Leung
Date:   Sun Jan 17 18:22:24 2016 +1300
Branches: PSketch
https://developer.blender.org/rBdbb80f2e5baa6f3de8a0242d70763c0d306579a5

PSculpt: "Reset" brush now respects strength setting

Instead of instantly snapping back to the rest position, the "reset" brush
now respects the strength setting. As a result, it is now possible to use
the reset brush to selectively blend between the rest pose and the current pose.

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

M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/armature/pose_sculpt.c

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

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 6f63675..2502742 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -660,6 +660,7 @@ void BKE_scene_init(Scene *sce)
 	}
 	psculpt->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
 	psculpt->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+	psculpt->brush[PSCULPT_BRUSH_RESET].strength = 1.0f;
 	psculpt->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
 	psculpt->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
 
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index f29c1e5..79e7351 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1074,6 +1074,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 				}
 				pset->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
 				pset->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+				pset->brush[PSCULPT_BRUSH_RESET].strength = 1.0f;
 				pset->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
 				pset->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
 			}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 87f164f..d03b6ae 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -259,6 +259,7 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 				}
 				pset->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
 				pset->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+				pset->brush[PSCULPT_BRUSH_RESET].strength = 1.0f;
 				pset->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
 				pset->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
 			}
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index f73bffc..79b733e 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -859,38 +859,40 @@ static void brush_stretch(tPoseSculptingOp *pso, tPSculptContext *data, bPoseCha
 }
 
 /* clear transforms */
-static void brush_reset(tPoseSculptingOp *UNUSED(pso), tPSculptContext *UNUSED(data), bPoseChannel *pchan, float UNUSED(sco1[2]), float UNUSED(sco2[2]))
+static void brush_reset(tPoseSculptingOp *UNUSED(pso), tPSculptContext *data, bPoseChannel *pchan, float UNUSED(sco1[2]), float UNUSED(sco2[2]))
 {
-	short locks = pchan->protectflag;
+	const short locks = pchan->protectflag;
+	const float fac = data->fac;
 	float eul[3] = {0.0f};
 	
 	/* location locks */
 	if ((locks & OB_LOCK_LOCX) == 0)
-		pchan->loc[0] = 0.0f;
+		pchan->loc[0] = interpf(0.0f, pchan->loc[0], fac);
 	if ((locks & OB_LOCK_LOCY) == 0)
-		pchan->loc[1] = 0.0f;
+		pchan->loc[1] = interpf(0.0f, pchan->loc[1], fac);
 	if ((locks & OB_LOCK_LOCZ) == 0)
-		pchan->loc[2] = 0.0f;
+		pchan->loc[2] = interpf(0.0f, pchan->loc[2], fac);
 		
 	/* rotation locks */
 	if (get_pchan_eul_rotation(eul, NULL, pchan)) {
 		if ((locks & OB_LOCK_ROTX) == 0)
-			eul[0] = 0.0f;
+			eul[0] = interpf(0.0f, eul[0], fac);
 		if ((locks & OB_LOCK_ROTY) == 0)
-			eul[1] = 0.0f;
+			eul[1] = interpf(0.0f, eul[1], fac);
 		if ((locks & OB_LOCK_ROTZ) == 0)
-			eul[2] = 0.0f;
-			
+			eul[2] = interpf(0.0f, eul[2], fac);
+		
+		// do compat euler?
 		set_pchan_eul_rotation(eul, pchan);
 	}
 	
 	/* scaling locks */
 	if ((locks & OB_LOCK_SCALEX) == 0)
-		pchan->size[0] = 1.0f;
+		pchan->size[0] = interpf(1.0f, pchan->size[0], fac);
 	if ((locks & OB_LOCK_SCALEY) == 0)
-		pchan->size[1] = 1.0f;
+		pchan->size[1] = interpf(1.0f, pchan->size[1], fac);
 	if ((locks & OB_LOCK_SCALEZ) == 0)
-		pchan->size[2] = 1.0f;
+		pchan->size[2] = interpf(1.0f, pchan->size[2], fac);
 }
 
 /* "radial" brush */




More information about the Bf-blender-cvs mailing list