Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/screen.c
| Show First 20 Lines • Show All 502 Lines • ▼ Show 20 Lines | ScrArea *BKE_screen_find_area_xy(bScreen *sc, const int spacetype, int x, int y) | ||||
| } | } | ||||
| return sa_found; | return sa_found; | ||||
| } | } | ||||
| /** | /** | ||||
| * Utility function to get the active layer to use when adding new objects. | * Utility function to get the active layer to use when adding new objects. | ||||
| */ | */ | ||||
| unsigned int BKE_screen_view3d_layer_active_ex(const View3D *v3d, const Scene *scene, bool use_localvd) | unsigned int BKE_screen_view3d_layer_active(const View3D *v3d, const Scene *scene) | ||||
| { | { | ||||
| unsigned int lay; | unsigned int lay; | ||||
| if ((v3d == NULL) || (v3d->scenelock && !v3d->localvd)) { | if ((v3d == NULL) || (v3d->scenelock && !v3d->localviewd)) { | ||||
| lay = scene->layact; | lay = scene->layact; | ||||
| } | } | ||||
| else { | else { | ||||
| lay = v3d->layact; | lay = v3d->layact; | ||||
| } | } | ||||
| if (use_localvd) { | |||||
| if (v3d && v3d->localvd) { | |||||
| lay |= v3d->lay; | |||||
| } | |||||
| } | |||||
| return lay; | return lay; | ||||
| } | } | ||||
| unsigned int BKE_screen_view3d_layer_active(const struct View3D *v3d, const struct Scene *scene) | |||||
| { | |||||
| return BKE_screen_view3d_layer_active_ex(v3d, scene, true); | |||||
| } | |||||
| /** | /** | ||||
| * Accumulate all visible layers on this screen. | * Accumulate all visible layers on this screen. | ||||
| */ | */ | ||||
| unsigned int BKE_screen_view3d_layer_all(const bScreen *sc) | unsigned int BKE_screen_view3d_layer_all(const bScreen *sc) | ||||
| { | { | ||||
| const ScrArea *sa; | const ScrArea *sa; | ||||
| unsigned int lay = 0; | unsigned int lay = 0; | ||||
| for (sa = sc->areabase.first; sa; sa = sa->next) { | for (sa = sc->areabase.first; sa; sa = sa->next) { | ||||
| if (sa->spacetype == SPACE_VIEW3D) { | if (sa->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = sa->spacedata.first; | View3D *v3d = sa->spacedata.first; | ||||
| lay |= v3d->lay; | lay |= v3d->lay; | ||||
| } | } | ||||
| } | } | ||||
| return lay; | return lay; | ||||
| } | } | ||||
| LocalViewInfo BKE_screen_view3d_localview_all(const bScreen *sc) | |||||
| { | |||||
| LocalViewInfo views = {0}; | |||||
| for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { | |||||
| if (sa->spacetype == SPACE_VIEW3D) { | |||||
| View3D *v3d = sa->spacedata.first; | |||||
| if (v3d->localviewd) { | |||||
| views.viewbits |= v3d->localviewd->info.viewbits; | |||||
| } | |||||
| } | |||||
| } | |||||
| return views; | |||||
| } | |||||
| void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene) | void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene) | ||||
| { | { | ||||
| int bit; | int bit; | ||||
| if (v3d->scenelock && v3d->localvd == NULL) { | if (v3d->scenelock && v3d->localviewd == NULL) { | ||||
| v3d->lay = scene->lay; | v3d->lay = scene->lay; | ||||
| v3d->camera = scene->camera; | v3d->camera = scene->camera; | ||||
| if (v3d->camera == NULL) { | if (v3d->camera == NULL) { | ||||
| ARegion *ar; | ARegion *ar; | ||||
| for (ar = v3d->regionbase.first; ar; ar = ar->next) { | for (ar = v3d->regionbase.first; ar; ar = ar->next) { | ||||
| if (ar->regiontype == RGN_TYPE_WINDOW) { | if (ar->regiontype == RGN_TYPE_WINDOW) { | ||||
| ▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines | |||||