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
path: root/source
diff options
context:
space:
mode:
authorMichael Fox <mfoxdogg@gmail.com>2009-01-02 12:57:05 +0300
committerMichael Fox <mfoxdogg@gmail.com>2009-01-02 12:57:05 +0300
commit7eefa2a7b9120c694302de2c8f6425ea43067d7c (patch)
tree87866320c42ed5ab7f0de2ab0cf703f6023d3b06 /source
parent52214a5e88949d69b18ae858def39e5dc37001df (diff)
2.5
******* small commit, after some help from ton i have fixed the clear transformation modifiers, they now redraw correctly, they was missing a depsgraph tag, also did a little tidying up
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_edit.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index a2f746a4ba1..9d18d300e99 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1308,15 +1308,15 @@ static int object_clear_location_exec(bContext *C, wmOperator *op)
if ((ob->protectflag & OB_LOCK_LOCZ)==0)
ob->loc[2]= ob->dloc[2]= 0.0f;
}
+ ob->recalc |= OB_RECALC_OB;
}
CTX_DATA_END;
-
- DAG_scene_sort(scene);
+
if(armature_clear==0) /* in this case flush was done */
ED_anim_dag_flush_update(C);
BIF_undo_push("Clear Location");
- ED_region_tag_redraw(CTX_wm_region(C));
+ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
}
@@ -1353,23 +1353,23 @@ static int object_clear_rotation_exec(bContext *C, wmOperator *op)
}
}
else if((G.f & G_WEIGHTPAINT)==0) {
- /* eulers can only get cleared if they are not protected */
- if ((ob->protectflag & OB_LOCK_ROTX)==0)
- ob->rot[0]= ob->drot[0]= 0.0f;
- if ((ob->protectflag & OB_LOCK_ROTY)==0)
- ob->rot[1]= ob->drot[1]= 0.0f;
- if ((ob->protectflag & OB_LOCK_ROTZ)==0)
- ob->rot[2]= ob->drot[2]= 0.0f;
+ /* eulers can only get cleared if they are not protected */
+ if ((ob->protectflag & OB_LOCK_ROTX)==0)
+ ob->rot[0]= ob->drot[0]= 0.0f;
+ if ((ob->protectflag & OB_LOCK_ROTY)==0)
+ ob->rot[1]= ob->drot[1]= 0.0f;
+ if ((ob->protectflag & OB_LOCK_ROTZ)==0)
+ ob->rot[2]= ob->drot[2]= 0.0f;
}
+ ob->recalc |= OB_RECALC_OB;
}
CTX_DATA_END;
-
- DAG_scene_sort(scene);
+
if(armature_clear==0) /* in this case flush was done */
ED_anim_dag_flush_update(C);
BIF_undo_push("Clear Rotation");
- ED_region_tag_redraw(CTX_wm_region(C));
+ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
}
@@ -1406,28 +1406,28 @@ static int object_clear_scale_exec(bContext *C, wmOperator *op)
}
}
else if((G.f & G_WEIGHTPAINT)==0) {
- if ((ob->protectflag & OB_LOCK_SCALEX)==0) {
- ob->dsize[0]= 0.0f;
- ob->size[0]= 1.0f;
- }
- if ((ob->protectflag & OB_LOCK_SCALEY)==0) {
- ob->dsize[1]= 0.0f;
- ob->size[1]= 1.0f;
- }
- if ((ob->protectflag & OB_LOCK_SCALEZ)==0) {
- ob->dsize[2]= 0.0f;
- ob->size[2]= 1.0f;
- }
+ if ((ob->protectflag & OB_LOCK_SCALEX)==0) {
+ ob->dsize[0]= 0.0f;
+ ob->size[0]= 1.0f;
+ }
+ if ((ob->protectflag & OB_LOCK_SCALEY)==0) {
+ ob->dsize[1]= 0.0f;
+ ob->size[1]= 1.0f;
+ }
+ if ((ob->protectflag & OB_LOCK_SCALEZ)==0) {
+ ob->dsize[2]= 0.0f;
+ ob->size[2]= 1.0f;
+ }
}
+ ob->recalc |= OB_RECALC_OB;
}
CTX_DATA_END;
- DAG_scene_sort(scene);
if(armature_clear==0) /* in this case flush was done */
ED_anim_dag_flush_update(C);
BIF_undo_push("Clear Scale");
- ED_region_tag_redraw(CTX_wm_region(C));
+ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, CTX_data_scene(C));
return OPERATOR_FINISHED;
}
@@ -1476,16 +1476,15 @@ static int object_clear_origin_exec(bContext *C, wmOperator *op)
Mat3MulVecfl(mat, v3);
}
}
+ ob->recalc |= OB_RECALC_OB;
}
CTX_DATA_END;
-
-
- DAG_scene_sort(scene);
+
if(armature_clear==0) /* in this case flush was done */
ED_anim_dag_flush_update(C);
BIF_undo_push("Clear origin");
- ED_region_tag_redraw(CTX_wm_region(C));
+ WM_event_add_notifier(C, NC_SCENE|ND_TRANSFORM, CTX_data_scene(C));
return OPERATOR_FINISHED;
}