Index: release/scripts/startup/bl_ui/space_view3d.py =================================================================== --- release/scripts/startup/bl_ui/space_view3d.py (revisione 43318) +++ release/scripts/startup/bl_ui/space_view3d.py (copia locale) @@ -2347,6 +2347,7 @@ box.prop(bg, "opacity", slider=True) if bg.view_axis != 'CAMERA': box.prop(bg, "size") + box.prop(bg, "rotate") row = box.row(align=True) row.prop(bg, "offset_x", text="X") row.prop(bg, "offset_y", text="Y") Index: source/blender/editors/space_view3d/view3d_draw.c =================================================================== --- source/blender/editors/space_view3d/view3d_draw.c (revisione 43318) +++ source/blender/editors/space_view3d/view3d_draw.c (copia locale) @@ -1497,7 +1497,7 @@ MovieClip *clip; ImBuf *ibuf= NULL, *freeibuf; float vec[4], fac, asp, zoomx, zoomy; - float x1, y1, x2, y2, cx, cy; + float x1, y1, x2, y2, cx, cy, centx, centy; for ( bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next ) { @@ -1595,6 +1595,8 @@ zoomx= (x2-x1)/ibuf->x; zoomy= (y2-y1)/ibuf->y; + centx = x1 + ((x2 - x1)/2); + centy = y1 + ((y2 - y1)/2); /* for some reason; zoomlevels down refuses to use GL_ALPHA_SCALE */ if(zoomx < 1.0f || zoomy < 1.0f) { float tzoom= MIN2(zoomx, zoomy); @@ -1629,6 +1631,10 @@ glPushMatrix(); ED_region_pixelspace(ar); + glTranslatef(centx, centy, 0.0); + glRotatef(bgpic->rotate* 180/M_PI, 0, 0, 1); + glTranslatef(-centx, -centy, 0.0); + glPixelZoom(zoomx, zoomy); glColor4f(1.0f, 1.0f, 1.0f, 1.0f-bgpic->blend); glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect); Index: source/blender/makesdna/DNA_view3d_types.h =================================================================== --- source/blender/makesdna/DNA_view3d_types.h (revisione 43318) +++ source/blender/makesdna/DNA_view3d_types.h (copia locale) @@ -74,7 +74,8 @@ struct ImageUser iuser; struct MovieClip *clip; struct MovieClipUser cuser; - float xof, yof, size, blend; + float xof, yof, size, rotate, blend; + int pad1; short view; short flag; short source, pad; Index: source/blender/makesrna/intern/rna_space.c =================================================================== --- source/blender/makesrna/intern/rna_space.c (revisione 43318) +++ source/blender/makesrna/intern/rna_space.c (copia locale) @@ -1289,6 +1289,11 @@ RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "rotate", PROP_FLOAT, PROP_EULER); + RNA_def_property_float_sdna(prop, NULL, "rotate"); + RNA_def_property_ui_text(prop, "Rotation", "Rotation factor for the background image"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blend"); RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);