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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index f3454285682..550463a947a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -137,6 +137,14 @@ EnumPropertyItem snap_element_items[] = {
{0, NULL, 0, NULL, NULL}
};
+EnumPropertyItem snap_node_element_items[] = {
+ {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
+ {SCE_SNAP_MODE_NODE_X, "NODE_X", ICON_SNAP_EDGE, "Node X", "Snap to left/right node border"},
+ {SCE_SNAP_MODE_NODE_Y, "NODE_Y", ICON_SNAP_EDGE, "Node Y", "Snap to top/bottom node border"},
+ {SCE_SNAP_MODE_NODE_XY, "NODE_XY", ICON_SNAP_EDGE, "Node X / Y", "Snap to any node border"},
+ {0, NULL, 0, NULL, NULL}
+};
+
/* workaround for duplice enums,
* have each enum line as a defne then conditionally set it or not
@@ -739,7 +747,7 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
}
static EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext *C, PointerRNA *ptr,
- PropertyRNA *UNUSED(prop), int *free)
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
ID *id = ptr->id.data;
if (id && GS(id->name) == ID_SCE) {
@@ -1673,6 +1681,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, snap_element_items);
RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
+
+ /* node editor uses own set of snap modes */
+ prop = RNA_def_property(srna, "snap_node_element", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "snap_node_mode");
+ RNA_def_property_enum_items(prop, snap_node_element_items);
+ RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to");
+ RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "snap_target");
@@ -1698,7 +1713,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
-
+
/* Grease Pencil */
prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);