Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2018-05-29 13:26:59 +0300
committerJoshua Leung <aligorith@gmail.com>2018-05-29 13:27:04 +0300
commit03b0495d041da3789012d00624d56de2503abec1 (patch)
tree4cb46537e2509c71927149b0c72756a97cf0274b
parent756b70c6c34d596558f6fadf808ecb2a4bf8e3bf (diff)
Fix: Only change transform mode from translation to rotation/scale when no valid bones were found in an armature
This commit fixes a problem the Spring team were having in the shot files 01_030/050 with the camera rig, where when you tried grabbing/translating the bones of the camera rig, they would only keep rotating/scaling instead. The reason for this is that with the multi-object editing support added into the transform system, this code would now get run for all the other objects that were being included in Pose Mode, even if no bones from those armatures were selected. Since no valid translatable bones were found in those other armatures, the transform mode would get reset upon encountering one of those other bones.
-rw-r--r--source/blender/editors/transform/transform_conversions.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index c8b09eef04b..49ac60df315 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -810,13 +810,18 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
}
}
- /* if there are no translatable bones, do rotation */
- if (mode == TFM_TRANSLATION && !has_translation) {
- if (has_rotation) {
- *out_mode = TFM_ROTATION;
- }
- else {
- *out_mode = TFM_RESIZE;
+ /* only modify transform mode if there are bones here that do something...
+ * otherwise we get problems when multiple objects are selected
+ */
+ if (total) {
+ /* if there are no translatable bones, do rotation */
+ if (mode == TFM_TRANSLATION && !has_translation) {
+ if (has_rotation) {
+ *out_mode = TFM_ROTATION;
+ }
+ else {
+ *out_mode = TFM_RESIZE;
+ }
}
}