diff options
author | Monique Dewanchand <m.dewanchand@atmind.nl> | 2013-01-31 19:08:37 +0400 |
---|---|---|
committer | Monique Dewanchand <m.dewanchand@atmind.nl> | 2013-01-31 19:08:37 +0400 |
commit | a5cef69a0dc0b86d13d2fd16695db77094804c96 (patch) | |
tree | 14b0cc6af503f4f2ed6cbecd023effa77a7378ee /source/blender/nodes | |
parent | 3a4c317b877c3c5c061808d2aa8a437fe30d5eee (diff) |
Apply patch [#33999] Wrapping mode for the "translate" compositing node
this patch enables the translate node to wrap around the image borders. This is especially needed if the translate node is not used to position elements on a layer but when it is used instead for seamless backgrounds like mountains or clouds that should be repeated over time (by animating the x/y values).
No trunk without docs! So here is my documentation: http://wiki.blender.org/index.php/User:Plasmasolutions/TranslateNodeExtension
The code is properly documented and should be easy to read and understand. When there are any problems or issues, please comment, I'll tackle them right away!
Greetings, Thomas Beck
* optimized determination dependant areas
* fixed some issues with scale node
There are still some issues when scaling very small values (x=0.0001)
- At Mind -
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_translate.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.c b/source/blender/nodes/composite/nodes/node_composite_translate.c index 7c7c6304d27..60b32563569 100644 --- a/source/blender/nodes/composite/nodes/node_composite_translate.c +++ b/source/blender/nodes/composite/nodes/node_composite_translate.c @@ -46,6 +46,12 @@ static bNodeSocketTemplate cmp_node_translate_out[] = { { -1, 0, "" } }; +static void node_composit_init_translate(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) +{ + NodeTranslateData *data = MEM_callocN(sizeof(NodeTranslateData), "node translate data"); + node->storage = data; +} + void register_node_type_cmp_translate(bNodeTreeType *ttype) { static bNodeType ntype; @@ -53,6 +59,8 @@ void register_node_type_cmp_translate(bNodeTreeType *ttype) node_type_base(ttype, &ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS); node_type_socket_templates(&ntype, cmp_node_translate_in, cmp_node_translate_out); node_type_size(&ntype, 140, 100, 320); + node_type_init(&ntype, node_composit_init_translate); + node_type_storage(&ntype, "NodeTranslateData", node_free_standard_storage, node_copy_standard_storage); nodeRegisterType(ttype, &ntype); } |