Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_view.c
| Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | void VIEW3D_OT_camera_to_view(wmOperatorType *ot) | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| /* unlike VIEW3D_OT_view_selected this is for framing a render and not | /* unlike VIEW3D_OT_view_selected this is for framing a render and not | ||||
| * meant to take into account vertex/bone selection for eg. */ | * meant to take into account vertex/bone selection for eg. */ | ||||
| static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op) | static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); /* can be NULL */ | View3D *v3d = CTX_wm_view3d(C); /* can be NULL */ | ||||
| Object *camera_ob = v3d ? v3d->camera : scene->camera; | Object *camera_ob = v3d ? v3d->camera : scene->camera; | ||||
| float r_co[3]; /* the new location to apply */ | float r_co[3]; /* the new location to apply */ | ||||
| float r_scale; /* only for ortho cameras */ | float r_scale; /* only for ortho cameras */ | ||||
| if (camera_ob == NULL) { | if (camera_ob == NULL) { | ||||
| BKE_report(op->reports, RPT_ERROR, "No active camera"); | BKE_report(op->reports, RPT_ERROR, "No active camera"); | ||||
| ▲ Show 20 Lines • Show All 763 Lines • ▼ Show 20 Lines | |||||
| finally: | finally: | ||||
| if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */ | if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */ | ||||
| UI_Theme_Restore(&theme_state); | UI_Theme_Restore(&theme_state); | ||||
| return hits; | return hits; | ||||
| } | } | ||||
| int ED_view3d_scene_layer_set(int lay, const int *values, int *active) | int ED_view3d_view_layer_set(int lay, const int *values, int *active) | ||||
| { | { | ||||
| int i, tot = 0; | int i, tot = 0; | ||||
| /* ensure we always have some layer selected */ | /* ensure we always have some layer selected */ | ||||
| for (i = 0; i < 20; i++) | for (i = 0; i < 20; i++) | ||||
| if (values[i]) | if (values[i]) | ||||
| tot++; | tot++; | ||||
| ▲ Show 20 Lines • Show All 418 Lines • Show Last 20 Lines | |||||