Shape Propagate to all back in vertex menu

This commit is contained in:
Campbell Barton 2009-10-27 15:40:56 +00:00
parent 4e7768066e
commit d160891c36
4 changed files with 38 additions and 6 deletions

@ -808,7 +808,7 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
layout.itemO("mesh.faces_shade_smooth")
layout.itemO("mesh.faces_shade_flat")
layout.itemO("mesh.blend_from_shape")
# layout.itemO("mesh.shape_propagate_to_all")
layout.itemO("mesh.shape_propagate_to_all")
layout.itemO("mesh.select_vertex_path")
class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
@ -833,7 +833,7 @@ class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
layout.itemO("mesh.blend_from_shape")
layout.itemO("object.vertex_group_blend")
# uiItemO(layout, "Propagate to All Shapes", 0, "mesh.shape_propagate_to_all");
layout.itemO("mesh.shape_propagate_to_all")
class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
__label__ = "Edges"

@ -5023,14 +5023,12 @@ void MESH_OT_rip(wmOperatorType *ot)
/************************ Shape Operators *************************/
#if 0
void shape_propagate(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op)
static void shape_propagate(Object *obedit, EditMesh *em, wmOperator *op)
{
EditVert *ev = NULL;
Mesh* me = (Mesh*)obedit->data;
Key* ky = NULL;
KeyBlock* kb = NULL;
Base* base=NULL;
if(me->key){
@ -5055,17 +5053,49 @@ void shape_propagate(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op)
return;
}
#if 0
//TAG Mesh Objects that share this data
for(base = scene->base.first; base; base = base->next){
if(base->object && base->object->data == me){
base->object->recalc = OB_RECALC_DATA;
}
}
#endif
DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
return;
}
#endif
static int shape_propagate_to_all_exec(bContext *C, wmOperator *op)
{
Object *obedit= CTX_data_edit_object(C);
Mesh *me= obedit->data;
EditMesh *em= BKE_mesh_get_editmesh(me);
shape_propagate(obedit, em, op);
DAG_id_flush_update(&me->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
return OPERATOR_FINISHED;
}
void MESH_OT_shape_propagate_to_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Shape Propagate";
ot->description= "Apply selected vertex locations to all other shape keys.";
ot->idname= "MESH_OT_shape_propagate_to_all";
/* api callbacks */
ot->exec= shape_propagate_to_all_exec;
ot->poll= ED_operator_editmesh;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int blend_from_shape_exec(bContext *C, wmOperator *op)
{

@ -226,6 +226,7 @@ void MESH_OT_colors_mirror(struct wmOperatorType *ot);
void MESH_OT_delete(struct wmOperatorType *ot);
void MESH_OT_rip(struct wmOperatorType *ot);
void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot);
void MESH_OT_blend_from_shape(struct wmOperatorType *ot);
/* ******************* mesh_layers.c */

@ -139,6 +139,7 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_knife_cut);
WM_operatortype_append(MESH_OT_rip);
WM_operatortype_append(MESH_OT_blend_from_shape);
WM_operatortype_append(MESH_OT_shape_propagate_to_all);
WM_operatortype_append(MESH_OT_uv_texture_add);
WM_operatortype_append(MESH_OT_uv_texture_remove);