Commit: beb93cd2dc8a7681fdccec9f1aca09815e91e01f Author: Julian Eisel Date: Thu Nov 12 21:40:57 2015 +0100 Branches: wiggly-widgets https://developer.blender.org/rBbeb93cd2dc8a7681fdccec9f1aca09815e91e01f
Merge branch 'master' into wiggly-widgets =================================================================== =================================================================== diff --cc source/blender/blenkernel/intern/object.c index 91ead3e,b305387..69455fd --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@@ -422,12 -425,12 +427,14 @@@ void BKE_object_free_ex(Object *ob, boo if (ob->bb) MEM_freeN(ob->bb); ob->bb = NULL; if (ob->adt) BKE_animdata_free((ID *)ob); - if (ob->poselib) ob->poselib->id.us--; - if (ob->gpd) ((ID *)ob->gpd)->us--; + if (ob->poselib) + id_us_min(&ob->poselib->id); + if (ob->gpd) + id_us_min(&ob->gpd->id); if (ob->defbase.first) BLI_freelistN(&ob->defbase); + if (ob->fmaps.first) + BLI_freelistN(&ob->fmaps); if (ob->pose) BKE_pose_free_ex(ob->pose, do_id_user); if (ob->mpath) diff --cc source/blender/editors/screen/area.c index 43b71af,574ae57..0230146 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@@ -2368,47 -2360,6 +2368,48 @@@ void ED_region_grid_draw(ARegion *ar, f glEnd(); } +/* uses the viewplane from the given camera and draws it as a backdrop */ +void ED_region_draw_backdrop_view3d(const bContext *C, struct Object *camera, const float alpha, + const float width, const float height, const float x, const float y, + const float zoomx, const float zoomy, const bool draw_background) +{ + Main *bmain = CTX_data_main(C); + Scene *scene = CTX_data_scene(C); + char err_out[256] = "unknown"; + struct ImBuf *ibuf; + + BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene, scene->lay); + ibuf = ED_view3d_draw_offscreen_imbuf_simple(scene, camera, width, height, IB_rect, + OB_SOLID, false, false, false, - R_ADDSKY, 0, NULL, NULL, err_out); ++ R_ADDSKY, 0, (scene->r.scemode & R_FULL_SAMPLE), ++ NULL, NULL, NULL, err_out); + + if (ibuf == NULL) + return; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glPushMatrix(); + glScalef(zoomx, zoomy, 0.0f); + glTranslatef(x, y, 0.0f); + + /* draw background */ + if (draw_background) { + char col[4]; + + UI_GetThemeColorType4ubv(TH_HIGH_GRAD, SPACE_VIEW3D, col); + glColor4ub(UNPACK3(col), alpha * 255); + glRectf(0, 0, width, height); + } + /* draw the imbuf itself */ + glaDrawImBuf_glsl_ctx(C, ibuf, 0.0f, 0.0f, GL_NEAREST, alpha); + + glPopMatrix(); + glDisable(GL_BLEND); + + IMB_freeImBuf(ibuf); +} + /* If the area has overlapping regions, it returns visible rect for Region *ar */ /* rect gets returned in local region coordinates */ void ED_region_visible_rect(ARegion *ar, rcti *rect) _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs