2.5
View3D: snap menu (SHIFT+S) back. All options are own operators, a (temp?) menu collects them all. Note that the operators have a full name, for the menu it seems too much; still I'd prefer a way to name operators in a way it fits everywhere. That will make a unified translation system possible for example. Also: this code was needed to get 'center view' (numpad dot) in editmode to work. Last note; it uses old transform code to gather vertex info. This is fully local to this C file, and quite simple to replace in future with new transform.
This commit is contained in:
@@ -120,11 +120,12 @@ void EM_selectmode_set(struct EditMesh *em);
|
||||
void EM_select_flush(struct EditMesh *em);
|
||||
void EM_convertsel(struct EditMesh *em, short oldmode, short selectmode);
|
||||
void EM_validate_selections(struct EditMesh *em);
|
||||
|
||||
|
||||
/* exported to transform */
|
||||
int EM_get_actSelection(struct EditMesh *em, struct EditSelection *ese);
|
||||
void EM_editselection_normal(float *normal, struct EditSelection *ese);
|
||||
void EM_editselection_plane(float *plane, struct EditSelection *ese);
|
||||
void EM_editselection_center(float *center, struct EditSelection *ese);
|
||||
|
||||
struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_face_idx_array, float *limit);
|
||||
struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
|
||||
|
@@ -324,6 +324,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
|
||||
switch(wmn->category) {
|
||||
case NC_SCENE:
|
||||
switch(wmn->data) {
|
||||
case ND_TRANSFORM:
|
||||
case ND_FRAME:
|
||||
case ND_OB_ACTIVE:
|
||||
case ND_OB_SELECT:
|
||||
|
@@ -956,7 +956,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
|
||||
|
||||
|
||||
if(obedit) {
|
||||
// XXX ok = minmax_verts(min, max); /* only selected */
|
||||
ok = minmax_verts(obedit, min, max); /* only selected */
|
||||
}
|
||||
else if(ob && (ob->flag & OB_POSEMODE)) {
|
||||
if(ob->pose) {
|
||||
@@ -1042,6 +1042,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_viewcenter(wmOperatorType *ot)
|
||||
{
|
||||
|
||||
|
@@ -144,6 +144,17 @@ void VIEW3D_OT_properties(struct wmOperatorType *ot);
|
||||
|
||||
void view3d_buttons_area_defbuts(const struct bContext *C, ARegion *ar);
|
||||
|
||||
/* view3d_snap.c */
|
||||
int minmax_verts(Object *obedit, float *min, float *max);
|
||||
|
||||
void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_selected_to_cursor(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_selected_to_center(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_snap_menu(struct wmOperatorType *ot);
|
||||
|
||||
/* space_view3d.c */
|
||||
ARegion *view3d_has_buttons_region(ScrArea *sa);
|
||||
|
||||
|
@@ -92,6 +92,14 @@ void view3d_operatortypes(void)
|
||||
WM_operatortype_append(VIEW3D_OT_editmesh_face_toolbox);
|
||||
WM_operatortype_append(VIEW3D_OT_properties);
|
||||
WM_operatortype_append(VIEW3D_OT_localview);
|
||||
|
||||
WM_operatortype_append(VIEW3D_OT_snap_selected_to_grid);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_selected_to_cursor);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_selected_to_center);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_grid);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_selected);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_active);
|
||||
WM_operatortype_append(VIEW3D_OT_snap_menu);
|
||||
|
||||
transform_operatortypes();
|
||||
}
|
||||
@@ -181,6 +189,8 @@ void view3d_keymap(wmWindowManager *wm)
|
||||
|
||||
WM_keymap_add_item(keymap, "VIEW3D_OT_set_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
/* radial control */
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
||||
|
1148
source/blender/editors/space_view3d/view3d_snap.c
Normal file
1148
source/blender/editors/space_view3d/view3d_snap.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user