diff options
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 95 |
1 files changed, 25 insertions, 70 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 4a15b617360..51d85c0e171 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -144,7 +144,7 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre /* and update depdency graph */ if(update) - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } /* dotile - 1, set the tile flag (from the space image) @@ -173,8 +173,8 @@ void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, i tf->tile= curtile; /* set tile index */ } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); } /*********************** space conversion *********************/ @@ -1170,50 +1170,6 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[ EDBM_free_uv_vert_map(vmap); } -/* ******************** mirror operator **************** */ - -static int mirror_exec(bContext *C, wmOperator *op) -{ - float mat[3][3]; - int axis; - - Mat3One(mat); - axis= RNA_enum_get(op->ptr, "axis"); - - if(axis == 'x') { - /* XXX initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[0], " on X axis"); - Transform(); */ - } - else { - /* XXX initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[1], " on Y axis"); - Transform(); */ - } - - return OPERATOR_FINISHED; -} - -void UV_OT_mirror(wmOperatorType *ot) -{ - static EnumPropertyItem axis_items[] = { - {'x', "MIRROR_X", 0, "Mirror X", "Mirror UVs over X axis."}, - {'y', "MIRROR_Y", 0, "Mirror Y", "Mirror UVs over Y axis."}, - {0, NULL, 0, NULL, NULL}}; - - /* identifiers */ - ot->name= "Mirror"; - ot->idname= "UV_OT_mirror"; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* api callbacks */ - ot->exec= mirror_exec; - ot->poll= ED_operator_uvedit; - - /* properties */ - RNA_def_enum(ot->srna, "axis", axis_items, 'x', "Axis", "Axis to mirror UV locations over."); -} - /* ******************** align operator **************** */ static void weld_align_uv(bContext *C, int tool) @@ -1288,8 +1244,8 @@ static void weld_align_uv(bContext *C, int tool) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); } static int align_exec(bContext *C, wmOperator *op) @@ -1490,8 +1446,8 @@ static int stitch_exec(bContext *C, wmOperator *op) MEM_freeN(uv_average); } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1550,7 +1506,7 @@ static int select_inverse_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1625,7 +1581,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1938,8 +1894,8 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) } } #endif - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_PASS_THROUGH|OPERATOR_FINISHED; } @@ -2060,8 +2016,8 @@ static int select_linked_exec(bContext *C, wmOperator *op) uvedit_pixel_to_float(sima, limit, 0.05f); select_linked(scene, ima, em, limit, NULL, extend); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2126,8 +2082,8 @@ static int unlink_selection_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2381,7 +2337,7 @@ static int border_select_exec(bContext *C, wmOperator *op) } #endif - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2479,7 +2435,7 @@ int circle_select_exec(bContext *C, wmOperator *op) if(select) EM_select_flush(em); else EM_deselect_flush(em); #endif - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2755,8 +2711,8 @@ static int snap_selection_exec(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -2815,7 +2771,7 @@ static int pin_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -2862,7 +2818,7 @@ static int select_pinned_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2897,7 +2853,7 @@ static int hide_exec(bContext *C, wmOperator *op) if(ts->uv_flag & UV_SYNC_SELECTION) { EDBM_hide_mesh(em, swap); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2929,7 +2885,7 @@ static int hide_exec(bContext *C, wmOperator *op) EDBM_validate_selections(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2972,7 +2928,7 @@ static int reveal_exec(bContext *C, wmOperator *op) /* call the mesh function if we are in mesh sync sel */ if(ts->uv_flag & UV_SYNC_SELECTION) { EDBM_reveal_mesh(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2992,7 +2948,7 @@ static int reveal_exec(bContext *C, wmOperator *op) BM_Select(em->bm, efa, 1); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -3140,7 +3096,6 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_snap_selection); WM_operatortype_append(UV_OT_align); - WM_operatortype_append(UV_OT_mirror); WM_operatortype_append(UV_OT_stitch); WM_operatortype_append(UV_OT_weld); WM_operatortype_append(UV_OT_pin); |