Fix slow toggling of scene tool settings
For example, snapping or pivot point. The slowdown happens in complex files with drivers which use scene properties as input. Can be seen in the demo file from #117335. This change adds ability to mark RNA property as required to bring the evaluated ID up-to-date, but not do possibly expensive tag for drivers. The tool settings possibly can be tagged as do-not-do-deg-tag at all, but safer seems to follow the current behavior a bit closer. Pull Request: https://projects.blender.org/blender/blender/pulls/117405
This commit is contained in:
committed by
Sergey Sharybin
parent
0d420ee97a
commit
03828a47f4
@@ -179,7 +179,7 @@ enum PropertySubType {
|
||||
|
||||
/* Make sure enums are updated with these */
|
||||
/* HIGHEST FLAG IN USE: 1 << 31
|
||||
* FREE FLAGS: 9, 11, 13, 14, 15. */
|
||||
* FREE FLAGS: 11, 13, 14, 15. */
|
||||
enum PropertyFlag {
|
||||
/**
|
||||
* Editable means the property is editable in the user
|
||||
@@ -300,6 +300,12 @@ enum PropertyFlag {
|
||||
*/
|
||||
PROP_NO_DEG_UPDATE = (1 << 30),
|
||||
|
||||
/**
|
||||
* Property needs to ensure evaluated data-blocks are in sync with their original counter-part
|
||||
* but the property does not affect evaluation itself.
|
||||
*/
|
||||
PROP_DEG_SYNC_ONLY = (1 << 9),
|
||||
|
||||
/**
|
||||
* File-paths that refer to output get a special treatment such
|
||||
* as having the +/- operators available in the file browser.
|
||||
|
||||
@@ -2276,7 +2276,12 @@ static void rna_property_update(
|
||||
if (ptr->owner_id != nullptr && ((prop->flag & PROP_NO_DEG_UPDATE) == 0)) {
|
||||
const short id_type = GS(ptr->owner_id->name);
|
||||
if (ID_TYPE_IS_COW(id_type)) {
|
||||
DEG_id_tag_update(ptr->owner_id, ID_RECALC_COPY_ON_WRITE | ID_RECALC_PARAMETERS);
|
||||
if (prop->flag & PROP_DEG_SYNC_ONLY) {
|
||||
DEG_id_tag_update(ptr->owner_id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
else {
|
||||
DEG_id_tag_update(ptr->owner_id, ID_RECALC_COPY_ON_WRITE | ID_RECALC_PARAMETERS);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* End message bus. */
|
||||
|
||||
@@ -3173,7 +3173,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Curves Sculpt", "");
|
||||
|
||||
prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE | PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_normalize", 1);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Weight Paint Auto-Normalize",
|
||||
@@ -3182,7 +3182,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
|
||||
|
||||
prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE | PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "wpaint_lock_relative", 1);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Weight Paint Lock-Relative",
|
||||
@@ -3191,7 +3191,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
|
||||
|
||||
prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE | PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "multipaint", 1);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Weight Paint Multi-Paint",
|
||||
@@ -3200,14 +3200,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
|
||||
|
||||
prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE | PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "weightuser");
|
||||
RNA_def_property_enum_items(prop, draw_groupuser_items);
|
||||
RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
|
||||
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
|
||||
|
||||
prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE | PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "vgroupsubset");
|
||||
RNA_def_property_enum_items(prop, vertex_group_select_items);
|
||||
RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
|
||||
@@ -3255,19 +3255,23 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
|
||||
|
||||
prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
|
||||
|
||||
prop = RNA_def_property(srna, "uv_relax_method", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "uv_relax_method");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, uv_sculpt_relaxation_items);
|
||||
RNA_def_property_ui_text(prop, "Relaxation Method", "Algorithm used for UV relaxation");
|
||||
|
||||
prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "object_flag", SCE_OBJECT_MODE_LOCK);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Lock Object Modes",
|
||||
"Restrict selection to objects using the same mode as the active "
|
||||
@@ -3282,6 +3286,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "workspace_tool_type");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, workspace_tool_items);
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_EDITOR_VIEW3D);
|
||||
RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
|
||||
@@ -3289,12 +3294,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Transform */
|
||||
prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_USE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
|
||||
RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_objects", 0);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Editing Objects", "Proportional editing object mode");
|
||||
RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
|
||||
@@ -3302,24 +3309,28 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_PROJECTED);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Projected from View", "Proportional Editing using screen space locations");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_CONNECTED);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Connected Only", "Proportional Editing using connected geometry only");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_mask", 0);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
|
||||
RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_action", 0);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Editing Actions", "Proportional editing in action editor");
|
||||
RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
|
||||
@@ -3327,6 +3338,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "proportional_fcurve", 0);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Editing F-Curves", "Proportional editing in F-Curve editor");
|
||||
RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
|
||||
@@ -3334,10 +3346,12 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "lock_markers", 0);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
|
||||
|
||||
prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "prop_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_proportional_falloff_items);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
|
||||
@@ -3347,18 +3361,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Size", "Display size for proportional editing circle");
|
||||
RNA_def_property_range(prop, 0.00001, 5000.0);
|
||||
|
||||
prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Proportional Size", "Display size for proportional editing circle");
|
||||
RNA_def_property_range(prop, 0.00001, 5000.0);
|
||||
|
||||
prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "doublimit");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
|
||||
RNA_def_property_range(prop, 0.0, 1.0);
|
||||
RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
|
||||
@@ -3366,12 +3383,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Pivot Point */
|
||||
prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_transform_pivot_full_items);
|
||||
RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_AXIS_ALIGN);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Only Locations",
|
||||
@@ -3380,18 +3399,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_DATA_ORIGIN);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TRANSFORM, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SKIP_CHILDREN);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Transform Parents", "Transform the parents, leaving the children in place");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TRANSFORM, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Correct Face Attributes",
|
||||
"Correct data such as UVs and color attributes when transforming");
|
||||
@@ -3400,6 +3422,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Keep Connected",
|
||||
@@ -3408,6 +3431,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
|
||||
RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
|
||||
@@ -3415,24 +3439,28 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE_AND_SPLIT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
|
||||
RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
|
||||
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_node", SCE_SNAP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
|
||||
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_seq", SCE_SNAP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Use Snapping", "Snap to strip edges or current frame");
|
||||
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
|
||||
RNA_def_property_boolean_default(prop, true);
|
||||
@@ -3440,18 +3468,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
|
||||
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ROTATE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Align Rotation to Target", "Align rotation with the snapping target");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ABS_GRID);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Absolute Grid Snap",
|
||||
@@ -3460,6 +3491,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_snap_element_items);
|
||||
RNA_def_property_enum_funcs(
|
||||
prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
|
||||
@@ -3469,6 +3501,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "snap_elements_base", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_snap_element_base_items);
|
||||
RNA_def_property_enum_funcs(
|
||||
prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
|
||||
@@ -3478,6 +3511,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "snap_elements_individual", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_snap_element_individual_items);
|
||||
RNA_def_property_enum_funcs(
|
||||
prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
|
||||
@@ -3488,6 +3522,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
|
||||
RNA_def_property_int_sdna(prop, nullptr, "snap_face_nearest_steps");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_range(prop, 1, 100);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
@@ -3496,6 +3531,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_KEEP_ON_SAME_OBJECT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Snap to Same Target",
|
||||
@@ -3504,24 +3540,28 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* node editor uses own set of snap modes */
|
||||
prop = RNA_def_property(srna, "snap_node_element", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_node_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_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, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_anim", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Snap", "Enable snapping when transforming keyframes");
|
||||
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_time_absolute", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP_ABS_TIME_STEP);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Absolute Time Snap", "Absolute time alignment when transforming keyframes");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_snap_animation_element_items);
|
||||
RNA_def_property_ui_text(prop, "Snap Anim Element", "Type of element to snap to");
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UNIT);
|
||||
@@ -3530,12 +3570,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* image editor uses own set of snap modes */
|
||||
prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_uv_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, snap_uv_element_items);
|
||||
RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_uv_grid_absolute", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP_ABS_GRID);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Absolute Grid Snap",
|
||||
@@ -3547,18 +3589,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
* snapped). */
|
||||
prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "snap_target");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
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, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_PEEL_OBJECT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_BACKFACE_CULLING);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
@@ -3566,24 +3611,28 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
* self is not (breaks API). This only makes a difference when more than one mesh is edited. */
|
||||
prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, nullptr, "snap_flag", SCE_SNAP_NOT_TO_ACTIVE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Snap onto Active", "Snap onto itself only if enabled (Edit Mode Only)");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_EDITED);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Snap onto Edited", "Snap onto non-active objects in Edit Mode (Edit Mode Only)");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_NONEDITED);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Snap onto Non-edited", "Snap onto objects not in Edit Mode (Edit Mode Only)");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_ONLY_SELECTABLE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
@@ -3591,6 +3640,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Use Snap for Translation", "Move is affected by snapping settings");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
@@ -3598,6 +3648,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_default(prop, false);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
|
||||
@@ -3606,18 +3657,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_default(prop, false);
|
||||
RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
|
||||
|
||||
prop = RNA_def_property(srna, "plane_axis", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "plane_axis");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items);
|
||||
RNA_def_property_enum_default(prop, 2);
|
||||
RNA_def_property_ui_text(prop, "Plane Axis", "The axis used for placing the base region");
|
||||
|
||||
prop = RNA_def_property(srna, "plane_axis_auto", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "use_plane_axis_auto", 1);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_default(prop, true);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Auto Axis",
|
||||
@@ -3626,18 +3680,21 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "plane_depth", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "plane_depth");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, plane_depth_items);
|
||||
RNA_def_property_enum_default(prop, V3D_PLACE_DEPTH_SURFACE);
|
||||
RNA_def_property_ui_text(prop, "Position", "The initial depth used when placing the cursor");
|
||||
|
||||
prop = RNA_def_property(srna, "plane_orientation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "plane_orient");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, plane_orientation_items);
|
||||
RNA_def_property_enum_default(prop, V3D_PLACE_ORIENT_SURFACE);
|
||||
RNA_def_property_ui_text(prop, "Orientation", "The initial depth used when placing the cursor");
|
||||
|
||||
prop = RNA_def_property(srna, "snap_elements_tool", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "snap_mode_tools");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, snap_to_items);
|
||||
RNA_def_property_enum_default(prop, SCE_SNAP_TO_GEOM);
|
||||
RNA_def_property_ui_text(prop, "Snap to", "The target to use while snapping");
|
||||
@@ -3645,6 +3702,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Grease Pencil */
|
||||
prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Use Additive Drawing",
|
||||
"When creating new frames, the strokes from the previous/active frame "
|
||||
@@ -3653,6 +3711,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Draw Strokes on Back",
|
||||
@@ -3662,12 +3721,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(
|
||||
prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Compact List", "Show compact list of color instead of thumbnails");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Add weight data for new strokes",
|
||||
"When creating new strokes, the weight data is added according to the "
|
||||
@@ -3677,6 +3738,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_AUTOMERGE_STROKE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_boolean_default(prop, false);
|
||||
RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
|
||||
RNA_def_property_ui_text(
|
||||
@@ -3688,12 +3750,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculpt");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_struct_type(prop, "GPencilSculptSettings");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
|
||||
|
||||
prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, nullptr, "gp_interpolate");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Grease Pencil Interpolate", "Settings for Grease Pencil Interpolation tools");
|
||||
@@ -3701,12 +3765,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Grease Pencil - 3D View Stroke Placement */
|
||||
prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
|
||||
RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
|
||||
RNA_def_property_ui_text(prop, "Stroke Snap", "");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
|
||||
@@ -3720,6 +3786,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "gpencil_surface_offset", PROP_FLOAT, PROP_DISTANCE);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "gpencil_surface_offset");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Surface Offset", "Offset along normal when drawing on surfaces");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
|
||||
@@ -3728,6 +3795,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Grease Pencil - Select mode Edit */
|
||||
prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "gpencil_selectmode_edit");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_grease_pencil_selectmode_items);
|
||||
RNA_def_property_ui_text(prop, "Select Mode", "");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3738,6 +3806,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3747,6 +3816,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3756,6 +3826,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
|
||||
@@ -3767,6 +3838,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3777,6 +3849,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3787,6 +3860,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Selection Mask", "Only paint selected stroke points between other strokes");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
|
||||
@@ -3798,6 +3872,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
# ifdef WITH_GREASE_PENCIL_V3
|
||||
prop = RNA_def_property(srna, "use_grease_pencil_multi_frame_editing", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_USE_MULTI_FRAME_EDITING);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Multi-frame Editing", "Enable multi-frame editing");
|
||||
RNA_def_property_ui_icon(prop, ICON_GP_MULTIFRAME_EDITING, 0);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -3808,6 +3883,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Annotations - 2D Views Stroke Placement */
|
||||
prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v2d_align");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
|
||||
RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
|
||||
@@ -3816,6 +3892,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* XXX: Do we need to decouple the stroke_endpoints setting too? */
|
||||
prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "annotate_v3d_align");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
|
||||
RNA_def_property_enum_default(prop, GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR);
|
||||
RNA_def_property_ui_text(prop,
|
||||
@@ -3826,6 +3903,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Annotations - Stroke Thickness */
|
||||
prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
|
||||
RNA_def_property_int_sdna(prop, nullptr, "annotate_thickness");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_range(prop, 1, 10);
|
||||
RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
|
||||
@@ -3833,12 +3911,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Auto Keying */
|
||||
prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Auto Keying", "Automatic keyframe insertion for Objects, Bones and Masks");
|
||||
RNA_def_property_ui_icon(prop, ICON_RECORD_OFF, 1);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "autokey_mode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, auto_key_items);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Auto-Keying Mode",
|
||||
@@ -3846,6 +3926,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_LAYERED_RECORD);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Layered",
|
||||
@@ -3854,6 +3935,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Auto Keyframe Insert Keying Set",
|
||||
"Automatic keyframe insertion using active Keying Set only");
|
||||
@@ -3861,6 +3943,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_CYCLEAWARE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Cycle-Aware Keying",
|
||||
@@ -3871,6 +3954,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Keyframing */
|
||||
prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "keyframe_type");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_beztriple_keyframe_type_items);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
|
||||
@@ -3878,6 +3962,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* UV */
|
||||
prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "uv_selectmode");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, rna_enum_mesh_select_mode_uv_items);
|
||||
RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
@@ -3885,6 +3970,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "uv_sticky");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_enum_items(prop, uv_sticky_mode_items);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
|
||||
@@ -3892,6 +3978,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SYNC_SELECTION);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
|
||||
RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
|
||||
@@ -3899,6 +3986,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SHOW_SAME_IMAGE);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "UV Local View", "Display only faces with the currently displayed image assigned");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, nullptr);
|
||||
@@ -3906,6 +3994,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
/* Mesh */
|
||||
prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "selectmode", 1);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_editmesh_select_mode_set");
|
||||
RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
|
||||
@@ -3914,10 +4003,12 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "vgroup_weight");
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
|
||||
|
||||
prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "edge_mode_live_unwrap", 1);
|
||||
RNA_def_property_flag(prop, PROP_DEG_SYNC_ONLY);
|
||||
RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
|
||||
|
||||
prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
|
||||
|
||||
Reference in New Issue
Block a user