diff options
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_enum_items.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 15 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/makesrna/RNA_enum_items.h b/source/blender/makesrna/RNA_enum_items.h index fd264932363..7c6a434a97a 100644 --- a/source/blender/makesrna/RNA_enum_items.h +++ b/source/blender/makesrna/RNA_enum_items.h @@ -21,7 +21,7 @@ DEF_ENUM(rna_enum_metaelem_type_items) DEF_ENUM(rna_enum_proportional_falloff_items) DEF_ENUM(rna_enum_proportional_falloff_curve_only_items) -DEF_ENUM(rna_enum_snap_target_items) +DEF_ENUM(rna_enum_snap_source_items) DEF_ENUM(rna_enum_snap_element_items) DEF_ENUM(rna_enum_snap_node_element_items) DEF_ENUM(rna_enum_curve_fit_method_items) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9b8e94db081..3b739561f9a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -92,11 +92,11 @@ static const EnumPropertyItem uv_sculpt_relaxation_items[] = { }; #endif -const EnumPropertyItem rna_enum_snap_target_items[] = { - {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"}, - {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"}, - {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"}, - {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"}, +const EnumPropertyItem rna_enum_snap_source_items[] = { + {SCE_SNAP_SOURCE_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"}, + {SCE_SNAP_SOURCE_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"}, + {SCE_SNAP_SOURCE_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"}, + {SCE_SNAP_SOURCE_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"}, {0, NULL, 0, NULL, NULL}, }; @@ -3306,9 +3306,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) "Absolute grid alignment while translating (based on the pivot center)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ + /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid + * previous ambiguity of "target" (now, "source" is geometry to be moved and "target" is + * geometry to which moved geometry is snapped). */ prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "snap_target"); - RNA_def_property_enum_items(prop, rna_enum_snap_target_items); + RNA_def_property_enum_items(prop, rna_enum_snap_source_items); RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 200e1d65caf..3953fc66fc8 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -140,7 +140,7 @@ static void rna_Scene_ray_cast(Scene *scene, depsgraph, NULL, &(const struct SnapObjectParams){ - .snap_select = SNAP_ALL, + .snap_target_select = SCE_SNAP_TARGET_ALL, }, origin, direction, |