[Bf-blender-cvs] [aad1649] wiggly-widgets: Get rid of operator, and use facemap name field on shapekey.
Antony Riakiotakis
noreply at git.blender.org
Wed Dec 3 17:16:01 CET 2014
Commit: aad164978ce40c91b04af7dd23befb83161521de
Author: Antony Riakiotakis
Date: Wed Dec 3 16:43:18 2014 +0100
Branches: wiggly-widgets
https://developer.blender.org/rBaad164978ce40c91b04af7dd23befb83161521de
Get rid of operator, and use facemap name field on shapekey.
===================================================================
M release/scripts/startup/bl_ui/properties_data_mesh.py
M source/blender/editors/object/object_intern.h
M source/blender/editors/object/object_ops.c
M source/blender/editors/object/object_shapekey.c
M source/blender/makesdna/DNA_key_types.h
M source/blender/makesrna/intern/rna_key.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index c4e7bbc..28262a1 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -350,9 +350,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
row = layout.row()
row.active = enable_edit_value
row.prop(kb, "value")
- if ob.mode == 'EDIT':
- row.operator("OBJECT_OT_shape_key_dorito_set")
-
+
split = layout.split()
col = split.column(align=True)
@@ -366,7 +364,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
col.label(text="Blend:")
col.prop_search(kb, "vertex_group", ob, "vertex_groups", text="")
col.prop_search(kb, "relative_key", key, "key_blocks", text="")
-
+ col.prop_search(kb, "face_map", ob, "face_maps", text="")
else:
layout.prop(kb, "interpolation")
row = layout.column()
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index d429658..5949588 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -256,7 +256,6 @@ void OBJECT_OT_shape_key_clear(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_retime(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_mirror(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_move(struct wmOperatorType *ot);
-void OBJECT_OT_shape_key_dorito_set(struct wmOperatorType *ot);
/* object_group.c */
void OBJECT_OT_group_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index a3a97eb..2e479f4 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -223,7 +223,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_shape_key_retime);
WM_operatortype_append(OBJECT_OT_shape_key_mirror);
WM_operatortype_append(OBJECT_OT_shape_key_move);
- WM_operatortype_append(OBJECT_OT_shape_key_dorito_set);
WM_operatortype_append(LATTICE_OT_select_all);
WM_operatortype_append(LATTICE_OT_select_more);
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 146ab7a..07dcb59 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -558,48 +558,3 @@ void OBJECT_OT_shape_key_move(wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", slot_move, 0, "Type", "");
}
-
-static int shape_key_dorito_set_poll(bContext *C)
-{
- /* Same as shape_key_mode_exists_poll above, but ensure we have at least two shapes! */
- Object *ob = ED_object_context(C);
- ID *data = (ob) ? ob->data : NULL;
- Key *key = BKE_key_from_object(ob);
-
- return (ob && !ob->id.lib && data && !data->lib && ob->mode == OB_MODE_EDIT && key && key->totkey > 1);
-}
-
-static int shape_key_dorito_set_exec(bContext *C, wmOperator *op)
-{
- Object *ob = ED_object_context(C);
- BMesh *bm = BKE_editmesh_from_object(ob)->bm;
- BMVert *v = BM_mesh_active_vert_get(bm);
-
- Key *key = BKE_key_from_object(ob);
- KeyBlock *kb = BKE_keyblock_from_object(ob);
-
- const int totkey = key->totkey;
- const int act_index = ob->shapenr - 1;
- int new_index;
-
-
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_shape_key_dorito_set(struct wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Set Dorito";
- ot->idname = "OBJECT_OT_shape_key_dorito_set";
- ot->description = "Set vertex that influences the dorito";
-
- /* api callbacks */
- ot->poll = shape_key_dorito_set_poll;
- ot->exec = shape_key_dorito_set_exec;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index 3cf9640..a250ff7 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -62,14 +62,11 @@ typedef struct KeyBlock {
void *data; /* array of shape key values, size is (Key->elemsize * KeyBlock->totelem) */
char name[64]; /* MAX_NAME (unique name, user assigned) */
char vgroup[64]; /* MAX_VGROUP_NAME (optional vertex group), array gets allocated into 'weights' when set */
+ char facemap[64]; /* facemap name, if applicable */
/* ranges, for RNA and UI only to clamp 'curval' */
float slidermin;
float slidermax;
-
- /* dorito relevant code */
- int dorito_index; /* index of dorito vertex in mesh */
- int pad;
} KeyBlock;
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 7d10511..2055e06 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -601,6 +601,11 @@ static void rna_def_keyblock(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
+ prop = RNA_def_property(srna, "face_map", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "facemap");
+ RNA_def_property_ui_text(prop, "Face Map", "Face Map used to initiate interpolation for this shapekey");
+ RNA_def_property_update(prop, 0, "rna_Key_update_data");
+
prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
More information about the Bf-blender-cvs
mailing list