diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-21 15:19:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-21 15:19:16 +0400 |
commit | f9467d28b99a620631ed1c2d249532b2dba46f67 (patch) | |
tree | d6b16f77679766ee8fe69094c88f9234fe6dad2a /source/blender/editors/mesh | |
parent | fd44038ed754f58ddfe48228bfb5fa41ea367e65 (diff) |
remove sticky coordinates from blender, this was missing from the UI since 2.49.
TODO - drop support from the renderer still.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 184 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 5 |
3 files changed, 0 insertions, 193 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 1417641e803..c6bff317584 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -747,118 +747,6 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/*********************** sticky operators ************************/ - -static Object *mesh_customdata_get_camera_for_sticky(wmOperator *op, Scene *scene, View3D *v3d) -{ - /* report an error if we can't find the camera */ - - Object *camera = NULL; - if (scene->obedit) { - BKE_report(op->reports, RPT_ERROR, "Unable to make sticky in Edit Mode"); - } - else { - if (v3d) camera = V3D_CAMERA_LOCAL(v3d); - if (camera == NULL) camera = scene->camera; - - if (camera == NULL) { - BKE_report(op->reports, RPT_ERROR, "Need camera to make sticky"); - } - } - - return camera; -} - -static int mesh_customdata_add_sticky_selected_exec(bContext *C, wmOperator *op) -{ - Scene *scene = CTX_data_scene(C); - View3D *v3d = CTX_wm_view3d(C); - Object *camera = mesh_customdata_get_camera_for_sticky(op, scene, v3d); - LinkNode *objects = NULL; - LinkNode *ob_iter; - - if (camera == NULL) { - return OPERATOR_CANCELLED; - } - - CTX_DATA_BEGIN(C, Object *, ob, selected_editable_objects) - { - if (ob->type == OB_MESH) { - BLI_linklist_prepend(&objects, ob); - } - } - CTX_DATA_END; - - if (objects == NULL) { - return OPERATOR_CANCELLED; - } - - RE_make_sticky(scene, camera, objects); - - for (ob_iter = objects; ob_iter; ob_iter = ob_iter->next) { - Object *ob = ob_iter->link; - DAG_id_tag_update(ob->data, 0); - WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); - } - - BLI_linklist_free(objects, NULL); - - return OPERATOR_FINISHED; -} - -void MESH_OT_customdata_create_sticky_selected(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Calculate Sticky for Selection"; - ot->description = "Calculate sticky UV texture layer from the camera on selected objects"; - ot->idname = "MESH_OT_customdata_create_sticky_selected"; - - /* api callbacks */ - ot->poll = layers_poll; - ot->exec = mesh_customdata_add_sticky_selected_exec; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -static int mesh_customdata_add_sticky_exec(bContext *C, wmOperator *op) -{ - Object *obedit = ED_object_context(C); - Scene *scene = CTX_data_scene(C); - View3D *v3d = CTX_wm_view3d(C); - Object *camera = mesh_customdata_get_camera_for_sticky(op, scene, v3d); - LinkNode objects = {NULL}; - - if (camera == NULL) { - return OPERATOR_CANCELLED; /* error is set */ - } - - objects.link = obedit; - objects.next = NULL; - - RE_make_sticky(scene, camera, &objects); - - DAG_id_tag_update(obedit->data, 0); - WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); - - return OPERATOR_FINISHED; -} - -void MESH_OT_customdata_create_sticky(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Calculate Sticky"; - ot->description = "Calculate sticky UV texture layer from the camera"; - ot->idname = "MESH_OT_customdata_create_sticky"; - - /* api callbacks */ - ot->poll = layers_poll; - ot->exec = mesh_customdata_add_sticky_exec; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - /* *** CustomData clear functions, we need an operator for each *** */ static int mesh_customdata_clear_exec__internal(bContext *C, @@ -925,78 +813,6 @@ void MESH_OT_customdata_clear_mask(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* Clear Sticky */ -static int mesh_customdata_clear_sticky_poll(bContext *C) -{ - Object *ob = ED_object_context(C); - - if (ob && ob->type == OB_MESH) { - Mesh *me = ob->data; - if (me->id.lib == NULL) { - CustomData *data = GET_CD_DATA(me, vdata); - if (CustomData_has_layer(data, CD_MSTICKY)) { - return TRUE; - } - } - } - return FALSE; -} -static int mesh_customdata_clear_sticky_exec(bContext *C, wmOperator *UNUSED(op)) -{ - return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MSTICKY); -} - -void MESH_OT_customdata_clear_sticky(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Clear Sticky Data"; - ot->idname = "MESH_OT_customdata_clear_sticky"; - ot->description = "Clear vertex sticky UV texture layer"; - - /* api callbacks */ - ot->exec = mesh_customdata_clear_sticky_exec; - ot->poll = mesh_customdata_clear_sticky_poll; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -/* Clear Skin */ -static int mesh_customdata_clear_skin_poll(bContext *C) -{ - Object *ob = ED_object_context(C); - - if (ob && ob->type == OB_MESH) { - Mesh *me = ob->data; - if (me->id.lib == NULL) { - CustomData *data = GET_CD_DATA(me, vdata); - if (CustomData_has_layer(data, CD_MVERT_SKIN)) { - return TRUE; - } - } - } - return FALSE; -} -static int mesh_customdata_clear_skin_exec(bContext *C, wmOperator *UNUSED(op)) -{ - return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MVERT_SKIN); -} - -void MESH_OT_customdata_clear_skin(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Clear Skin Data"; - ot->idname = "MESH_OT_customdata_clear_skin"; - ot->description = "Clear vertex skin layer"; - - /* api callbacks */ - ot->exec = mesh_customdata_clear_skin_exec; - ot->poll = mesh_customdata_clear_skin_poll; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - /************************** Add Geometry Layers *************************/ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface) diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 82da2aedd47..786910dc938 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -187,12 +187,8 @@ void MESH_OT_uv_texture_add(struct wmOperatorType *ot); void MESH_OT_uv_texture_remove(struct wmOperatorType *ot); void MESH_OT_vertex_color_add(struct wmOperatorType *ot); void MESH_OT_vertex_color_remove(struct wmOperatorType *ot); -void MESH_OT_customdata_create_sticky_selected(struct wmOperatorType *ot); -void MESH_OT_customdata_create_sticky(struct wmOperatorType *ot); -void MESH_OT_customdata_clear_sticky(struct wmOperatorType *ot); /* no create_mask yet */ void MESH_OT_customdata_clear_mask(struct wmOperatorType *ot); -void MESH_OT_customdata_clear_skin(struct wmOperatorType *ot); void MESH_OT_drop_named_image(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 840f0498e7e..3c92df3dc8e 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -134,7 +134,6 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_vertices_smooth); WM_operatortype_append(MESH_OT_noise); WM_operatortype_append(MESH_OT_flip_normals); - //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); @@ -143,11 +142,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_uv_texture_remove); WM_operatortype_append(MESH_OT_vertex_color_add); WM_operatortype_append(MESH_OT_vertex_color_remove); - WM_operatortype_append(MESH_OT_customdata_create_sticky_selected); - WM_operatortype_append(MESH_OT_customdata_create_sticky); - WM_operatortype_append(MESH_OT_customdata_clear_sticky); WM_operatortype_append(MESH_OT_customdata_clear_mask); - WM_operatortype_append(MESH_OT_customdata_clear_skin); WM_operatortype_append(MESH_OT_drop_named_image); WM_operatortype_append(MESH_OT_edgering_select); |