diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-03-22 12:50:56 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-03-22 12:50:56 +0400 |
commit | f11f6d179eb4cdcbbd8ee1d613c7b0ead07bdda4 (patch) | |
tree | b5f1fddf130da4c2f98daec99a7e8f3aa1dd64bf | |
parent | 75a5e239d765a1d580091ae35515f5b49db3ab90 (diff) |
Fix for compositor node preview sizes: Use the render output aspect ratio for estimating the required preview rect size instead of assuming a square, to avoid wasted space. Note that this does not work for newly added nodes until they have first been evaluated and a preview image has been generated (same behavior as before pynodes merge and associated preview changes).
-rw-r--r-- | source/blender/compositor/intern/COM_compositor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp index 94a27e17b68..a0f660058f9 100644 --- a/source/blender/compositor/intern/COM_compositor.cpp +++ b/source/blender/compositor/intern/COM_compositor.cpp @@ -65,8 +65,10 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering, /* Make sure node tree has previews. * Don't create previews in advance, this is done when adding preview operations. + * Reserved preview size is determined by render output for now. */ - BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, COM_PREVIEW_SIZE, FALSE); + float aspect = rd->xsch > 0 ? (float)rd->ysch / (float)rd->xsch : 1.0; + BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, (int)(COM_PREVIEW_SIZE * aspect), FALSE); /* initialize workscheduler, will check if already done. TODO deinitialize somewhere */ bool use_opencl = (editingtree->flag & NTREE_COM_OPENCL); |