diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-10 18:53:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-10 18:53:36 +0400 |
commit | ba8154e24a8565be692275ba23ed28f0891b7136 (patch) | |
tree | 95ae9e61d5a4a7713f46f952fab61dc3435efe72 /source/blender/blenloader | |
parent | 76ee9783a13ed9e1eb0d4415239ffebdab0a10b7 (diff) |
Keying screen: small fixes and improvements from tomato
- Fixed issues with calculating matte with balance != 0.5
It used to be used concave combination of minimal and maximal
channel values which could be inpredictable.
Use concave combination of two non-major channels sorted
by their index, so such combination would always use the same
coefficients for particular non-major channels.
- Added despill balance slider which defines balance between
non-major channels used for calculating average of two
colors. Difference between average value and pixel value of
major screen channel defines amount of despill. Balance of
0.5 gives the same behavior as it was before this slider
was added.
---
svn merge -r48678:48679 -r48789:48790 ^/branches/soc-2011-tomato
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7133f79f880..6b2ca3bb8b6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7011,6 +7011,21 @@ static void do_version_ntree_dilateerode_264(void *UNUSED(data), ID *UNUSED(id), } } +static void do_version_ntree_keying_despill_balance(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree) +{ + bNode *node; + + for (node = ntree->nodes.first; node; node = node->next) { + if (node->type == CMP_NODE_KEYING) { + NodeKeyingData *data = node->storage; + + if (data->despill_balance == 0.0f) { + data->despill_balance = 0.5f; + } + } + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -7825,6 +7840,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ntreetype->foreach_nodetree(main, NULL, do_version_ntree_dilateerode_264); } + { + bNodeTreeType *ntreetype = ntreeGetType(NTREE_COMPOSIT); + + if (ntreetype && ntreetype->foreach_nodetree) + ntreetype->foreach_nodetree(main, NULL, do_version_ntree_keying_despill_balance); + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ |