Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index b26883b8fd6..6833dec2e43 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -70,16 +70,13 @@
ARegion *view3d_has_buttons_region(ScrArea *sa)
{
ARegion *ar, *arnew;
-
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_UI)
- return ar;
+
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if(ar) return ar;
/* add subdiv level; after header */
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_HEADER)
- break;
-
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+
/* is error! */
if(ar==NULL) return NULL;
@@ -147,10 +144,10 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
if(rv3d==NULL) {
ScrArea *sa =CTX_wm_area(C);
if(sa && sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar;
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_WINDOW)
- return ar->regiondata;
+ ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ if(ar) {
+ rv3d= ar->regiondata;
+ }
}
}
return rv3d;
@@ -211,13 +208,18 @@ void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
mul_m4_m4m4(rv3d->viewmatob, ob->obmat, rv3d->viewmat);
mul_m4_m4m4(rv3d->persmatob, ob->obmat, rv3d->persmat);
+ /* initializes object space clipping, speeds up clip tests */
+ ED_view3d_local_clipping(rv3d, ob->obmat);
+}
+
+void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
+{
+ ED_view3d_init_mats_rv3d(ob, rv3d);
+
/* we have to multiply instead of loading viewmatob to make
it work with duplis using displists, otherwise it will
override the dupli-matrix */
glMultMatrixf(ob->obmat);
-
- /* initializes object space clipping, speeds up clip tests */
- ED_view3d_local_clipping(rv3d, ob->obmat);
}
/* ******************** default callbacks for view3d space ***************** */