diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 20 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 838465f1517..4df0b8df0f7 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -4095,6 +4095,12 @@ static void rna_def_space_node(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem insert_ofs_dir_items[] = { + {SNODE_INSERTOFS_DIR_RIGHT, "RIGHT", 0, "Right"}, + {SNODE_INSERTOFS_DIR_LEFT, "LEFT", 0, "Left"}, + {0, NULL, 0, NULL, NULL} + }; + static EnumPropertyItem dummy_items[] = { {0, "DUMMY", 0, "", ""}, {0, NULL, 0, NULL, NULL}}; @@ -4208,6 +4214,20 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); + /* insert offset (called "Auto-offset" in UI) */ + prop = RNA_def_property(srna, "use_insert_offset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNODE_SKIP_INSOFFSET); + RNA_def_property_ui_text(prop, "Auto-offset", "Automatically offset the following or previous nodes in a " + "chain when inserting a new node"); + RNA_def_property_ui_icon(prop, ICON_NODE_INSERT_ON, 1); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); + + prop = RNA_def_property(srna, "insert_offset_direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "insert_ofs_dir"); + RNA_def_property_enum_items(prop, insert_ofs_dir_items); + RNA_def_property_ui_text(prop, "Auto-offset Direction", "Direction to offset nodes on insertion"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); + RNA_api_space_node(srna); } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 5bf8fe76c91..b4ae82290fd 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3848,6 +3848,12 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS); RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object"); + + /* currently only used for insert offset (aka auto-offset), maybe also be useful for later stuff though */ + prop = RNA_def_property(srna, "node_margin", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "node_margin"); + RNA_def_property_ui_text(prop, "Auto-offset Margin", "Minimum distance between nodes for Auto-offsetting nodes"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_system(BlenderRNA *brna) |