Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/screen.c
| Show First 20 Lines • Show All 605 Lines • ▼ Show 20 Lines | for (sl = sa->spacedata.first; sl; sl = sl->next) { | ||||
| if (sl->spacetype == SPACE_VIEW3D) { | if (sl->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = (View3D *) sl; | View3D *v3d = (View3D *) sl; | ||||
| BKE_screen_view3d_sync(v3d, scene); | BKE_screen_view3d_sync(v3d, scene); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* XXX apply D2687 */ | void BKE_screen_transform_orientation_remove(const bScreen *screen, const TransformOrientation *orientation) | ||||
| void BKE_screen_view3d_twmode_remove(View3D *v3d, const int i) | |||||
| { | { | ||||
| const int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); | for (ScrArea *area = screen->areabase.first; area; area = area->next) { | ||||
| if (selected_index == i) { | for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { | ||||
| if (sl->spacetype == SPACE_VIEW3D) { | |||||
| View3D *v3d = (View3D *)sl; | |||||
| if (v3d->custom_orientation == orientation) { | |||||
| /* could also use v3d->custom_orientation->prev. */ | |||||
| v3d->twmode = V3D_MANIP_GLOBAL; | v3d->twmode = V3D_MANIP_GLOBAL; | ||||
| v3d->custom_orientation = NULL; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| else if (selected_index > i) { | |||||
| v3d->twmode--; | |||||
| } | } | ||||
| } | } | ||||
| /* XXX apply D2687 */ | /** | ||||
| void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, Scene *scene, const int i) | * Update active transform orientation pointer of 3D Views for new pointers of transform orientations. | ||||
| */ | |||||
| void BKE_screen_transform_orientations_sanitize(const bScreen *screen, const ListBase *transform_orientations) | |||||
| { | { | ||||
| bScreen *sc; | if (BLI_listbase_is_empty(transform_orientations)) { | ||||
| return; | |||||
| } | |||||
| for (sc = screen_lb->first; sc; sc = sc->id.next) { | for (ScrArea *area = screen->areabase.first; area; area = area->next) { | ||||
| if (sc->scene == scene) { | for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { | ||||
| ScrArea *sa; | |||||
| for (sa = sc->areabase.first; sa; sa = sa->next) { | |||||
| SpaceLink *sl; | |||||
| for (sl = sa->spacedata.first; sl; sl = sl->next) { | |||||
| if (sl->spacetype == SPACE_VIEW3D) { | if (sl->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = (View3D *)sl; | View3D *v3d = (View3D *)sl; | ||||
| BKE_screen_view3d_twmode_remove(v3d, i); | |||||
| } | if (v3d->custom_orientation) { | ||||
| v3d->custom_orientation = BLI_findstring( | |||||
| transform_orientations, v3d->custom_orientation->name, | |||||
| offsetof(TransformOrientation, name)); | |||||
| } | |||||
| else if (v3d->twmode >= V3D_MANIP_CUSTOM) { | |||||
| /* Actually only needed for versioning, but doesn't hurt to enforce | |||||
| * here so avoid the extra 3D view iterations in versioning code. | |||||
| * This should never be reached outside of versioning code anyway. */ | |||||
| v3d->custom_orientation = BLI_findlink(transform_orientations, v3d->twmode - V3D_MANIP_CUSTOM); | |||||
| v3d->twmode = V3D_MANIP_CUSTOM; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* magic zoom calculation, no idea what | /* magic zoom calculation, no idea what | ||||
| * it signifies, if you find out, tell me! -zr | * it signifies, if you find out, tell me! -zr | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||