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:
authorCampbell Barton <ideasman42@gmail.com>2013-02-18 19:47:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-18 19:47:13 +0400
commit4cd487d731a69b1f6c4144eebec56a28e25cd201 (patch)
treefe3f55e739ba6c29a5a0f22dc2477494ff78548f
parentbd7648b2d2835143a3af748608bb87219e994d62 (diff)
checking for V3D_LOCAL was duplicated in transform.c, and both checks not quite correct.
- When checking edimode, make sure its mesh editmode. - Graph editor supports this option but wasn't being checked.
-rw-r--r--release/scripts/modules/bpy_extras/mesh_utils.py3
-rw-r--r--source/blender/editors/transform/transform.c37
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
3 files changed, 21 insertions, 21 deletions
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index d02fd6e34dc..f4fdfece947 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -152,8 +152,7 @@ def edge_face_count_dict(mesh):
faces using each edge.
:rtype: dict
"""
-
- #face_edge_keys = [face.edge_keys for face in ]
+
face_edge_count = {}
loops = mesh.loops
edges = mesh.edges
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index e5b4a6c7bae..a8efd998583 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -104,6 +104,16 @@ static int doVertSlide(TransInfo *t, float perc);
static void drawEdgeSlide(const struct bContext *C, TransInfo *t);
static void drawVertSlide(const struct bContext *C, TransInfo *t);
+static bool transdata_check_local_center(TransInfo *t)
+{
+ return ((t->around == V3D_LOCAL) && (
+ (t->flag & (T_OBJECT | T_POSE)) ||
+ (t->obedit && t->obedit->type == OB_MESH && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
+ (t->obedit && t->obedit->type == OB_ARMATURE) ||
+ (t->spacetype == SPACE_IPO))
+ );
+}
+
/* ************************** SPACE DEPENDANT CODE **************************** */
void setTransformViewMatrices(TransInfo *t)
@@ -3005,12 +3015,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
}
/* local constraint shouldn't alter center */
- if ((t->around == V3D_LOCAL) &&
- ( (t->flag & (T_OBJECT | T_POSE)) ||
- ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
- (t->obedit && t->obedit->type == OB_ARMATURE))
- )
- {
+ if (transdata_check_local_center(t)) {
copy_v3_v3(center, td->center);
}
else if (t->options & CTX_MOVIECLIP) {
@@ -3387,20 +3392,16 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
{
float vec[3], totmat[3][3], smat[3][3];
float eul[3], fmat[3][3], quat[4];
- float *center = t->center;
+ const float *center;
/* local constraint shouldn't alter center */
- if (around == V3D_LOCAL) {
- if ( (t->flag & (T_OBJECT | T_POSE)) ||
- (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE)) ||
- (t->obedit && t->obedit->type == OB_ARMATURE))
- {
- center = td->center;
- }
-
- if (t->options & CTX_MOVIECLIP) {
- center = td->center;
- }
+ if (transdata_check_local_center(t) ||
+ ((around == V3D_LOCAL) && (t->options & CTX_MOVIECLIP)))
+ {
+ center = td->center;
+ }
+ else {
+ center = t->center;
}
if (t->flag & T_POINTS) {
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index a742e6d4a1a..0ab74fb617f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2548,7 +2548,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- /* this is basically the same as the one for the 3D-View, but with some entries ommitted */
+ /* this is basically the same as the one for the 3D-View, but with some entries omitted */
static EnumPropertyItem gpivot_items[] = {
{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},