- camera switching didnt work for openGL render

- UV Project (Bounds) wasnt in the menu
This commit is contained in:
Campbell Barton 2009-12-21 11:42:31 +00:00
parent 5832f2fb7b
commit 371571fed6
3 changed files with 12 additions and 14 deletions

@ -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()

@ -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

@ -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);