True grid snapping for nodes: This snaps nodes to the actual background grid instead...
authorLukas Toenne <lukas.toenne@googlemail.com>
Wed, 6 Nov 2013 17:46:32 +0000 (17:46 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Wed, 6 Nov 2013 17:46:32 +0000 (17:46 +0000)
commit73986000902c34020f581a6ef7395a9259b7f6c2
treeb79234644a3b81a66514abb3fe9e16e877294050
parent480d4317ded845dd69d167c909807290bddd77ab
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.
12 files changed:
release/scripts/startup/bl_ui/space_node.py
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/ED_node.h
source/blender/editors/space_node/node_draw.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c