- camera switching didnt work for openGL render
authorCampbell Barton <ideasman42@gmail.com>
Mon, 21 Dec 2009 11:42:31 +0000 (11:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 21 Dec 2009 11:42:31 +0000 (11:42 +0000)
- UV Project (Bounds) wasnt in the menu

release/scripts/ui/space_view3d.py
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c

index 0ea9c947d4b14ef66567966288ca51d7ade8f723..fa0a6a8c5fa267e50b7c2885eb38f3839a986604 100644 (file)
@@ -216,6 +216,7 @@ class VIEW3D_MT_uv_map(dynamic_menu.DynMenu):
         layout.operator("uv.cylinder_project")
         layout.operator("uv.sphere_project")
         layout.operator("uv.project_from_view")
+        layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
 
         layout.separator()
 
index 0c690452d8a3d957bb739d72a010b6921b3254b6..6bf01a69d126e51c5397de7c581192bfc1956f59 100644 (file)
@@ -1686,19 +1686,8 @@ void ED_update_for_newframe(const bContext *C, int mute)
                                        while(sl) {
                                                if(sl->spacetype==SPACE_VIEW3D) {
                                                        View3D *v3d= (View3D*) sl;
-                                                       if (v3d->camera == scene->camera) {
+                                                       if (v3d->scenelock) {
                                                                v3d->camera= camera;
-                                                               /*
-                                                               ARegion *ar;
-                                                               for(ar=v3d->regionbase.first; ar; ar= ar->next) {
-                                                                       if(ar->regiontype == RGN_TYPE_WINDOW) {
-                                                                               RegionView3D *rv3d= ar->regiondata;
-
-                                                                               if(rv3d->persp==RV3D_CAMOB)
-                                                                                       rv3d->persp= RV3D_PERSP;
-                                                                       }
-                                                               }
-                                                               */
                                                        }
                                                }
                                                sl= sl->next;
@@ -1709,7 +1698,6 @@ void ED_update_for_newframe(const bContext *C, int mute)
                }
 
                scene->camera= camera;
-
        }
 #endif
 
index 55a977da663d17b4be0b376e4efd36b0828f631e..fe1587a965d609d265652532484aee057e7bfb63 100644 (file)
@@ -3365,7 +3365,16 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
        }
        
        scene_update_for_newframe(scene, scene->lay);
-       
+
+       if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
+               /* since scene_update_for_newframe() is used rather
+                * then ED_update_for_newframe() the camera needs to be set */
+               Object *camera= scene_find_camera_switch(scene);
+
+               if(camera)
+                       oglrender->v3d->camera= scene->camera= camera;
+       }
+
        /* render into offscreen buffer */
        screen_opengl_render_apply(oglrender);