Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-11-06 21:46:32 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-11-06 21:46:32 +0400
commit73986000902c34020f581a6ef7395a9259b7f6c2 (patch)
treeb79234644a3b81a66514abb3fe9e16e877294050 /source/blender/editors/include/ED_node.h
parent480d4317ded845dd69d167c909807290bddd77ab (diff)
True grid snapping for nodes: This snaps nodes to the actual background grid instead of using incremental offset (which is not useful for nodes). Increment snapping has been disabled for nodes to avoid
confusion, grid snap is now the default as it seems to be the most wanted and easy to use mode. Absolute grid snapping happens in a somewhat generic function 'applyGridAbsolute', which could also be used for objects and other transforms later on. It is conceptually similar to the 'project' snapping option, in that it calculates a delta vector for each element on top of the overall transform, which places each node on the grid. Node transform now uses the top-left node corner for TransformData->loc. The transform center is still the average of node centers, so that scaling and rotation works nicely. snapGrid*** functions have been renamed to snapGridIncrement*** to distinguish better between incremental and absolute grid snapping.
Diffstat (limited to 'source/blender/editors/include/ED_node.h')
-rw-r--r--source/blender/editors/include/ED_node.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h
index 2f16d84aed0..de83df9cc05 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -54,6 +54,8 @@ typedef enum {
NODE_RIGHT = 8
} NodeBorder;
+#define NODE_GRID_STEPS 5
+
/* space_node.c */
int ED_node_tree_path_length(struct SpaceNode *snode);
void ED_node_tree_path_get(struct SpaceNode *snode, char *value);
@@ -81,6 +83,7 @@ void ED_node_tree_update(const struct bContext *C);
void ED_node_tag_update_id(struct ID *id);
void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree);
void ED_node_sort(struct bNodeTree *ntree);
+float ED_node_grid_size(void);
/* node_relationships.c */
void ED_node_link_intersect_test(struct ScrArea *sa, int test);