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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-22 20:35:51 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-22 20:35:51 +0400
commit3ffb695b10bd85f7cd431f6144dbc2c427a365ee (patch)
tree008509058f8da92056c567e50951d48438a35c82 /source/blender/editors/object/object_shapekey.c
parentb06640c583ed9900223855004d8e9cd6947adf21 (diff)
Shape Keys
Blended shape keys can now be displayed & edited in edit mode. This is much like showing an armature modifier in edit mode, and shape keys now are a applied as a virtual modifier (for mesh & lattice only, curve doesn't fit in the stack well due to tilt). The main thing missing still is being able to switch between the active shape key in edit mode, that's more complicated.. but the weights of other shapes can be edited while in edit mode. One thing to be careful about is that this does automatic crazyspace correction, which means that if you edit a shape key with a low value, the actual vertices will be moved to correct for that and actually move a (potentially much) longer distance. Also includes some UI tweaks, mainly placing some buttons horizontally since the vertical list was getting too long.
Diffstat (limited to 'source/blender/editors/object/object_shapekey.c')
-rw-r--r--source/blender/editors/object/object_shapekey.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 5f3d73ec348..4d4dd7a0738 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -544,6 +544,13 @@ static int ED_object_shape_key_mirror(bContext *C, Scene *scene, Object *ob)
/********************** shape key operators *********************/
+static int shape_key_mode_poll(bContext *C)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ ID *data= (ob)? ob->data: NULL;
+ return (ob && !ob->id.lib && data && !data->lib && ob->mode != OB_MODE_EDIT);
+}
+
static int shape_key_poll(bContext *C)
{
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
@@ -569,7 +576,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot)
ot->idname= "OBJECT_OT_shape_key_add";
/* api callbacks */
- ot->poll= shape_key_poll;
+ ot->poll= shape_key_mode_poll;
ot->exec= shape_key_add_exec;
/* flags */
@@ -594,7 +601,7 @@ void OBJECT_OT_shape_key_remove(wmOperatorType *ot)
ot->idname= "OBJECT_OT_shape_key_remove";
/* api callbacks */
- ot->poll= shape_key_poll;
+ ot->poll= shape_key_mode_poll;
ot->exec= shape_key_remove_exec;
/* flags */
@@ -652,7 +659,7 @@ void OBJECT_OT_shape_key_mirror(wmOperatorType *ot)
ot->idname= "OBJECT_OT_shape_key_mirror";
/* api callbacks */
- ot->poll= shape_key_poll;
+ ot->poll= shape_key_mode_poll;
ot->exec= shape_key_mirror_exec;
/* flags */
@@ -710,7 +717,7 @@ void OBJECT_OT_shape_key_move(wmOperatorType *ot)
ot->idname= "OBJECT_OT_shape_key_move";
/* api callbacks */
- ot->poll= shape_key_poll;
+ ot->poll= shape_key_mode_poll;
ot->exec= shape_key_move_exec;
/* flags */