diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 257 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access_compare_override.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_action.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_action_api.c | 24 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_attribute.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 11 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil_modifier.c | 32 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 113 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 48 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 103 |
17 files changed, 511 insertions, 160 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index d51fcba410a..f750ea8f665 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -85,6 +85,47 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {0, NULL, 0, NULL, NULL}, }; +static const EnumPropertyItem rna_enum_override_library_property_operation_items[] = { + {IDOVERRIDE_LIBRARY_OP_NOOP, + "NOOP", + 0, + "No-Op", + "Does nothing, prevents adding actual overrides (NOT USED)"}, + {IDOVERRIDE_LIBRARY_OP_REPLACE, + "REPLACE", + 0, + "Replace", + "Replace value of reference by overriding one"}, + {IDOVERRIDE_LIBRARY_OP_ADD, + "DIFF_ADD", + 0, + "Differential", + "Stores and apply difference between reference and local value (NOT USED)"}, + {IDOVERRIDE_LIBRARY_OP_SUBTRACT, + "DIFF_SUB", + 0, + "Differential", + "Stores and apply difference between reference and local value (NOT USED)"}, + {IDOVERRIDE_LIBRARY_OP_MULTIPLY, + "FACT_MULTIPLY", + 0, + "Factor", + "Stores and apply multiplication factor between reference and local value (NOT USED)"}, + {IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, + "INSERT_AFTER", + 0, + "Insert After", + "Insert a new item into collection after the one referenced in subitem_reference_name or " + "_index"}, + {IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE, + "INSERT_BEFORE", + 0, + "Insert Before", + "Insert a new item into collection after the one referenced in subitem_reference_name or " + "_index (NOT USED)"}, + {0, NULL, 0, NULL, NULL}, +}; + /** * \note Uses #IDFilterEnumPropertyItem, not EnumPropertyItem to support 64 bit items. */ @@ -643,6 +684,65 @@ static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages) return local_id; } +static void rna_ID_override_template_create(ID *id, ReportList *reports) +{ + if (!U.experimental.use_override_templates) { + BKE_report(reports, RPT_ERROR, "Override template experimental feature is disabled"); + return; + } + if (ID_IS_LINKED(id)) { + BKE_report(reports, RPT_ERROR, "Unable to create override template for linked data-blocks"); + return; + } + if (ID_IS_OVERRIDE_LIBRARY(id)) { + BKE_report( + reports, RPT_ERROR, "Unable to create override template for overridden data-blocks"); + return; + } + BKE_lib_override_library_template_create(id); +} + +static IDOverrideLibraryProperty *rna_ID_override_library_properties_add( + IDOverrideLibrary *override_library, ReportList *reports, const char rna_path[]) +{ + bool created; + IDOverrideLibraryProperty *result = BKE_lib_override_library_property_get( + override_library, rna_path, &created); + + if (!created) { + BKE_report(reports, RPT_DEBUG, "No new override property created, property already exists"); + } + + return result; +} + +static IDOverrideLibraryPropertyOperation *rna_ID_override_library_property_operations_add( + IDOverrideLibraryProperty *override_property, + ReportList *reports, + int operation, + const char *subitem_refname, + const char *subitem_locname, + int subitem_refindex, + int subitem_locindex) +{ + bool created; + bool strict; + IDOverrideLibraryPropertyOperation *result = BKE_lib_override_library_property_operation_get( + override_property, + operation, + subitem_refname, + subitem_locname, + subitem_refindex, + subitem_locindex, + false, + &strict, + &created); + if (!created) { + BKE_report(reports, RPT_DEBUG, "No new override operation created, operation already exists"); + } + return result; +} + static void rna_ID_update_tag(ID *id, Main *bmain, ReportList *reports, int flag) { /* XXX, new function for this! */ @@ -1358,47 +1458,6 @@ static void rna_def_ID_override_library_property_operation(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static const EnumPropertyItem override_library_property_operation_items[] = { - {IDOVERRIDE_LIBRARY_OP_NOOP, - "NOOP", - 0, - "No-Op", - "Does nothing, prevents adding actual overrides (NOT USED)"}, - {IDOVERRIDE_LIBRARY_OP_REPLACE, - "REPLACE", - 0, - "Replace", - "Replace value of reference by overriding one"}, - {IDOVERRIDE_LIBRARY_OP_ADD, - "DIFF_ADD", - 0, - "Differential", - "Stores and apply difference between reference and local value (NOT USED)"}, - {IDOVERRIDE_LIBRARY_OP_SUBTRACT, - "DIFF_SUB", - 0, - "Differential", - "Stores and apply difference between reference and local value (NOT USED)"}, - {IDOVERRIDE_LIBRARY_OP_MULTIPLY, - "FACT_MULTIPLY", - 0, - "Factor", - "Stores and apply multiplication factor between reference and local value (NOT USED)"}, - {IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, - "INSERT_AFTER", - 0, - "Insert After", - "Insert a new item into collection after the one referenced in subitem_reference_name or " - "_index"}, - {IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE, - "INSERT_BEFORE", - 0, - "Insert Before", - "Insert a new item into collection after the one referenced in subitem_reference_name or " - "_index (NOT USED)"}, - {0, NULL, 0, NULL, NULL}, - }; - static const EnumPropertyItem override_library_property_flag_items[] = { {IDOVERRIDE_LIBRARY_FLAG_MANDATORY, "MANDATORY", @@ -1420,7 +1479,7 @@ static void rna_def_ID_override_library_property_operation(BlenderRNA *brna) prop = RNA_def_enum(srna, "operation", - override_library_property_operation_items, + rna_enum_override_library_property_operation_items, IDOVERRIDE_LIBRARY_OP_REPLACE, "Operation", "What override operation is performed"); @@ -1477,6 +1536,66 @@ static void rna_def_ID_override_library_property_operation(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */ } +static void rna_def_ID_override_library_property_operations(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "IDOverrideLibraryPropertyOperations"); + srna = RNA_def_struct(brna, "IDOverrideLibraryPropertyOperations", NULL); + RNA_def_struct_sdna(srna, "IDOverrideLibraryProperty"); + RNA_def_struct_ui_text(srna, "Override Operations", "Collection of override operations"); + + /* Add Property */ + func = RNA_def_function(srna, "add", "rna_ID_override_library_property_operations_add"); + RNA_def_function_ui_description(func, "Add a new operation"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm = RNA_def_enum(func, + "operation", + rna_enum_override_library_property_operation_items, + IDOVERRIDE_LIBRARY_OP_REPLACE, + "Operation", + "What override operation is performed"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_string(func, + "subitem_reference_name", + NULL, + INT_MAX, + "Subitem Reference Name", + "Used to handle insertions into collection"); + parm = RNA_def_string(func, + "subitem_local_name", + NULL, + INT_MAX, + "Subitem Local Name", + "Used to handle insertions into collection"); + parm = RNA_def_int(func, + "subitem_reference_index", + -1, + -1, + INT_MAX, + "Subitem Reference Index", + "Used to handle insertions into collection", + -1, + INT_MAX); + parm = RNA_def_int(func, + "subitem_local_index", + -1, + -1, + INT_MAX, + "Subitem Local Index", + "Used to handle insertions into collection", + -1, + INT_MAX); + parm = RNA_def_pointer(func, + "property", + "IDOverrideLibraryPropertyOperation", + "New Operation", + "Created operation"); + RNA_def_function_return(func, parm); +} + static void rna_def_ID_override_library_property(BlenderRNA *brna) { StructRNA *srna; @@ -1496,18 +1615,47 @@ static void rna_def_ID_override_library_property(BlenderRNA *brna) "RNA path leading to that property, from owning ID"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */ - RNA_def_collection(srna, - "operations", - "IDOverrideLibraryPropertyOperation", - "Operations", - "List of overriding operations for a property"); + prop = RNA_def_collection(srna, + "operations", + "IDOverrideLibraryPropertyOperation", + "Operations", + "List of overriding operations for a property"); + rna_def_ID_override_library_property_operations(brna, prop); rna_def_ID_override_library_property_operation(brna); } +static void rna_def_ID_override_library_properties(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "IDOverrideLibraryProperties"); + srna = RNA_def_struct(brna, "IDOverrideLibraryProperties", NULL); + RNA_def_struct_sdna(srna, "IDOverrideLibrary"); + RNA_def_struct_ui_text(srna, "Override Properties", "Collection of override properties"); + + /* Add Property */ + func = RNA_def_function(srna, "add", "rna_ID_override_library_properties_add"); + RNA_def_function_ui_description( + func, "Add a property to the override library when it doesn't exist yet"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm = RNA_def_pointer(func, + "property", + "IDOverrideLibraryProperty", + "New Property", + "Newly created override property or existing one"); + RNA_def_function_return(func, parm); + parm = RNA_def_string( + func, "rna_path", NULL, 256, "RNA Path", "RNA-Path of the property to add"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); +} + static void rna_def_ID_override_library(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna = RNA_def_struct(brna, "IDOverrideLibrary", NULL); RNA_def_struct_ui_text( @@ -1516,11 +1664,12 @@ static void rna_def_ID_override_library(BlenderRNA *brna) RNA_def_pointer( srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override"); - RNA_def_collection(srna, - "properties", - "IDOverrideLibraryProperty", - "Properties", - "List of overridden properties"); + prop = RNA_def_collection(srna, + "properties", + "IDOverrideLibraryProperty", + "Properties", + "List of overridden properties"); + rna_def_ID_override_library_properties(brna, prop); rna_def_ID_override_library_property(brna); } @@ -1672,6 +1821,10 @@ static void rna_def_ID(BlenderRNA *brna) "Whether local usages of the linked ID should be remapped to the new " "library override of it"); + func = RNA_def_function(srna, "override_template_create", "rna_ID_override_template_create"); + RNA_def_function_ui_description(func, "Create an override template for this ID"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); RNA_def_function_ui_description(func, "Clear the user count of a data-block so its not saved, " diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 80833d4f992..39e7774e5a4 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -1098,6 +1098,10 @@ static void rna_property_override_check_resync(Main *bmain, ID *id_dst = rna_property_override_property_real_id_owner(bmain, ptr_item_dst, NULL, NULL); BLI_assert(id_src == NULL || ID_IS_OVERRIDE_LIBRARY_REAL(id_src)); + /* Work around file corruption on writing, see T86853. */ + if (id_src != NULL && !ID_IS_OVERRIDE_LIBRARY_REAL(id_src)) { + return; + } if (/* We might be in a case where id_dst has already been processed and its usages * remapped to its new local override. In that case overrides and linked data diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 69ddcee60fa..fb9f5e0292e 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -407,8 +407,10 @@ static void rna_def_dopesheet(BlenderRNA *brna) /* Multi-word fuzzy search option for name/text filters */ prop = RNA_def_property(srna, "use_multi_word_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_FUZZY_NAMES); - RNA_def_property_ui_text( - prop, "Multi-Word Fuzzy Filter", "Perform fuzzy/multi-word matching (WARNING: May be slow)"); + RNA_def_property_ui_text(prop, + "Multi-Word Fuzzy Filter", + "Perform fuzzy/multi-word matching.\n" + "Warning: May be slow"); RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c index 48da32afba5..308a34f9cf1 100644 --- a/source/blender/makesrna/intern/rna_action_api.c +++ b/source/blender/makesrna/intern/rna_action_api.c @@ -41,10 +41,32 @@ # include "DNA_anim_types.h" # include "DNA_curve_types.h" +static void rna_Action_flip_with_pose(bAction *act, ReportList *reports, Object *ob) +{ + if (ob->type != OB_ARMATURE) { + BKE_report(reports, RPT_ERROR, "Only armature objects are supported"); + return; + } + BKE_action_flip_with_pose(act, ob); + + /* Only for redraw. */ + WM_main_add_notifier(NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); +} + #else -void RNA_api_action(StructRNA *UNUSED(srna)) +void RNA_api_action(StructRNA *srna) { + FunctionRNA *func; + PropertyRNA *parm; + + func = RNA_def_function(srna, "flip_with_pose", "rna_Action_flip_with_pose"); + RNA_def_function_ui_description(func, "Flip the action around the X axis using a pose"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + + parm = RNA_def_pointer( + func, "object", "Object", "", "The reference armature object to use when flipping"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); } #endif diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 554f04ca23c..c54621372ba 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -1537,6 +1537,16 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); + prop = RNA_def_property(srna, "axes_position", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "axes_position"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 1); + RNA_def_property_ui_text(prop, + "Axes Position", + "The position for the axes on the bone. Increasing the value moves it " + "closer to the tip; decreasing moves it closer to the root"); + RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES); RNA_def_property_ui_text(prop, "Display Names", "Display bone names"); diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c index 8e3d2c9b9a2..7976df3e4e4 100644 --- a/source/blender/makesrna/intern/rna_attribute.c +++ b/source/blender/makesrna/intern/rna_attribute.c @@ -54,8 +54,8 @@ const EnumPropertyItem rna_enum_attribute_domain_items[] = { // {ATTR_DOMAIN_GEOMETRY, "GEOMETRY", 0, "Geometry", "Attribute on (whole) geometry"}, {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"}, {ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"}, - {ATTR_DOMAIN_CORNER, "CORNER", 0, "Corner", "Attribute on mesh polygon corner"}, - {ATTR_DOMAIN_POLYGON, "POLYGON", 0, "Polygon", "Attribute on mesh polygons"}, + {ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"}, + {ATTR_DOMAIN_CORNER, "CORNER", 0, "Face Corner", "Attribute on mesh face corner"}, /* Not implement yet */ // {ATTR_DOMAIN_GRIDS, "GRIDS", 0, "Grids", "Attribute on mesh multires grids"}, {ATTR_DOMAIN_CURVE, "CURVE", 0, "Curve", "Attribute on hair curve"}, @@ -66,8 +66,8 @@ const EnumPropertyItem rna_enum_attribute_domain_with_auto_items[] = { {ATTR_DOMAIN_AUTO, "AUTO", 0, "Auto", ""}, {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"}, {ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"}, - {ATTR_DOMAIN_CORNER, "CORNER", 0, "Corner", "Attribute on mesh polygon corner"}, - {ATTR_DOMAIN_POLYGON, "POLYGON", 0, "Polygon", "Attribute on mesh polygons"}, + {ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"}, + {ATTR_DOMAIN_CORNER, "CORNER", 0, "Face Corner", "Attribute on mesh face corner"}, {0, NULL, 0, NULL, NULL}, }; diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 36d39c5c201..85071e8cd19 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -505,11 +505,10 @@ static void rna_def_depsgraph_instance(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "DepsgraphObjectInstance", NULL); - RNA_def_struct_ui_text( - srna, - "Dependency Graph Object Instance", - "Extended information about dependency graph object iterator " - "(WARNING: all data here is *evaluated* one, not original .blend IDs...)"); + RNA_def_struct_ui_text(srna, + "Dependency Graph Object Instance", + "Extended information about dependency graph object iterator " + "(Warning: All data here is 'evaluated' one, not original .blend IDs)"); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); @@ -773,7 +772,7 @@ static void rna_def_depsgraph(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object Instances", "All object instances to display or render " - "(WARNING: only use this as an iterator, never as a sequence, " + "(Warning: Only use this as an iterator, never as a sequence, " "and do not keep any references to its items)"); prop = RNA_def_property(srna, "updates", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 0aa2e652d2d..6c6f18ab5a4 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -452,7 +452,7 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -585,7 +585,7 @@ static void rna_def_modifier_gpencilsmooth(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -698,7 +698,7 @@ static void rna_def_modifier_gpencilsubdiv(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -788,7 +788,7 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -877,7 +877,7 @@ static void rna_def_modifier_gpencilthick(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -971,7 +971,7 @@ static void rna_def_modifier_gpenciloffset(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1069,7 +1069,7 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1273,7 +1273,7 @@ static void rna_def_modifier_gpencilcolor(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1364,7 +1364,7 @@ static void rna_def_modifier_gpencilopacity(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1460,7 +1460,7 @@ static void rna_def_modifier_gpencilarray(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1759,7 +1759,7 @@ static void rna_def_modifier_gpencillattice(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1838,7 +1838,7 @@ static void rna_def_modifier_gpencilmirror(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -1936,7 +1936,7 @@ static void rna_def_modifier_gpencilhook(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -2093,7 +2093,7 @@ static void rna_def_modifier_gpencilmultiply(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -2216,7 +2216,7 @@ static void rna_def_modifier_gpenciltexture(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); @@ -2466,7 +2466,7 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "target_material", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text( diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 98a2b683f18..67335b81a31 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -5920,8 +5920,9 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Keep Normals", - "Try to preserve custom normals (WARNING: depending on chosen triangulation method, " - "shading may not be fully preserved, 'Fixed' method usually gives the best result here)"); + "Try to preserve custom normals.\n" + "Warning: Depending on chosen triangulation method, " + "shading may not be fully preserved, \"Fixed\" method usually gives the best result here"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_define_lib_overridable(false); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index d69a1e3dd06..277cfada44d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -329,8 +329,12 @@ const EnumPropertyItem rna_enum_node_map_range_items[] = { }; const EnumPropertyItem rna_enum_node_clamp_items[] = { - {NODE_CLAMP_MINMAX, "MINMAX", 0, "Min Max", "Clamp values using Min and Max values"}, - {NODE_CLAMP_RANGE, "RANGE", 0, "Range", "Clamp values between Min and Max range"}, + {NODE_CLAMP_MINMAX, "MINMAX", 0, "Min Max", "Constrain value between min and max"}, + {NODE_CLAMP_RANGE, + "RANGE", + 0, + "Range", + "Constrain value between min and max, swapping arguments when min > max"}, {0, NULL, 0, NULL, NULL}, }; @@ -1886,6 +1890,19 @@ static const EnumPropertyItem *itemf_function_check( return item_array; } +static bool attribute_clamp_type_supported(const EnumPropertyItem *item) +{ + return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_INT32, CD_PROP_COLOR); +} +static const EnumPropertyItem *rna_GeometryNodeAttributeClamp_type_itemf(bContext *UNUSED(C), + PointerRNA *UNUSED(ptr), + PropertyRNA *UNUSED(prop), + bool *r_free) +{ + *r_free = true; + return itemf_function_check(rna_enum_attribute_type_items, attribute_clamp_type_supported); +} + static bool attribute_random_type_supported(const EnumPropertyItem *item) { return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_BOOL, CD_PROP_INT32); @@ -2065,6 +2082,17 @@ static void rna_GeometryNodeAttributeVectorMath_operation_update(Main *bmain, rna_Node_socket_update(bmain, scene, ptr); } +static bool attribute_map_range_type_supported(const EnumPropertyItem *item) +{ + return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3); +} +static const EnumPropertyItem *rna_GeometryNodeAttributeMapRange_type_itemf( + bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) +{ + *r_free = true; + return itemf_function_check(rna_enum_attribute_type_items, attribute_map_range_type_supported); +} + static StructRNA *rna_ShaderNode_register(Main *bmain, ReportList *reports, void *data, @@ -8634,6 +8662,41 @@ static void def_cmp_denoise(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } +static void def_cmp_antialiasing(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeAntiAliasingData", "storage"); + + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "threshold"); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text( + prop, + "Threshold", + "Threshold to detect edges (smaller threshold makes more sensitive detection)"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "contrast_limit", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "contrast_limit"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text( + prop, + "Contrast Limit", + "How much to eliminate spurious edges to avoid artifacts (the larger value makes less " + "active; the value 2.0, for example, means discard a detected edge if there is a " + "neighboring edge that has 2.0 times bigger contrast than the current one)"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "corner_rounding", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "corner_rounding"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text(prop, "Corner Rounding", "How much sharp corners will be rounded"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + /* -- Texture Nodes --------------------------------------------------------- */ static void def_tex_output(StructRNA *srna) @@ -8915,6 +8978,26 @@ static void def_geo_attribute_vector_math(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_attribute_map_range(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeAttributeMapRange", "storage"); + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_type"); + RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_GeometryNodeAttributeMapRange_type_itemf"); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + + prop = RNA_def_property(srna, "interpolation_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "interpolation_type"); + RNA_def_property_enum_items(prop, rna_enum_node_map_range_items); + RNA_def_property_ui_text(prop, "Interpolation Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); +} + static void def_geo_point_instance(StructRNA *srna) { static const EnumPropertyItem instance_type_items[] = { @@ -8975,6 +9058,26 @@ static void def_geo_attribute_mix(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_attribute_clamp(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeAttributeClamp", "storage"); + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_type"); + RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_GeometryNodeAttributeClamp_type_itemf"); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + + prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_node_clamp_items); + RNA_def_property_enum_default(prop, NODE_CLAMP_MINMAX); + RNA_def_property_ui_text(prop, "Operation", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_geo_attribute_attribute_compare(StructRNA *srna) { PropertyRNA *prop; @@ -9594,6 +9697,12 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Linked", "True if the socket is connected"); + prop = RNA_def_property(srna, "is_multi_input", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_MULTI_INPUT); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text( + prop, "Multi Input", "True if the socket can accept multiple ordered input links"); + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SOCK_COLLAPSED); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index b04fea11a4d..21e9328d043 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -160,6 +160,7 @@ const EnumPropertyItem rna_enum_object_gpencil_type_items[] = { {GP_EMPTY, "EMPTY", ICON_EMPTY_AXIS, "Blank", "Create an empty grease pencil object"}, {GP_STROKE, "STROKE", ICON_STROKE, "Stroke", "Create a simple stroke with basic colors"}, {GP_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "Construct a Suzanne grease pencil object"}, + {0, "", 0, NULL, NULL}, {GP_LRT_SCENE, "LRT_SCENE", ICON_SCENE_DATA, @@ -2797,6 +2798,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_multi_array(prop, 2, boundbox_dimsize); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); RNA_def_property_ui_text( prop, @@ -2967,12 +2969,11 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_funcs( prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL); RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); - RNA_def_property_ui_text( - prop, - "Dimensions", - "Absolute bounding box dimensions of the object (WARNING: assigning to it or " - "its members multiple consecutive times will not work correctly, " - "as this needs up-to-date evaluated data)"); + RNA_def_property_ui_text(prop, + "Dimensions", + "Absolute bounding box dimensions of the object.\n" + "Warning: Assigning to it or its members multiple consecutive times " + "will not work correctly, as this needs up-to-date evaluated data"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* delta transforms */ @@ -3075,8 +3076,8 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Local Matrix", - "Parent relative transformation matrix - " - "WARNING: Only takes into account 'Object' parenting, so e.g. in case of bone parenting " + "Parent relative transformation matrix.\n" + "Warning: Only takes into account object parenting, so e.g. in case of bone parenting " "you get a matrix relative to the Armature object, not to the actual parent bone"); RNA_def_property_float_funcs( prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index d8336e79064..f7a7b745493 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -20,6 +20,8 @@ #include <stdlib.h> +#include <CLG_log.h> + #include "DNA_ID.h" #include "BLI_utildefines.h" @@ -132,6 +134,8 @@ const EnumPropertyItem rna_enum_property_unit_items[] = { # include "BKE_idprop.h" # include "BKE_lib_override.h" +static CLG_LogRef LOG_COMPARE_OVERRIDE = {"rna.rna_compare_override"}; + /* Struct */ static void rna_Struct_identifier_get(PointerRNA *ptr, char *value) @@ -1366,11 +1370,11 @@ static int rna_property_override_diff_propptr(Main *bmain, /* In case one of the owner of the checked property is tagged as needing resync, do * not change the 'match reference' status of its ID pointer properties overrides, * since many non-matching ones are likely due to missing resync. */ - printf( - "%s: Not checking matching ID pointer properties, since owner %s is tagged as " - "needing resync.\n", - __func__, - id_a->name); + CLOG_INFO(&LOG_COMPARE_OVERRIDE, + 4, + "Not checking matching ID pointer properties, since owner %s is tagged as " + "needing resync.\n", + id_a->name); } else if (id_a->override_library != NULL && id_a->override_library->reference == id_b) { opop->flag |= IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3344b8c286d..65643aa92d7 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2685,6 +2685,7 @@ static void rna_def_view3d_cursor(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_View3DCursor_path"); RNA_def_struct_ui_text(srna, "3D Cursor", ""); RNA_def_struct_ui_icon(srna, ICON_CURSOR); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -2855,7 +2856,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1); RNA_def_property_ui_text(prop, - "WPaint Auto-Normalize", + "Weight Paint Auto-Normalize", "Ensure all bone-deforming vertex groups add up " "to 1.0 while weight painting"); RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data"); @@ -2864,7 +2865,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "wpaint_lock_relative", 1); RNA_def_property_ui_text(prop, - "WPaint Lock-Relative", + "Weight Paint Lock-Relative", "Display bone-deforming groups as if all locked deform groups " "were deleted, and the remaining ones were re-normalized"); RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data"); @@ -2873,7 +2874,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1); RNA_def_property_ui_text(prop, - "WPaint Multi-Paint", + "Weight Paint Multi-Paint", "Paint across the weights of all selected bones, " "maintaining their relative influence"); RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data"); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index a49a404fe6c..8aab0c079a3 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -224,13 +224,15 @@ static Sequence *rna_Sequences_new_image(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { Scene *scene = (Scene *)id; SeqLoadData load_data; SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); load_data.image.len = 1; + load_data.fit_method = fit_method; Sequence *seq = SEQ_add_image_strip(bmain, scene, seqbase, &load_data); char dir[FILE_MAX], filename[FILE_MAX]; @@ -253,10 +255,11 @@ static Sequence *rna_Sequences_editing_new_image(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { return rna_Sequences_new_image( - id, &ed->seqbase, bmain, reports, name, file, channel, frame_start); + id, &ed->seqbase, bmain, reports, name, file, channel, frame_start, fit_method); } static Sequence *rna_Sequences_meta_new_image(ID *id, @@ -266,10 +269,11 @@ static Sequence *rna_Sequences_meta_new_image(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { return rna_Sequences_new_image( - id, &seq->seqbase, bmain, reports, name, file, channel, frame_start); + id, &seq->seqbase, bmain, reports, name, file, channel, frame_start, fit_method); } static Sequence *rna_Sequences_new_movie(ID *id, @@ -278,11 +282,13 @@ static Sequence *rna_Sequences_new_movie(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { Scene *scene = (Scene *)id; SeqLoadData load_data; SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); + load_data.fit_method = fit_method; load_data.allow_invalid_file = true; Sequence *seq = SEQ_add_movie_strip(bmain, scene, seqbase, &load_data); @@ -299,9 +305,11 @@ static Sequence *rna_Sequences_editing_new_movie(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { - return rna_Sequences_new_movie(id, &ed->seqbase, bmain, name, file, channel, frame_start); + return rna_Sequences_new_movie( + id, &ed->seqbase, bmain, name, file, channel, frame_start, fit_method); } static Sequence *rna_Sequences_meta_new_movie(ID *id, @@ -310,9 +318,11 @@ static Sequence *rna_Sequences_meta_new_movie(ID *id, const char *name, const char *file, int channel, - int frame_start) + int frame_start, + int fit_method) { - return rna_Sequences_new_movie(id, &seq->seqbase, bmain, name, file, channel, frame_start); + return rna_Sequences_new_movie( + id, &seq->seqbase, bmain, name, file, channel, frame_start, fit_method); } # ifdef WITH_AUDASPACE @@ -724,6 +734,18 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastri {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem scale_fit_methods[] = { + {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image so fits in preview"}, + {SEQ_SCALE_TO_FILL, + "FILL", + 0, + "Scale to Fill", + "Scale image so it fills preview completely"}, + {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image so it fills preview"}, + {SEQ_USE_ORIGINAL_SIZE, "ORIGINAL", 0, "Use Original Size", "Don't scale the image"}, + {0, NULL, 0, NULL, NULL}, + }; + const char *new_clip_func_name = "rna_Sequences_editing_new_clip"; const char *new_mask_func_name = "rna_Sequences_editing_new_mask"; const char *new_scene_func_name = "rna_Sequences_editing_new_scene"; @@ -849,6 +871,9 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastri -MAXFRAME, MAXFRAME); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_enum( + func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); + RNA_def_parameter_flags(parm, 0, PARM_PYFUNC_OPTIONAL); /* return type */ parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); RNA_def_function_return(func, parm); @@ -873,6 +898,9 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastri -MAXFRAME, MAXFRAME); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_enum( + func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); + RNA_def_parameter_flags(parm, 0, PARM_PYFUNC_OPTIONAL); /* return type */ parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 26ec94c2b89..cf22ff95e74 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -3083,7 +3083,7 @@ const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext *C, ATTR_DOMAIN_CORNER, ATTR_DOMAIN_EDGE, ATTR_DOMAIN_POINT, - ATTR_DOMAIN_POLYGON)) { + ATTR_DOMAIN_FACE)) { continue; } } @@ -7237,7 +7237,7 @@ static void rna_def_space_spreadsheet(BlenderRNA *brna) "MESH", ICON_MESH_DATA, "Mesh", - "Mesh component containing point, corner, edge and polygon data"}, + "Mesh component containing point, corner, edge and face data"}, {GEO_COMPONENT_TYPE_POINT_CLOUD, "POINTCLOUD", ICON_POINTCLOUD_DATA, diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4c86405a44d..baf77aae87f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -6215,7 +6215,8 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, " - "uses process ID (sculpt and edit mode data won't be saved)"); + "uses process ID.\n" + "Warning: Sculpt and edit mode data won't be saved"); RNA_def_property_update(prop, 0, "rna_userdef_autosave_update"); prop = RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE); @@ -6304,6 +6305,11 @@ static void rna_def_userdef_experimental(BlenderRNA *brna) prop, "Asset Browser", "Enable Asset Browser editor and operators to manage data-blocks as asset"); + + prop = RNA_def_property(srna, "use_override_templates", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_override_templates", 1); + RNA_def_property_ui_text( + prop, "Override Templates", "Enable library override template in the python API"); } static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d67d62d7af9..4a51db4e652 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1781,41 +1781,40 @@ static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value) } } -static void rna_Operator_bl_translation_context_set(PointerRNA *ptr, const char *value) -{ - wmOperator *data = (wmOperator *)(ptr->data); - char *str = (char *)data->type->translation_context; - if (!str[0]) { - BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ - } - else { - BLI_assert(!"setting the bl_translation_context on a non-builtin operator"); - } -} - -static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value) -{ - wmOperator *data = (wmOperator *)(ptr->data); - char *str = (char *)data->type->description; - if (!str[0]) { - BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ - } - else { - BLI_assert(!"setting the bl_description on a non-builtin operator"); - } -} +/** + * Use callbacks that check for NULL instead of clearing #PROP_NEVER_NULL on the string property, + * so the internal value may be NULL, without allowing Python to assign `None` which doesn't + * make any sense in this case. + */ +# define OPERATOR_STR_MAYBE_NULL_GETSET(attr, len) \ + static void rna_Operator_bl_##attr##_set(PointerRNA *ptr, const char *value) \ + { \ + wmOperator *data = (wmOperator *)(ptr->data); \ + char *str = (char *)data->type->attr; \ + if (str && !str[0]) { \ + BLI_strncpy(str, value, len); /* utf8 already ensured */ \ + } \ + else { \ + BLI_assert( \ + !"setting the bl_" STRINGIFY(translation_context) " on a non-builtin operator"); \ + } \ + } \ + static void rna_Operator_bl_##attr##_get(PointerRNA *ptr, char *value) \ + { \ + const wmOperator *data = (wmOperator *)(ptr->data); \ + const char *str = data->type->attr; \ + BLI_strncpy(value, str ? str : "", len); \ + } \ + static int rna_Operator_bl_##attr##_length(PointerRNA *ptr) \ + { \ + const wmOperator *data = (wmOperator *)(ptr->data); \ + const char *str = data->type->attr; \ + return BLI_strnlen(str ? str : "", len); \ + } -static void rna_Operator_bl_undo_group_set(PointerRNA *ptr, const char *value) -{ - wmOperator *data = (wmOperator *)(ptr->data); - char *str = (char *)data->type->undo_group; - if (!str[0]) { - BLI_strncpy(str, value, OP_MAX_TYPENAME); /* utf8 already ensured */ - } - else { - BLI_assert(!"setting the bl_undo_group on a non-builtin operator"); - } -} +OPERATOR_STR_MAYBE_NULL_GETSET(translation_context, RNA_DYN_DESCR_MAX) +OPERATOR_STR_MAYBE_NULL_GETSET(description, RNA_DYN_DESCR_MAX) +OPERATOR_STR_MAYBE_NULL_GETSET(undo_group, OP_MAX_TYPENAME) static void rna_KeyMapItem_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { @@ -1930,26 +1929,32 @@ static void rna_def_operator(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_translation_context", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->translation_context"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_translation_context_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_translation_context_get", + "rna_Operator_bl_translation_context_length", + "rna_Operator_bl_translation_context_set"); RNA_def_property_string_default(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->description"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_description_get", + "rna_Operator_bl_description_length", + "rna_Operator_bl_description_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_undo_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->undo_group"); RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_undo_group_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_undo_group_get", + "rna_Operator_bl_undo_group_length", + "rna_Operator_bl_undo_group_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); @@ -2022,26 +2027,32 @@ static void rna_def_macro_operator(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_translation_context", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->translation_context"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_translation_context_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_translation_context_get", + "rna_Operator_bl_translation_context_length", + "rna_Operator_bl_translation_context_set"); RNA_def_property_string_default(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->description"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_description_get", + "rna_Operator_bl_description_length", + "rna_Operator_bl_description_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_undo_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->undo_group"); RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_undo_group_set"); + RNA_def_property_string_funcs(prop, + "rna_Operator_bl_undo_group_get", + "rna_Operator_bl_undo_group_length", + "rna_Operator_bl_undo_group_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); |