diff options
Diffstat (limited to 'source/blender/makesrna')
54 files changed, 1092 insertions, 444 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 97313225628..c97fcd16941 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -393,6 +393,8 @@ extern StructRNA RNA_MeshIntProperty; extern StructRNA RNA_MeshLoop; extern StructRNA RNA_MeshLoopColor; extern StructRNA RNA_MeshLoopColorLayer; +extern StructRNA RNA_MeshVertColor; +extern StructRNA RNA_MeshVertColorLayer; extern StructRNA RNA_MeshLoopTriangle; extern StructRNA RNA_MeshPolygon; extern StructRNA RNA_MeshSequenceCacheModifier; @@ -825,12 +827,12 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name); int RNA_property_string_maxlength(PropertyRNA *prop); -const char *RNA_property_ui_name(PropertyRNA *prop); -const char *RNA_property_ui_name_raw(PropertyRNA *prop); -const char *RNA_property_ui_description(PropertyRNA *prop); -const char *RNA_property_ui_description_raw(PropertyRNA *prop); -const char *RNA_property_translation_context(PropertyRNA *prop); -int RNA_property_ui_icon(PropertyRNA *prop); +const char *RNA_property_ui_name(const PropertyRNA *prop); +const char *RNA_property_ui_name_raw(const PropertyRNA *prop); +const char *RNA_property_ui_description(const PropertyRNA *prop); +const char *RNA_property_ui_description_raw(const PropertyRNA *prop); +const char *RNA_property_translation_context(const PropertyRNA *prop); +int RNA_property_ui_icon(const PropertyRNA *prop); /* Dynamic Property Information */ @@ -1471,6 +1473,7 @@ bool RNA_struct_override_matches(struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, const char *root_path, + const size_t root_path_len, struct IDOverrideLibrary *override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags); @@ -1488,7 +1491,8 @@ void RNA_struct_override_apply(struct Main *bmain, struct IDOverrideLibrary *override); struct IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr, - PropertyRNA *prop); + PropertyRNA *prop, + struct ID **r_owner_id); struct IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr, PropertyRNA *prop, bool *r_created); diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 64a8e5cbdfb..eaea895746e 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -48,6 +48,7 @@ set(DEFSRC rna_fluid.c rna_gpencil.c rna_gpencil_modifier.c + rna_hair.c rna_image.c rna_key.c rna_lattice.c @@ -78,9 +79,11 @@ set(DEFSRC rna_sculpt_paint.c rna_sequencer.c rna_shader_fx.c + rna_simulation.c rna_sound.c rna_space.c rna_speaker.c + rna_pointcloud.c rna_test.c rna_text.c rna_texture.c @@ -97,20 +100,6 @@ set(DEFSRC rna_xr.c ) -if(WITH_NEW_OBJECT_TYPES) - list(APPEND DEFSRC - rna_hair.c - rna_pointcloud.c - ) -endif() - -if (WITH_NEW_SIMULATION_TYPE) - list(APPEND DEFSRC - rna_simulation.c - ) -endif() - - set(APISRC rna_action_api.c rna_animation_api.c @@ -346,15 +335,6 @@ if(WITH_XR_OPENXR) add_definitions(-DWITH_XR_OPENXR) endif() -if(WITH_NEW_OBJECT_TYPES) - add_definitions(-DWITH_NEW_OBJECT_TYPES) -endif() - -if (WITH_NEW_SIMULATION_TYPE) - add_definitions(-DWITH_NEW_SIMULATION_TYPE) -endif() - - # Build makesrna executable blender_include_dirs( . @@ -444,3 +424,6 @@ set(LIB add_definitions(${GL_DEFINITIONS}) blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") + +# Needed so we can use dna_type_offsets.h for defaults initialization. +add_dependencies(bf_blenkernel bf_dna) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index ff435710561..8d61b21759f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3770,7 +3770,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr /* XXX This systematically enforces that flag on ID pointers... * we'll probably have to revisit. :/ */ StructRNA *type = rna_find_struct((const char *)pprop->type); - if (type && (type->flag & STRUCT_ID)) { + if (type && (type->flag & STRUCT_ID) && + !(prop->flag_internal & PROP_INTERN_PTR_OWNERSHIP_FORCED)) { prop->flag |= PROP_PTR_NO_OWNERSHIP; } break; @@ -3781,7 +3782,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr /* XXX This systematically enforces that flag on ID pointers... * we'll probably have to revisit. :/ */ StructRNA *type = rna_find_struct((const char *)cprop->item_type); - if (type && (type->flag & STRUCT_ID)) { + if (type && (type->flag & STRUCT_ID) && + !(prop->flag_internal & PROP_INTERN_PTR_OWNERSHIP_FORCED)) { prop->flag |= PROP_PTR_NO_OWNERSHIP; } break; @@ -4270,9 +4272,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint}, {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve}, {"rna_gpencil.c", NULL, RNA_def_gpencil}, -#ifdef WITH_NEW_OBJECT_TYPES {"rna_hair.c", NULL, RNA_def_hair}, -#endif {"rna_image.c", "rna_image_api.c", RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, {"rna_light.c", NULL, RNA_def_light}, @@ -4295,9 +4295,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_packedfile.c", NULL, RNA_def_packedfile}, {"rna_palette.c", NULL, RNA_def_palette}, {"rna_particle.c", NULL, RNA_def_particle}, -#ifdef WITH_NEW_OBJECT_TYPES {"rna_pointcloud.c", NULL, RNA_def_pointcloud}, -#endif {"rna_pose.c", "rna_pose_api.c", RNA_def_pose}, {"rna_curveprofile.c", NULL, RNA_def_profile}, {"rna_lightprobe.c", NULL, RNA_def_lightprobe}, @@ -4307,9 +4305,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_screen.c", NULL, RNA_def_screen}, {"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint}, {"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer}, -#ifdef WITH_NEW_SIMULATION_TYPE {"rna_simulation.c", NULL, RNA_def_simulation}, -#endif {"rna_space.c", "rna_space_api.c", RNA_def_space}, {"rna_speaker.c", NULL, RNA_def_speaker}, {"rna_test.c", NULL, RNA_def_test}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 7c84ceb4f7f..b8b60121054 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -71,17 +71,13 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""}, {ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_CUBEMAP, "Light Probe", ""}, {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""}, -#ifdef WITH_NEW_SIMULATION_TYPE {ID_SIM, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */ -#endif {ID_SO, "SOUND", ICON_SOUND, "Sound", ""}, {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""}, {ID_TXT, "TEXT", ICON_TEXT, "Text", ""}, {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""}, -#ifdef WITH_NEW_OBJECT_TYPES {ID_HA, "HAIR", ICON_HAIR_DATA, "Hair", ""}, {ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "PointCloud", ""}, -#endif {ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""}, {ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""}, {ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""}, @@ -256,11 +252,9 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_FreestyleLineStyle) { return ID_LS; } -# ifdef WITH_NEW_OBJECT_TYPES if (base_type == &RNA_Hair) { return ID_HA; } -# endif if (base_type == &RNA_Lattice) { return ID_LT; } @@ -294,11 +288,9 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_PaintCurve) { return ID_PC; } -# ifdef WITH_NEW_OBJECT_TYPES if (base_type == &RNA_PointCloud) { return ID_PT; } -# endif if (base_type == &RNA_LightProbe) { return ID_LP; } @@ -308,11 +300,9 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Screen) { return ID_SCR; } -# ifdef WITH_NEW_SIMULATION_TYPE if (base_type == &RNA_Simulation) { return ID_SIM; } -# endif if (base_type == &RNA_Sound) { return ID_SO; } @@ -366,11 +356,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_GR: return &RNA_Collection; case ID_HA: -# ifdef WITH_NEW_OBJECT_TYPES return &RNA_Hair; -# else - return &RNA_ID; -# endif case ID_IM: return &RNA_Image; case ID_KE: @@ -404,11 +390,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_PC: return &RNA_PaintCurve; case ID_PT: -# ifdef WITH_NEW_OBJECT_TYPES return &RNA_PointCloud; -# else - return &RNA_ID; -# endif case ID_LP: return &RNA_LightProbe; case ID_SCE: @@ -416,11 +398,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_SCR: return &RNA_Screen; case ID_SIM: -# ifdef WITH_NEW_SIMULATION_TYPE return &RNA_Simulation; -# else - return &RNA_ID; -# endif case ID_SO: return &RNA_Sound; case ID_SPK: @@ -1588,6 +1566,7 @@ static void rna_def_ID(BlenderRNA *brna) "Preview", "Preview image and icon of this data-block (None if not supported for this type of data)"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); RNA_def_property_pointer_funcs(prop, "rna_IDPreview_get", NULL, NULL, NULL); prop = RNA_def_pointer( @@ -1730,7 +1709,7 @@ static void rna_def_library(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2197764794b..79cf993e0cc 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -273,9 +273,9 @@ static IDProperty *rna_idproperty_ui_container(PropertyRNA *prop) } /* return a UI local ID prop definition for this prop */ -static IDProperty *rna_idproperty_ui(PropertyRNA *prop) +static const IDProperty *rna_idproperty_ui(const PropertyRNA *prop) { - IDProperty *idprop = rna_idproperty_ui_container(prop); + IDProperty *idprop = rna_idproperty_ui_container((PropertyRNA *)prop); if (idprop) { return IDP_GetPropertyTypeFromGroup(idprop, ((IDProperty *)prop)->name, IDP_GROUP); @@ -645,7 +645,7 @@ static const char *rna_ensure_property_identifier(const PropertyRNA *prop) } } -static const char *rna_ensure_property_description(PropertyRNA *prop) +static const char *rna_ensure_property_description(const PropertyRNA *prop) { const char *description = NULL; @@ -654,7 +654,7 @@ static const char *rna_ensure_property_description(PropertyRNA *prop) } else { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item = IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING); @@ -1140,7 +1140,7 @@ PropertySubType RNA_property_subtype(PropertyRNA *prop) /* Restrict to arrays only for now for performance reasons. */ if (idprop->type == IDP_ARRAY && ELEM(idprop->subtype, IDP_INT, IDP_FLOAT, IDP_DOUBLE)) { - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item = IDP_GetPropertyTypeFromGroup(idp_ui, "subtype", IDP_STRING); @@ -1312,7 +1312,7 @@ void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, in if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -1353,7 +1353,7 @@ void RNA_property_int_ui_range( if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -1403,7 +1403,7 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -1448,7 +1448,7 @@ void RNA_property_float_ui_range(PointerRNA *ptr, if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -2025,35 +2025,34 @@ int RNA_property_enum_bitflag_identifiers( return 0; } -const char *RNA_property_ui_name(PropertyRNA *prop) +const char *RNA_property_ui_name(const PropertyRNA *prop) { return CTX_IFACE_(prop->translation_context, rna_ensure_property_name(prop)); } -const char *RNA_property_ui_name_raw(PropertyRNA *prop) +const char *RNA_property_ui_name_raw(const PropertyRNA *prop) { return rna_ensure_property_name(prop); } -const char *RNA_property_ui_description(PropertyRNA *prop) +const char *RNA_property_ui_description(const PropertyRNA *prop) { return TIP_(rna_ensure_property_description(prop)); } -const char *RNA_property_ui_description_raw(PropertyRNA *prop) +const char *RNA_property_ui_description_raw(const PropertyRNA *prop) { return rna_ensure_property_description(prop); } -const char *RNA_property_translation_context(PropertyRNA *_prop) +const char *RNA_property_translation_context(const PropertyRNA *prop) { - PropertyRNA *prop = rna_ensure_property(_prop); - return prop->translation_context; + return rna_ensure_property((PropertyRNA *)prop)->translation_context; } -int RNA_property_ui_icon(PropertyRNA *prop) +int RNA_property_ui_icon(const PropertyRNA *prop) { - return rna_ensure_property(prop)->icon; + return rna_ensure_property((PropertyRNA *)prop)->icon; } bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop_orig) @@ -2065,9 +2064,10 @@ bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop_orig) PropertyRNA *prop = rna_ensure_property(prop_orig); flag = prop->editable ? prop->editable(ptr, &dummy_info) : prop->flag; - return ((flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0 && - (!id || ((!ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)) && - (!id->override_library || RNA_property_overridable_get(ptr, prop_orig))))); + return ( + (flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0 && + (!id || ((!ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)) && + (!ID_IS_OVERRIDE_LIBRARY(id) || RNA_property_overridable_get(ptr, prop_orig))))); } /** @@ -2101,7 +2101,7 @@ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char * } return false; } - if (id->override_library != NULL) { + if (ID_IS_OVERRIDE_LIBRARY(id)) { /* We need the real data property in case of IDProperty here... */ PropertyRNA *real_prop = rna_ensure_property_realdata(&prop, ptr); if (real_prop == NULL || !RNA_property_overridable_get(ptr, real_prop)) { @@ -2847,7 +2847,7 @@ int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -2883,7 +2883,7 @@ void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int if (prop->magic != RNA_MAGIC) { int length = rna_ensure_property_array_length(ptr, prop); - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); IDProperty *item = idp_ui ? IDP_GetPropertyFromGroup(idp_ui, "default") : NULL; int defval = (item && item->type == IDP_INT) ? IDP_Int(item) : iprop->defaultvalue; @@ -3220,7 +3220,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); if (idp_ui) { IDProperty *item; @@ -3256,7 +3256,7 @@ void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, fl if (prop->magic != RNA_MAGIC) { int length = rna_ensure_property_array_length(ptr, prop); - IDProperty *idp_ui = rna_idproperty_ui(prop); + const IDProperty *idp_ui = rna_idproperty_ui(prop); IDProperty *item = idp_ui ? IDP_GetPropertyFromGroup(idp_ui, "default") : NULL; float defval = (item && item->type == IDP_DOUBLE) ? IDP_Double(item) : fprop->defaultvalue; @@ -3473,6 +3473,24 @@ void RNA_property_string_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop, { StringPropertyRNA *sprop = (StringPropertyRNA *)rna_ensure_property(prop); + if (prop->magic != RNA_MAGIC) { + /* attempt to get the local ID values */ + const IDProperty *idp_ui = rna_idproperty_ui(prop); + + if (idp_ui) { + IDProperty *item; + + item = IDP_GetPropertyTypeFromGroup(idp_ui, "default", IDP_STRING); + if (item) { + strcpy(value, IDP_String(item)); + return; + } + } + + strcpy(value, ""); + return; + } + BLI_assert(RNA_property_type(prop) == PROP_STRING); strcpy(value, sprop->defaultvalue); @@ -3507,6 +3525,22 @@ int RNA_property_string_default_length(PointerRNA *UNUSED(ptr), PropertyRNA *pro { StringPropertyRNA *sprop = (StringPropertyRNA *)rna_ensure_property(prop); + if (prop->magic != RNA_MAGIC) { + /* attempt to get the local ID values */ + const IDProperty *idp_ui = rna_idproperty_ui(prop); + + if (idp_ui) { + IDProperty *item; + + item = IDP_GetPropertyTypeFromGroup(idp_ui, "default", IDP_STRING); + if (item) { + return strlen(IDP_String(item)); + } + } + + return 0; + } + BLI_assert(RNA_property_type(prop) == PROP_STRING); return strlen(sprop->defaultvalue); @@ -5380,7 +5414,7 @@ bool RNA_path_resolve_property_full( * This is a convenience method to avoid logic errors and ugly syntax, * it combines both \a RNA_path_resolve and #RNA_path_resolve_property in a single call. * \note Assumes all pointers provided are valid. - * \param r_item_pointer: The final Pointer or Collection item value. + * \param r_item_ptr: The final Pointer or Collection item value. * You must check for its validity before use! * \return True only if both a valid pointer and property are found after resolving the path */ @@ -5406,7 +5440,7 @@ bool RNA_path_resolve_property_and_item_pointer(PointerRNA *ptr, * it combines both \a RNA_path_resolve_full and * \a RNA_path_resolve_property_full in a single call. * \note Assumes all pointers provided are valid. - * \param r_item_pointer: The final Pointer or Collection item value. + * \param r_item_ptr: The final Pointer or Collection item value. * You must check for its validity before use! * \return True only if both a valid pointer and property are found after resolving the path */ diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 265e83ddcba..8cd8f80b7c8 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -18,17 +18,20 @@ * \ingroup RNA */ +#include <string.h> + #include "MEM_guardedalloc.h" #include "DNA_ID.h" #include "DNA_constraint_types.h" +#include "DNA_key_types.h" #include "DNA_modifier_types.h" #include "BLI_listbase.h" #include "BLI_string.h" #include "BLI_utildefines.h" -// #define DEBUG_OVERRIDE_TIMEIT +//#define DEBUG_OVERRIDE_TIMEIT #ifdef DEBUG_OVERRIDE_TIMEIT # include "PIL_time_utildefines.h" @@ -106,7 +109,7 @@ bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop) char *rna_path = RNA_path_from_ID_to_property(ptr, prop); ID *id = ptr->owner_id; - if (rna_path == NULL || id == NULL || id->override_library == NULL) { + if (rna_path == NULL || id == NULL || !ID_IS_OVERRIDE_LIBRARY(id)) { return false; } @@ -180,6 +183,7 @@ static int rna_property_override_diff(Main *bmain, PropertyRNA *prop_a, PropertyRNA *prop_b, const char *rna_path, + const size_t rna_path_len, eRNACompareMode mode, IDOverrideLibrary *override, const int flags, @@ -191,7 +195,7 @@ bool RNA_property_equals( BLI_assert(ELEM(mode, RNA_EQ_STRICT, RNA_EQ_UNSET_MATCH_ANY, RNA_EQ_UNSET_MATCH_NONE)); return (rna_property_override_diff( - bmain, ptr_a, ptr_b, prop, NULL, NULL, NULL, mode, NULL, 0, NULL) == 0); + bmain, ptr_a, ptr_b, prop, NULL, NULL, NULL, 0, mode, NULL, 0, NULL) == 0); } bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode) @@ -249,6 +253,7 @@ static int rna_property_override_diff(Main *bmain, PropertyRNA *prop_a, PropertyRNA *prop_b, const char *rna_path, + const size_t rna_path_len, eRNACompareMode mode, IDOverrideLibrary *override, const int flags, @@ -363,6 +368,7 @@ static int rna_property_override_diff(Main *bmain, mode, override, rna_path, + rna_path_len, diff_flags, &override_changed); if (override_changed && r_report_flags) { @@ -568,6 +574,7 @@ bool RNA_struct_override_matches(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, const char *root_path, + const size_t root_path_len, IDOverrideLibrary *override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags) @@ -649,31 +656,51 @@ bool RNA_struct_override_matches(Main *bmain, #endif #define RNA_PATH_BUFFSIZE 8192 -#define RNA_PATH_PRINTF(_str, ...) \ - if (BLI_snprintf(rna_path, RNA_PATH_BUFFSIZE, (_str), __VA_ARGS__) >= RNA_PATH_BUFFSIZE) { \ - rna_path = BLI_sprintfN((_str), __VA_ARGS__); \ - } \ - (void)0 -#define RNA_PATH_FREE \ - if (rna_path != rna_path_buffer) \ - MEM_freeN(rna_path) char rna_path_buffer[RNA_PATH_BUFFSIZE]; char *rna_path = rna_path_buffer; + size_t rna_path_len = 0; /* XXX TODO this will have to be refined to handle collections insertions, and array items */ if (root_path) { + BLI_assert(strlen(root_path) == root_path_len); + + const char *prop_name = RNA_property_identifier(prop_local); + const size_t prop_name_len = strlen(prop_name); + /* Inlined building, much much more efficient. */ if (prop_local->magic == RNA_MAGIC) { - RNA_PATH_PRINTF("%s.%s", root_path, RNA_property_identifier(prop_local)); + rna_path_len = root_path_len + 1 + prop_name_len; + if (rna_path_len >= RNA_PATH_BUFFSIZE) { + rna_path = MEM_mallocN(rna_path_len + 1, __func__); + } + + memcpy(rna_path, root_path, root_path_len); + rna_path[root_path_len] = '.'; + memcpy(rna_path + root_path_len + 1, prop_name, prop_name_len); + rna_path[rna_path_len] = '\0'; } else { - RNA_PATH_PRINTF("%s[\"%s\"]", root_path, RNA_property_identifier(prop_local)); + rna_path_len = root_path_len + 2 + prop_name_len + 2; + if (rna_path_len >= RNA_PATH_BUFFSIZE) { + rna_path = MEM_mallocN(rna_path_len + 1, __func__); + } + + memcpy(rna_path, root_path, root_path_len); + rna_path[root_path_len] = '['; + rna_path[root_path_len + 1] = '"'; + memcpy(rna_path + root_path_len + 2, prop_name, prop_name_len); + rna_path[root_path_len + 2 + prop_name_len] = '"'; + rna_path[root_path_len + 2 + prop_name_len + 1] = ']'; + rna_path[rna_path_len] = '\0'; } } else { /* This is rather slow, but is not much called, so not really worth optimizing. */ rna_path = RNA_path_from_ID_to_property(ptr_local, prop_local); + if (rna_path != NULL) { + rna_path_len = strlen(rna_path); + } } if (rna_path == NULL) { continue; @@ -684,7 +711,10 @@ bool RNA_struct_override_matches(Main *bmain, IDOverrideLibraryProperty *op = BKE_lib_override_library_property_find(override, rna_path); if (ignore_overridden && op != NULL) { BKE_lib_override_library_operations_tag(op, IDOVERRIDE_LIBRARY_TAG_UNUSED, false); - RNA_PATH_FREE; + + if (rna_path != rna_path_buffer) { + MEM_freeN(rna_path); + } continue; } @@ -702,6 +732,7 @@ bool RNA_struct_override_matches(Main *bmain, prop_local, prop_reference, rna_path, + rna_path_len, RNA_EQ_STRICT, override, flags, @@ -769,17 +800,18 @@ bool RNA_struct_override_matches(Main *bmain, matching = false; if (!(do_create || do_restore)) { /* Since we have no 'changing' action allowed, we can break here. */ - MEM_SAFE_FREE(rna_path); + if (rna_path != rna_path_buffer) { + MEM_freeN(rna_path); + } break; } } } - RNA_PATH_FREE; - + if (rna_path != rna_path_buffer) { + MEM_freeN(rna_path); + } #undef RNA_PATH_BUFFSIZE -#undef RNA_PATH_PRINTF -#undef RNA_PATH_FREE } RNA_property_collection_end(&iter); @@ -1045,18 +1077,70 @@ void RNA_struct_override_apply(Main *bmain, #endif } -IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop) +static char *rna_property_override_property_real_id_owner(PointerRNA *ptr, + PropertyRNA *prop, + ID **r_id) { ID *id = ptr->owner_id; + ID *owner_id = id; + const char *rna_path_prefix = NULL; + + *r_id = NULL; + + if (id == NULL) { + return NULL; + } - if (!id || !id->override_library) { + if (id->flag & (LIB_EMBEDDED_DATA | LIB_EMBEDDED_DATA_LIB_OVERRIDE)) { + /* XXX this is very bad band-aid code, but for now it will do. + * We should at least use a #define for those prop names. + * Ideally RNA as a whole should be aware of those PITA of embedded IDs, and have a way to + * retrieve their owner IDs and generate paths from those. + */ + + switch (GS(id->name)) { + case ID_KE: + owner_id = ((Key *)id)->from; + rna_path_prefix = "shape_keys."; + break; + case ID_GR: + /* Master collection, TODO. */ + break; + case ID_NT: + /* Root node trees, TODO. */ + break; + default: + BLI_assert(0); + } + } + + if (!ID_IS_OVERRIDE_LIBRARY_REAL(owner_id)) { return NULL; } char *rna_path = RNA_path_from_ID_to_property(ptr, prop); if (rna_path) { - IDOverrideLibraryProperty *op = BKE_lib_override_library_property_find(id->override_library, - rna_path); + char *rna_path_full = rna_path; + if (rna_path_prefix != NULL) { + rna_path_full = BLI_sprintfN("%s%s", rna_path_prefix, rna_path); + MEM_freeN(rna_path); + } + + *r_id = owner_id; + return rna_path_full; + } + return NULL; +} + +IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr, + PropertyRNA *prop, + ID **r_owner_id) +{ + char *rna_path; + + if ((rna_path = rna_property_override_property_real_id_owner(ptr, prop, r_owner_id)) != NULL) { + IDOverrideLibraryProperty *op = BKE_lib_override_library_property_find( + (*r_owner_id)->override_library, rna_path); MEM_freeN(rna_path); return op; } @@ -1067,14 +1151,10 @@ IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr, PropertyRNA *prop, bool *r_created) { - ID *id = ptr->owner_id; - - if (!id || !id->override_library) { - return NULL; - } + ID *id; + char *rna_path; - char *rna_path = RNA_path_from_ID_to_property(ptr, prop); - if (rna_path) { + if ((rna_path = rna_property_override_property_real_id_owner(ptr, prop, &id)) != NULL) { IDOverrideLibraryProperty *op = BKE_lib_override_library_property_get( id->override_library, rna_path, r_created); MEM_freeN(rna_path); @@ -1086,7 +1166,8 @@ IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr, IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_find( PointerRNA *ptr, PropertyRNA *prop, const int index, const bool strict, bool *r_strict) { - IDOverrideLibraryProperty *op = RNA_property_override_property_find(ptr, prop); + ID *owner_id; + IDOverrideLibraryProperty *op = RNA_property_override_property_find(ptr, prop, &owner_id); if (!op) { return NULL; @@ -1119,13 +1200,13 @@ eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr, PropertyRNA *prop, const int index) { - int override_status = 0; + uint override_status = 0; if (!BKE_lib_override_library_is_enabled()) { return override_status; } - if (!ptr || !prop || !ptr->owner_id || !(ptr->owner_id)->override_library) { + if (!ptr || !prop || !ptr->owner_id || !ID_IS_OVERRIDE_LIBRARY(ptr->owner_id)) { return override_status; } diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index e67366fc7ef..cec32877c0b 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -569,7 +569,6 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_FILE, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); -# ifdef WITH_NEW_OBJECT_TYPES prop = RNA_def_property(srna, "show_hairs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOHAIR); RNA_def_property_ui_text( @@ -583,7 +582,6 @@ static void rna_def_dopesheet(BlenderRNA *brna) prop, "Display Point Cloud", "Include visualization of point cloud related animation data"); RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_POINTCLOUD, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); -# endif prop = RNA_def_property(srna, "show_volumes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOVOLUME); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index cc5cd97a8a0..b139e4609cd 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -99,6 +99,8 @@ const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { {SCULPT_TOOL_CLOTH, "CLOTH", ICON_BRUSH_SCULPT_DRAW, "Cloth", ""}, {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""}, {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""}, + {SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""}, + {SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""}, {SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -314,7 +316,8 @@ static bool rna_BrushCapabilitiesSculpt_has_topology_rake_get(PointerRNA *ptr) static bool rna_BrushCapabilitiesSculpt_has_auto_smooth_get(PointerRNA *ptr) { Brush *br = (Brush *)ptr->data; - return !ELEM(br->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH); + return !ELEM( + br->sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR); } static bool rna_BrushCapabilitiesSculpt_has_height_get(PointerRNA *ptr) @@ -409,6 +412,12 @@ static bool rna_BrushCapabilitiesSculpt_has_sculpt_plane_get(PointerRNA *ptr) SCULPT_TOOL_SMOOTH); } +static bool rna_BrushCapabilitiesSculpt_has_color_get(PointerRNA *ptr) +{ + Brush *br = (Brush *)ptr->data; + return ELEM(br->sculpt_tool, SCULPT_TOOL_PAINT); +} + static bool rna_BrushCapabilitiesSculpt_has_secondary_color_get(PointerRNA *ptr) { Brush *br = (Brush *)ptr->data; @@ -1053,6 +1062,7 @@ static void rna_def_sculpt_capabilities(BlenderRNA *brna) SCULPT_TOOL_CAPABILITY(has_plane_offset, "Has Plane Offset"); SCULPT_TOOL_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle"); SCULPT_TOOL_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane"); + SCULPT_TOOL_CAPABILITY(has_color, "Has Color"); SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color"); SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke"); SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation"); @@ -2221,6 +2231,46 @@ static void rna_def_brush(BlenderRNA *brna) prop, "Strength", "How powerful the effect of the brush is when applied"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "flow"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); + RNA_def_property_ui_text(prop, "Flow", "Amount of paint that is applied per stroke sample"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop = RNA_def_property(srna, "wet_mix", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "wet_mix"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); + RNA_def_property_ui_text( + prop, "Wet Mix", "Amount of paint that is picked from the surface into the brush color"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop = RNA_def_property(srna, "wet_persistence", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "wet_persistence"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); + RNA_def_property_ui_text( + prop, + "Wet Persistence", + "Amount of wet paint that stays in the brush after applyig paint to the surface"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "density"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); + RNA_def_property_ui_text( + prop, "Density", "Amount of random elements that are going to be affected by the brush"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop = RNA_def_property(srna, "tip_scale_x", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "tip_scale_x"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); + RNA_def_property_ui_text(prop, "Tip Scale X", "Scale of the brush tip in the X axis"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "dash_ratio"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -2312,6 +2362,14 @@ static void rna_def_brush(BlenderRNA *brna) prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "disconnected_distance_max", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "disconnected_distance_max"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, + "Max Element Distance", + "Maximum distance to search for disconnected loose parts in the mesh"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "surface_smooth_shape_preservation"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -2607,6 +2665,11 @@ static void rna_def_brush(BlenderRNA *brna) prop, "Keep Anchor Point", "Keep the position of the last segment in the IK chain fixed"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "use_connected_only", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_USE_CONNECTED_ONLY); + RNA_def_property_ui_text(prop, "Connected Only", "Affect only topologically connected elements"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERT_TO_SCRAPE_FILL); RNA_def_property_ui_text(prop, diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c index 7b4b7c11c17..f9275ef1993 100644 --- a/source/blender/makesrna/intern/rna_cachefile.c +++ b/source/blender/makesrna/intern/rna_cachefile.c @@ -69,9 +69,13 @@ static void rna_def_alembic_object_path(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Object Path", "Path of an object inside of an Alembic archive"); RNA_def_struct_ui_icon(srna, ICON_NONE); + RNA_define_lib_overridable(true); + PropertyRNA *prop = RNA_def_property(srna, "path", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Path", "Object path"); RNA_def_struct_name_property(srna, prop); + + RNA_define_lib_overridable(false); } /* cachefile.object_paths */ @@ -90,6 +94,8 @@ static void rna_def_cachefile(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "CacheFile", ""); RNA_def_struct_ui_icon(srna, ICON_FILE); + RNA_define_lib_overridable(true); + PropertyRNA *prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file"); RNA_def_property_update(prop, 0, "rna_CacheFile_update"); @@ -167,6 +173,9 @@ static void rna_def_cachefile(BlenderRNA *brna) RNA_def_property_srna(prop, "AlembicObjectPaths"); RNA_def_property_ui_text( prop, "Object Paths", "Paths of the objects inside the Alembic archive"); + + RNA_define_lib_overridable(false); + rna_def_cachefile_object_paths(brna, prop); rna_def_animdata_common(srna); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 5405cb4e24a..af300f6e088 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2483,7 +2483,7 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text( - prop, "For Transform", "Transforms are affected by this constraint as well"); + prop, "Affect Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_define_lib_overridable(false); @@ -2556,7 +2556,7 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text( - prop, "For Transform", "Transforms are affected by this constraint as well"); + prop, "Affect Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_define_lib_overridable(false); @@ -2644,7 +2644,7 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text( - prop, "For Transform", "Transforms are affected by this constraint as well"); + prop, "Affect Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_define_lib_overridable(false); @@ -2684,7 +2684,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMITDIST_TRANSFORM); RNA_def_property_ui_text( - prop, "For Transform", "Transforms are affected by this constraint as well"); + prop, "Affect Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_define_lib_overridable(false); @@ -3380,7 +3380,7 @@ void RNA_def_constraint(BlenderRNA *brna) prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND); + RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0); RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 8b2658c7e0c..771235c85aa 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -687,7 +687,8 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type) nu->pntsv = 1; nu->orderu = nu->orderv = 4; - nu->resolu = nu->resolv = 12; + nu->resolu = cu->resolu; + nu->resolv = cu->resolv; nu->flag = CU_SMOOTH; if ((cu->flag & CU_3D) == 0) { @@ -1533,6 +1534,8 @@ static void rna_def_curve(BlenderRNA *brna) prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Shape Keys", ""); prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_curveprofile.c b/source/blender/makesrna/intern/rna_curveprofile.c index 94a35bdede8..ce91fc79085 100644 --- a/source/blender/makesrna/intern/rna_curveprofile.c +++ b/source/blender/makesrna/intern/rna_curveprofile.c @@ -62,6 +62,22 @@ # include "IMB_colormanagement.h" # include "IMB_imbuf.h" +/** + * Set both handle types for all selected points in the profile-- faster than changing types + * for many points individually. Also set both handles for the points. + */ +static void rna_CurveProfilePoint_handle_type_set(PointerRNA *ptr, int value) +{ + CurveProfilePoint *point = ptr->data; + CurveProfile *profile = point->profile; + + if (profile) { + BKE_curveprofile_selected_handle_set(profile, value, value); + BKE_curveprofile_update(profile, PROF_UPDATE_NONE); + WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); + } +} + static void rna_CurveProfile_clip_set(PointerRNA *ptr, bool value) { CurveProfile *profile = (CurveProfile *)ptr->data; @@ -73,7 +89,7 @@ static void rna_CurveProfile_clip_set(PointerRNA *ptr, bool value) profile->flag &= ~PROF_USE_CLIP; } - BKE_curveprofile_update(profile, false); + BKE_curveprofile_update(profile, PROF_UPDATE_CLIP); } static void rna_CurveProfile_sample_straight_set(PointerRNA *ptr, bool value) @@ -87,7 +103,7 @@ static void rna_CurveProfile_sample_straight_set(PointerRNA *ptr, bool value) profile->flag &= ~PROF_SAMPLE_STRAIGHT_EDGES; } - BKE_curveprofile_update(profile, false); + BKE_curveprofile_update(profile, PROF_UPDATE_NONE); } static void rna_CurveProfile_sample_even_set(PointerRNA *ptr, bool value) @@ -101,7 +117,7 @@ static void rna_CurveProfile_sample_even_set(PointerRNA *ptr, bool value) profile->flag &= ~PROF_SAMPLE_EVEN_LENGTHS; } - BKE_curveprofile_update(profile, false); + BKE_curveprofile_update(profile, PROF_UPDATE_NONE); } static void rna_CurveProfile_remove_point(CurveProfile *profile, @@ -135,14 +151,16 @@ static void rna_CurveProfile_initialize(struct CurveProfile *profile, int segmen static void rna_CurveProfile_update(struct CurveProfile *profile) { - BKE_curveprofile_update(profile, false); + BKE_curveprofile_update(profile, PROF_UPDATE_REMOVE_DOUBLES | PROF_UPDATE_CLIP); } #else static const EnumPropertyItem prop_handle_type_items[] = { - {HD_AUTO, "AUTO", 0, "Auto Handle", ""}, - {HD_VECT, "VECTOR", 0, "Vector Handle", ""}, + {HD_AUTO, "AUTO", ICON_HANDLE_AUTO, "Auto Handle", ""}, + {HD_VECT, "VECTOR", ICON_HANDLE_VECTOR, "Vector Handle", ""}, + {HD_FREE, "FREE", ICON_HANDLE_FREE, "Free Handle", ""}, + {HD_ALIGN, "ALIGN", ICON_HANDLE_ALIGNED, "Aligned Free Handles", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -162,14 +180,14 @@ static void rna_def_curveprofilepoint(BlenderRNA *brna) prop = RNA_def_property(srna, "handle_type_1", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h1"); RNA_def_property_enum_items(prop, prop_handle_type_items); - RNA_def_property_ui_text( - prop, "First Handle Type", "Path interpolation at this point: Bezier or vector"); + RNA_def_property_enum_funcs(prop, NULL, "rna_CurveProfilePoint_handle_type_set", NULL); + RNA_def_property_ui_text(prop, "First Handle Type", "Path interpolation at this point"); prop = RNA_def_property(srna, "handle_type_2", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h2"); RNA_def_property_enum_items(prop, prop_handle_type_items); - RNA_def_property_ui_text( - prop, "Second Handle Type", "Path interpolation at this point: Bezier or vector"); + RNA_def_property_enum_funcs(prop, NULL, "rna_CurveProfilePoint_handle_type_set", NULL); + RNA_def_property_ui_text(prop, "Second Handle Type", "Path interpolation at this point"); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PROF_SELECT); @@ -260,7 +278,7 @@ static void rna_def_curveprofile(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveProfile_sample_even_set"); func = RNA_def_function(srna, "update", "rna_CurveProfile_update"); - RNA_def_function_ui_description(func, "Update the profile"); + RNA_def_function_ui_description(func, "Refresh internal data, remove doubles and clip points"); func = RNA_def_function(srna, "initialize", "rna_CurveProfile_initialize"); parm = RNA_def_int(func, diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index d6bedc61424..bb791dd6e2d 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1324,7 +1324,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, switch (type) { case PROP_BOOLEAN: if (DefRNA.preprocess) { - if ((subtype & ~(PROP_LAYER_MEMBER)) != PROP_NONE) { + if ((subtype & ~PROP_LAYER_MEMBER) != PROP_NONE) { CLOG_ERROR(&LOG, "subtype does not apply to 'PROP_BOOLEAN' \"%s.%s\"", CONTAINER_RNA_ID(cont), @@ -1515,6 +1515,9 @@ void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag) void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag) { prop->flag &= ~flag; + if (flag & PROP_PTR_NO_OWNERSHIP) { + prop->flag_internal |= PROP_INTERN_PTR_OWNERSHIP_FORCED; + } } void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag) diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index e49186f4cb1..3ae16f8577a 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -687,7 +687,7 @@ static void rna_FModifier_start_frame_set(PointerRNA *ptr, float value) } } -static void rna_FModifer_end_frame_set(PointerRNA *ptr, float value) +static void rna_FModifier_end_frame_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; @@ -1665,7 +1665,7 @@ static void rna_def_fmodifier(BlenderRNA *brna) prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "efra"); RNA_def_property_float_funcs( - prop, NULL, "rna_FModifer_end_frame_set", "rna_FModifier_end_frame_range"); + prop, NULL, "rna_FModifier_end_frame_set", "rna_FModifier_end_frame_range"); RNA_def_property_ui_text( prop, "End Frame", diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index 94ba09b2bb8..b4fa791362f 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -557,7 +557,7 @@ static const EnumPropertyItem *rna_Fluid_cachetype_mesh_itemf(bContext *UNUSED(C } static const EnumPropertyItem *rna_Fluid_cachetype_volume_itemf(bContext *UNUSED(C), - PointerRNA *UNUSED(ptr), + PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { @@ -579,11 +579,16 @@ static const EnumPropertyItem *rna_Fluid_cachetype_volume_itemf(bContext *UNUSED RNA_enum_item_add(&item, &totitem, &tmp); # endif - tmp.value = FLUID_DOMAIN_FILE_RAW; - tmp.identifier = "RAW"; - tmp.name = "Raw Cache"; - tmp.description = "Raw file format (.raw)"; - RNA_enum_item_add(&item, &totitem, &tmp); + /* Support for deprecated .raw format. */ + FluidDomainSettings *mds = (FluidDomainSettings *)ptr->data; + if (mds->cache_data_format == FLUID_DOMAIN_FILE_RAW || + mds->cache_noise_format == FLUID_DOMAIN_FILE_RAW) { + tmp.value = FLUID_DOMAIN_FILE_RAW; + tmp.identifier = "RAW"; + tmp.name = "Raw Cache"; + tmp.description = "Raw file format (.raw)"; + RNA_enum_item_add(&item, &totitem, &tmp); + } RNA_enum_item_end(&item, &totitem); *r_free = true; @@ -1058,27 +1063,18 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) }; static EnumPropertyItem cache_types[] = { - {FLUID_DOMAIN_CACHE_REPLAY, - "REPLAY", - 0, - "Replay", - "Use the timeline to bake the scene. Pausing and resuming possible"}, + {FLUID_DOMAIN_CACHE_REPLAY, "REPLAY", 0, "Replay", "Use the timeline to bake the scene"}, {FLUID_DOMAIN_CACHE_MODULAR, "MODULAR", 0, "Modular", - "Bake every stage of the simulation separately. Pausing and resuming possible"}, - {FLUID_DOMAIN_CACHE_FINAL, - "FINAL", - 0, - "Final", - "Bake the entire simulation at once. Only generates the most essential cache files. " - "Pausing and resuming not possible"}, + "Bake every stage of the simulation separately"}, + {FLUID_DOMAIN_CACHE_ALL, "ALL", 0, "All", "Bake all simulation settings at once"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem smoke_data_depth_items[] = { - {16, "16", 0, "Float (Half)", "Half float (16 bit data)"}, - {0, "32", 0, "Float (Full)", "Full float (32 bit data)"}, /* default */ + static const EnumPropertyItem fluid_data_depth_items[] = { + {VDB_PRECISION_HALF_FLOAT, "16", 0, "Half", "Half float (16 bit data)"}, + {VDB_PRECISION_FULL_FLOAT, "32", 0, "Full", "Full float (32 bit data)"}, {0, NULL, 0, NULL, NULL}, }; @@ -2072,6 +2068,16 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Change the cache type of the simulation"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_domain_reset"); + prop = RNA_def_property(srna, "cache_resumable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_USE_RESUMABLE_CACHE); + RNA_def_property_ui_text( + prop, + "Resumable", + "Additional data will be saved so that the bake jobs can be resumed after pausing. Because " + "more data will be written to disk it is recommended to avoid enabling this option when " + "baking at high resolutions"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset"); + prop = RNA_def_property(srna, "cache_directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Fluid_cache_directory_set"); @@ -2320,13 +2326,13 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) /* OpenVDB options */ prop = RNA_def_property(srna, "openvdb_cache_compress_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "openvdb_comp"); + RNA_def_property_enum_sdna(prop, NULL, "openvdb_compression"); RNA_def_property_enum_items(prop, prop_compression_items); - RNA_def_property_ui_text(prop, "Compression", "Compression method to be used"); + RNA_def_property_ui_text(prop, "Compression", "facession method to be used"); - prop = RNA_def_property(srna, "data_depth", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_depth"); - RNA_def_property_enum_items(prop, smoke_data_depth_items); + prop = RNA_def_property(srna, "openvdb_data_depth", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "openvdb_data_depth"); + RNA_def_property_enum_items(prop, fluid_data_depth_items); RNA_def_property_ui_text(prop, "Data Depth", "Bit depth for writing all scalar (including vector) " diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index c707ad9b84e..c8d16ab65cc 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1011,6 +1011,12 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV Rotation", "Internal UV factor for dot mode"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + prop = RNA_def_property(srna, "uv_fill", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "uv_fill"); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "UV Fill", "Internal UV factor for filling"); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SPOINT_SELECT); RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_stroke_point_select_set"); diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 3a8ded1a275..1c39ad3a1a8 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -128,12 +128,12 @@ const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = { ICON_MOD_OPACITY, "Opacity", "Opacity of the strokes"}, - {eGpencilModifierType_Tint, "GP_TINT", ICON_MOD_TINT, "Tint", "Tint strokes with new color"}, {eGpencilModifierType_Texture, "GP_TEXTURE", ICON_TEXTURE, "Texture Mapping", "Change stroke uv texture values"}, + {eGpencilModifierType_Tint, "GP_TINT", ICON_MOD_TINT, "Tint", "Tint strokes with new color"}, {0, NULL, 0, NULL, NULL}, }; @@ -1490,7 +1490,7 @@ static void rna_def_modifier_gpencilarray(BlenderRNA *brna) RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); - prop = RNA_def_property(srna, "relative_offset", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "relative_offset", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "shift"); RNA_def_property_ui_text( prop, @@ -2127,8 +2127,7 @@ static void rna_def_modifier_gpencilmultiply(BlenderRNA *brna) prop = RNA_def_property(srna, "use_fade", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", GP_MULTIPLY_ENABLE_FADING); - RNA_def_property_ui_text( - prop, "Enable Fade", "Fade the stroke thickness for each generated stroke"); + RNA_def_property_ui_text(prop, "Fade", "Fade the stroke thickness for each generated stroke"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE); @@ -2183,12 +2182,12 @@ static void rna_def_modifier_gpenciltexture(BlenderRNA *brna) {GP_TEX_CONSTANT_LENGTH, "CONSTANT_LENGTH", 0, - "Keep Texture at Constant Length", + "Constant Length", "Keep the texture at a constant length regardless of the length of each stroke"}, {GP_TEX_FIT_STROKE, "FIT_STROKE", 0, - "Fit Texture to Stroke Length", + "Stroke Length", "Scale the texture to fit the length of each stroke"}, {0, NULL, 0, NULL, NULL}, }; @@ -2269,7 +2268,7 @@ static void rna_def_modifier_gpenciltexture(BlenderRNA *brna) RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100.0, 100.0, 0.1, 3); RNA_def_property_float_default(prop, 0.0f); - RNA_def_property_ui_text(prop, "Offset UVs", "Offset value to add to stroke UVs"); + RNA_def_property_ui_text(prop, "UV Offset", "Offset value to add to stroke UVs"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "uv_scale", PROP_FLOAT, PROP_NONE); @@ -2360,7 +2359,7 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna) prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", eGpencilModifierMode_Expanded); + RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index cbc376c863f..887bded8540 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -915,13 +915,13 @@ static void rna_def_image(BlenderRNA *brna) prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update"); /* eek. this is horrible but needed so we can save to a new name without blanking the data :( */ prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)"); prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index fe3ef21d15e..41c0e724234 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -116,7 +116,7 @@ static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *r ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); if (ibuf) { char filename[FILE_MAX]; - BLI_strncpy(filename, image->name, sizeof(filename)); + BLI_strncpy(filename, image->filepath, sizeof(filename)); BLI_path_abs(filename, ID_BLEND_PATH(bmain, &image->id)); /* note, we purposefully ignore packed files here, @@ -138,7 +138,7 @@ static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *r RPT_ERROR, "Image '%s' could not be saved to '%s'", image->id.name + 2, - image->name); + image->filepath); } } else { diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 381cee64d80..71971cf3cca 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -499,6 +499,7 @@ int rna_property_override_diff_default(struct Main *bmain, const int mode, struct IDOverrideLibrary *override, const char *rna_path, + const size_t rna_path_len, const int flags, bool *r_override_changed); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 0e3fc851a9b..345d84fc5b1 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -176,6 +176,7 @@ typedef int (*RNAPropOverrideDiff)(struct Main *bmain, const int mode, struct IDOverrideLibrary *override, const char *rna_path, + const size_t rna_path_len, const int flags, bool *r_override_changed); @@ -328,6 +329,9 @@ typedef enum PropertyFlagIntern { PROP_INTERN_RAW_ACCESS = (1 << 2), PROP_INTERN_RAW_ARRAY = (1 << 3), PROP_INTERN_FREE_POINTERS = (1 << 4), + /* Negative mirror of PROP_PTR_NO_OWNERSHIP, used to prevent automatically setting that one in + * makesrna when pointer is an ID... */ + PROP_INTERN_PTR_OWNERSHIP_FORCED = (1 << 5), } PropertyFlagIntern; /* Property Types */ diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 7955109d9bc..f0de7317913 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -918,6 +918,7 @@ static void rna_def_keyblock(BlenderRNA *brna) * (to test results) */ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "curval"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range"); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame"); @@ -944,6 +945,7 @@ static void rna_def_keyblock(BlenderRNA *brna) prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Mute", "Toggle this shape key"); RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1); RNA_def_property_update(prop, 0, "rna_Key_update_data"); @@ -966,6 +968,7 @@ static void rna_def_keyblock(BlenderRNA *brna) prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "data", "totelem"); RNA_def_property_struct_type(prop, "UnknownType"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Data", ""); RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", @@ -1028,6 +1031,7 @@ static void rna_def_key(BlenderRNA *brna) prop = RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "block", NULL); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_ui_text(prop, "Key Blocks", "Shape keys"); @@ -1051,6 +1055,7 @@ static void rna_def_key(BlenderRNA *brna) prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ctime"); RNA_def_property_range(prop, MINFRAME, MAXFRAME); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Evaluation Time", "Evaluation time for absolute shape keys"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); } diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 176fb838e91..fbbee1f5900 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -382,6 +382,8 @@ static void rna_def_lattice(BlenderRNA *brna) prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Shape Keys", ""); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index 2caf315e09e..e43079c967f 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -173,6 +173,7 @@ static void rna_def_light(BlenderRNA *brna) /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lights"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c index 788246f5edd..64c50b82d1f 100644 --- a/source/blender/makesrna/intern/rna_linestyle.c +++ b/source/blender/makesrna/intern/rna_linestyle.c @@ -2188,6 +2188,7 @@ static void rna_def_linestyle(BlenderRNA *brna) /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based shaders"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 2f37e4079c7..1670e08325f 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -109,9 +109,7 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(collections) RNA_MAIN_LISTBASE_FUNCS_DEF(curves) RNA_MAIN_LISTBASE_FUNCS_DEF(fonts) RNA_MAIN_LISTBASE_FUNCS_DEF(gpencils) -# ifdef WITH_NEW_OBJECT_TYPES RNA_MAIN_LISTBASE_FUNCS_DEF(hairs) -# endif RNA_MAIN_LISTBASE_FUNCS_DEF(images) RNA_MAIN_LISTBASE_FUNCS_DEF(lattices) RNA_MAIN_LISTBASE_FUNCS_DEF(libraries) @@ -128,15 +126,11 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(objects) RNA_MAIN_LISTBASE_FUNCS_DEF(paintcurves) RNA_MAIN_LISTBASE_FUNCS_DEF(palettes) RNA_MAIN_LISTBASE_FUNCS_DEF(particles) -# ifdef WITH_NEW_OBJECT_TYPES RNA_MAIN_LISTBASE_FUNCS_DEF(pointclouds) -# endif RNA_MAIN_LISTBASE_FUNCS_DEF(scenes) RNA_MAIN_LISTBASE_FUNCS_DEF(screens) RNA_MAIN_LISTBASE_FUNCS_DEF(shapekeys) -# ifdef WITH_NEW_SIMULATION_TYPE RNA_MAIN_LISTBASE_FUNCS_DEF(simulations) -# endif RNA_MAIN_LISTBASE_FUNCS_DEF(sounds) RNA_MAIN_LISTBASE_FUNCS_DEF(speakers) RNA_MAIN_LISTBASE_FUNCS_DEF(texts) @@ -390,7 +384,6 @@ void RNA_def_main(BlenderRNA *brna) "LightProbes", "LightProbe data-blocks", RNA_def_main_lightprobes}, -# ifdef WITH_NEW_OBJECT_TYPES {"hairs", "Hair", "rna_Main_hairs_begin", "Hairs", "Hair data-blocks", RNA_def_main_hairs}, {"pointclouds", "PointCloud", @@ -398,21 +391,18 @@ void RNA_def_main(BlenderRNA *brna) "Point Clouds", "Point cloud data-blocks", RNA_def_main_pointclouds}, -# endif {"volumes", "Volume", "rna_Main_volumes_begin", "Volumes", "Volume data-blocks", RNA_def_main_volumes}, -# ifdef WITH_NEW_SIMULATION_TYPE {"simulations", "Simulation", "rna_Main_simulations_begin", "Simulations", "Simulation data-blocks", RNA_def_main_simulations}, -# endif {NULL, NULL, NULL, NULL, NULL, NULL}, }; @@ -455,7 +445,7 @@ void RNA_def_main(BlenderRNA *brna) 0, INT_MAX, "Version", - "Version of Blender the .blend was saved with", + "File format version the .blend file was saved with", 0, INT_MAX); RNA_def_property_int_funcs(prop, "rna_Main_version_get", NULL, NULL); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 093fd8b3bd5..990a5412093 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -708,7 +708,6 @@ static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name) return gpd; } -# ifdef WITH_NEW_OBJECT_TYPES static Hair *rna_Main_hairs_new(Main *bmain, const char *name) { char safe_name[MAX_ID_NAME - 2]; @@ -728,7 +727,6 @@ static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name) id_us_min(&pointcloud->id); return pointcloud; } -# endif static Volume *rna_Main_volumes_new(Main *bmain, const char *name) { @@ -740,7 +738,6 @@ static Volume *rna_Main_volumes_new(Main *bmain, const char *name) return volume; } -# ifdef WITH_NEW_SIMULATION_TYPE static Simulation *rna_Main_simulations_new(Main *bmain, const char *name) { char safe_name[MAX_ID_NAME - 2]; @@ -750,7 +747,6 @@ static Simulation *rna_Main_simulations_new(Main *bmain, const char *name) id_us_min(&simulation->id); return simulation; } -# endif /* tag functions, all the same */ # define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \ @@ -794,14 +790,10 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF) RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC) RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS) RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP) -# ifdef WITH_NEW_OBJECT_TYPES RNA_MAIN_ID_TAG_FUNCS_DEF(hairs, hairs, ID_HA) RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT) -# endif RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO) -# ifdef WITH_NEW_SIMULATION_TYPE RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM) -# endif # undef RNA_MAIN_ID_TAG_FUNCS_DEF diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 5191869be3a..1004fc94d16 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -542,7 +542,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); prop = RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_MATERIAL_ONIONSKIN); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_MATERIAL_HIDE_ONIONSKIN); RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); RNA_def_property_ui_text( prop, "Show in Ghosts", "Display strokes using this color when showing onion skins"); @@ -784,6 +784,7 @@ void RNA_def_material(BlenderRNA *brna) /* nodetree */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 5f986c28964..506bfdb8c75 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -721,8 +721,6 @@ static void rna_MeshUVLoopLayer_clone_set(PointerRNA *ptr, bool value) DEFINE_CUSTOMDATA_LAYER_COLLECTION(vertex_color, ldata, CD_MLOOPCOL) DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM( vertex_color, ldata, CD_MLOOPCOL, active, MeshLoopColorLayer) -DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM( - vertex_color, ldata, CD_MLOOPCOL, render, MeshLoopColorLayer) static void rna_MeshLoopColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { @@ -758,6 +756,46 @@ static void rna_MeshLoopColorLayer_active_set(PointerRNA *ptr, bool value) rna_CustomDataLayer_active_set(ptr, rna_mesh_ldata(ptr), value, CD_MLOOPCOL, 0); } +/* sculpt_vertex_color_layers */ + +DEFINE_CUSTOMDATA_LAYER_COLLECTION(sculpt_vertex_color, vdata, CD_PROP_COLOR) +DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM( + sculpt_vertex_color, vdata, CD_PROP_COLOR, active, MeshVertColorLayer) + +static void rna_MeshVertColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Mesh *me = rna_mesh(ptr); + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; + rna_iterator_array_begin( + iter, layer->data, sizeof(MPropCol), (me->edit_mesh) ? 0 : me->totvert, 0, NULL); +} + +static int rna_MeshVertColorLayer_data_length(PointerRNA *ptr) +{ + Mesh *me = rna_mesh(ptr); + return (me->edit_mesh) ? 0 : me->totvert; +} + +static bool rna_MeshVertColorLayer_active_render_get(PointerRNA *ptr) +{ + return rna_CustomDataLayer_active_get(ptr, rna_mesh_vdata(ptr), CD_PROP_COLOR, 1); +} + +static bool rna_MeshVertColorLayer_active_get(PointerRNA *ptr) +{ + return rna_CustomDataLayer_active_get(ptr, rna_mesh_vdata(ptr), CD_PROP_COLOR, 0); +} + +static void rna_MeshVertColorLayer_active_render_set(PointerRNA *ptr, bool value) +{ + rna_CustomDataLayer_active_set(ptr, rna_mesh_vdata(ptr), value, CD_PROP_COLOR, 1); +} + +static void rna_MeshVertColorLayer_active_set(PointerRNA *ptr, bool value) +{ + rna_CustomDataLayer_active_set(ptr, rna_mesh_vdata(ptr), value, CD_PROP_COLOR, 0); +} + static int rna_float_layer_check(CollectionPropertyIterator *UNUSED(iter), void *data) { CustomDataLayer *layer = (CustomDataLayer *)data; @@ -1218,6 +1256,19 @@ static char *rna_MeshColor_path(PointerRNA *ptr) return rna_LoopCustomData_data_path(ptr, "vertex_colors", CD_MLOOPCOL); } +static char *rna_MeshVertColorLayer_path(PointerRNA *ptr) +{ + CustomDataLayer *cdl = ptr->data; + char name_esc[sizeof(cdl->name) * 2]; + BLI_strescape(name_esc, cdl->name, sizeof(name_esc)); + return BLI_sprintfN("sculpt_vertex_colors[\"%s\"]", name_esc); +} + +static char *rna_MeshVertColor_path(PointerRNA *ptr) +{ + return rna_VertCustomData_data_path(ptr, "sculpt_vertex_colors", CD_PROP_COLOR); +} + /**** Float Property Layer API ****/ static char *rna_MeshVertexFloatPropertyLayer_path(PointerRNA *ptr) { @@ -1439,6 +1490,33 @@ static void rna_Mesh_vertex_color_remove(struct Mesh *me, } } +static PointerRNA rna_Mesh_sculpt_vertex_color_new(struct Mesh *me, + const char *name, + const bool do_init) +{ + PointerRNA ptr; + CustomData *vdata; + CustomDataLayer *cdl = NULL; + int index = ED_mesh_sculpt_color_add(me, name, false, do_init); + + if (index != -1) { + vdata = rna_mesh_vdata_helper(me); + cdl = &vdata->layers[CustomData_get_layer_index_n(vdata, CD_PROP_COLOR, index)]; + } + + RNA_pointer_create(&me->id, &RNA_MeshVertColorLayer, cdl, &ptr); + return ptr; +} + +static void rna_Mesh_sculpt_vertex_color_remove(struct Mesh *me, + ReportList *reports, + CustomDataLayer *layer) +{ + if (ED_mesh_sculpt_color_remove_named(me, layer->name) == false) { + BKE_reportf(reports, RPT_ERROR, "Sculpt vertex color '%s' not found", layer->name); + } +} + # define DEFINE_CUSTOMDATA_PROPERTY_API( \ elemname, datatype, cd_prop_type, cdata, countvar, layertype) \ static PointerRNA rna_Mesh_##elemname##_##datatype##_property_new(struct Mesh *me, \ @@ -1510,10 +1588,6 @@ static void UNUSED_FUNCTION(rna_mesh_unused)(void) (void)rna_Mesh_uv_layer_render_index_get; (void)rna_Mesh_uv_layer_render_index_set; (void)rna_Mesh_uv_layer_render_set; - (void)rna_Mesh_vertex_color_render_get; - (void)rna_Mesh_vertex_color_render_index_get; - (void)rna_Mesh_vertex_color_render_index_set; - (void)rna_Mesh_vertex_color_render_set; (void)rna_Mesh_face_map_index_range; (void)rna_Mesh_face_map_active_index_set; (void)rna_Mesh_face_map_active_index_get; @@ -2034,6 +2108,65 @@ static void rna_def_mloopcol(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } +static void rna_def_MPropCol(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "MeshVertColorLayer", NULL); + RNA_def_struct_ui_text(srna, + "Mesh Sculpt Vertex Color Layer", + "Layer of sculpt vertex colors in a Mesh data-block"); + RNA_def_struct_sdna(srna, "CustomDataLayer"); + RNA_def_struct_path_func(srna, "rna_MeshVertColorLayer_path"); + RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL); + + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshVertexLayer_name_set"); + RNA_def_property_ui_text(prop, "Name", "Name of Sculpt Vertex color layer"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs( + prop, "rna_MeshVertColorLayer_active_get", "rna_MeshVertColorLayer_active_set"); + RNA_def_property_ui_text( + prop, "Active", "Sets the sculpt vertex color layer as active for display and editing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0); + RNA_def_property_boolean_funcs(prop, + "rna_MeshVertColorLayer_active_render_get", + "rna_MeshVertColorLayer_active_render_set"); + RNA_def_property_ui_text( + prop, "Active Render", "Sets the sculpt vertex color layer as active for rendering"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "MeshVertColor"); + RNA_def_property_ui_text(prop, "Data", ""); + RNA_def_property_collection_funcs(prop, + "rna_MeshVertColorLayer_data_begin", + "rna_iterator_array_next", + "rna_iterator_array_end", + "rna_iterator_array_get", + "rna_MeshVertColorLayer_data_length", + NULL, + NULL, + NULL); + + srna = RNA_def_struct(brna, "MeshVertColor", NULL); + RNA_def_struct_sdna(srna, "MPropCol"); + RNA_def_struct_ui_text(srna, "Mesh Sculpt Vertex Color", "Vertex colors in a Mesh"); + RNA_def_struct_path_func(srna, "rna_MeshVertColor_path"); + + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 4); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); +} static void rna_def_mproperties(BlenderRNA *brna) { StructRNA *srna; @@ -2373,6 +2506,60 @@ static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_update(prop, 0, "rna_Mesh_update_data_edit_active_color"); } +static void rna_def_vert_colors(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "VertColors"); + srna = RNA_def_struct(brna, "VertColors", NULL); + RNA_def_struct_sdna(srna, "Mesh"); + RNA_def_struct_ui_text(srna, "Vert Colors", "Collection of sculpt vertex colors"); + + func = RNA_def_function(srna, "new", "rna_Mesh_sculpt_vertex_color_new"); + RNA_def_function_ui_description(func, "Add a sculpt vertex color layer to Mesh"); + RNA_def_string(func, "name", "Col", 0, "", "Sculpt Vertex color name"); + RNA_def_boolean(func, + "do_init", + true, + "", + "Whether new layer's data should be initialized by copying current active one"); + parm = RNA_def_pointer(func, "layer", "MeshVertColorLayer", "", "The newly created layer"); + RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); + RNA_def_function_return(func, parm); + + func = RNA_def_function(srna, "remove", "rna_Mesh_sculpt_vertex_color_remove"); + RNA_def_function_ui_description(func, "Remove a vertex color layer"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm = RNA_def_pointer(func, "layer", "MeshVertColorLayer", "", "The layer to remove"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); + + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "MeshVertColorLayer"); + RNA_def_property_pointer_funcs(prop, + "rna_Mesh_sculpt_vertex_color_active_get", + "rna_Mesh_sculpt_vertex_color_active_set", + NULL, + NULL); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); + RNA_def_property_ui_text( + prop, "Active Sculpt Vertex Color Layer", "Active sculpt vertex color layer"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data_edit_active_color"); + + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, + "rna_Mesh_sculpt_vertex_color_active_index_get", + "rna_Mesh_sculpt_vertex_color_active_index_set", + "rna_Mesh_sculpt_vertex_color_index_range"); + RNA_def_property_ui_text( + prop, "Active Sculpt Vertex Color Index", "Active sculpt vertex color index"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data_edit_active_color"); +} + static void rna_def_uv_layers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -2739,30 +2926,35 @@ static void rna_def_mesh(BlenderRNA *brna) prop = RNA_def_property(srna, "vertices", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert"); RNA_def_property_struct_type(prop, "MeshVertex"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh"); rna_def_mesh_vertices(brna, prop); prop = RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge"); RNA_def_property_struct_type(prop, "MeshEdge"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh"); rna_def_mesh_edges(brna, prop); prop = RNA_def_property(srna, "loops", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mloop", "totloop"); RNA_def_property_struct_type(prop, "MeshLoop"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Loops", "Loops of the mesh (polygon corners)"); rna_def_mesh_loops(brna, prop); prop = RNA_def_property(srna, "polygons", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mpoly", "totpoly"); RNA_def_property_struct_type(prop, "MeshPolygon"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Polygons", "Polygons of the mesh"); rna_def_mesh_polygons(brna, prop); prop = RNA_def_property(srna, "loop_triangles", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "runtime.looptris.array", "runtime.looptris.len"); RNA_def_property_struct_type(prop, "MeshLoopTriangle"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Loop Triangles", "Tessellation of mesh polygons into triangles"); rna_def_mesh_looptris(brna, prop); @@ -2789,6 +2981,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshUVLoopLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "UV Loop Layers", "All UV loop layers"); rna_def_uv_layers(brna, prop); @@ -2836,9 +3029,27 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshLoopColorLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Vertex Colors", "All vertex colors"); rna_def_loop_colors(brna, prop); + /* Sculpt Vertex colors */ + + prop = RNA_def_property(srna, "sculpt_vertex_colors", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "vdata.layers", "vdata.totlayer"); + RNA_def_property_collection_funcs(prop, + "rna_Mesh_sculpt_vertex_colors_begin", + NULL, + NULL, + NULL, + "rna_Mesh_sculpt_vertex_colors_length", + NULL, + NULL, + NULL); + RNA_def_property_struct_type(prop, "MeshVertColorLayer"); + RNA_def_property_ui_text(prop, "Sculpt Vertex Colors", "All vertex colors"); + rna_def_vert_colors(brna, prop); + /* TODO, edge customdata layers (bmesh py api can access already) */ prop = RNA_def_property(srna, "vertex_layers_float", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "vdata.layers", "vdata.totlayer"); @@ -2852,6 +3063,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshVertexFloatPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Float Property Layers", ""); rna_def_vertex_float_layers(brna, prop); @@ -2867,6 +3079,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshVertexIntPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Int Property Layers", ""); rna_def_vertex_int_layers(brna, prop); @@ -2882,6 +3095,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshVertexStringPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "String Property Layers", ""); rna_def_vertex_string_layers(brna, prop); @@ -2897,6 +3111,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshPolygonFloatPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Float Property Layers", ""); rna_def_polygon_float_layers(brna, prop); @@ -2912,6 +3127,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshPolygonIntPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Int Property Layers", ""); rna_def_polygon_int_layers(brna, prop); @@ -2927,6 +3143,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshPolygonStringPropertyLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "String Property Layers", ""); rna_def_polygon_string_layers(brna, prop); @@ -2943,6 +3160,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshFaceMapLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "FaceMap", ""); rna_def_face_maps(brna, prop); @@ -2959,6 +3177,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshSkinVertexLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Skin Vertices", "All skin vertices"); rna_def_skin_vertices(brna, prop); /* End skin vertices */ @@ -2976,6 +3195,7 @@ static void rna_def_mesh(BlenderRNA *brna) NULL, NULL); RNA_def_property_struct_type(prop, "MeshPaintMaskLayer"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); RNA_def_property_ui_text(prop, "Vertex Paint Mask", "Vertex paint mask"); rna_def_paint_mask(brna, prop); /* End paint mask */ @@ -3033,6 +3253,13 @@ static void rna_def_mesh(BlenderRNA *brna) prop, "Preserve Face Sets", "Keep the current Face Sets on the new mesh"); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + prop = RNA_def_property(srna, "use_remesh_preserve_vertex_colors", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_REMESH_REPROJECT_VERTEX_COLORS); + RNA_def_property_boolean_default(prop, false); + RNA_def_property_ui_text( + prop, "Preserve Vertex Colors", "Keep the current vertex colors on the new mesh"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + prop = RNA_def_property(srna, "remesh_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "remesh_mode"); RNA_def_property_enum_items(prop, rna_enum_mesh_remesh_mode_items); @@ -3077,6 +3304,8 @@ static void rna_def_mesh(BlenderRNA *brna) prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Shape Keys", ""); /* texture space */ @@ -3183,6 +3412,7 @@ void RNA_def_mesh(BlenderRNA *brna) rna_def_mpolygon(brna); rna_def_mloopuv(brna); rna_def_mloopcol(brna); + rna_def_MPropCol(brna); rna_def_mproperties(brna); rna_def_face_map(brna); } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index ffd9bb772cc..57e46314777 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -290,13 +290,11 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = { "Spawn particles from the shape"}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""}, -#ifdef WITH_NEW_SIMULATION_TYPE {eModifierType_Simulation, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */ -#endif {0, NULL, 0, NULL, NULL}, }; @@ -1163,7 +1161,7 @@ static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) static void rna_BevelModifier_update_segments(Main *bmain, Scene *scene, PointerRNA *ptr) { BevelModifierData *bmd = (BevelModifierData *)ptr->data; - if (RNA_boolean_get(ptr, "use_custom_profile")) { + if (RNA_enum_get(ptr, "profile_type") == MOD_BEVEL_PROFILE_CUSTOM) { short segments = (short)RNA_int_get(ptr, "segments"); BKE_curveprofile_initialize(bmd->custom_profile, segments); } @@ -1632,7 +1630,6 @@ static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr, CLAMP_MIN(psmd->psys, 1); } -# ifdef WITH_NEW_SIMULATION_TYPE static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, PointerRNA *ptr) { SimulationModifierData *smd = ptr->data; @@ -1641,11 +1638,10 @@ static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, } rna_Modifier_dependency_update(bmain, scene, ptr); } -# endif /** * Special set callback that just changes the first bit of the expansion flag. - * This way the expansion state of all the subpanels is not changed by RNA. + * This way the expansion state of all the sub-panels is not changed by RNA. */ static void rna_Modifier_show_expanded_set(PointerRNA *ptr, bool value) { @@ -3948,6 +3944,25 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) 0, "Percent", "Amount is percent of adjacent edge length"}, + {MOD_BEVEL_AMT_ABSOLUTE, + "ABSOLUTE", + 0, + "Absolute", + "Amount is absolute distance along adjacent edge"}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem prop_profile_type_items[] = { + {MOD_BEVEL_PROFILE_SUPERELLIPSE, + "SUPERELLIPSE", + 0, + "Superellipse", + "The profile can be a concave or convex curve"}, + {MOD_BEVEL_PROFILE_CUSTOM, + "CUSTOM", + 0, + "Custom", + "The profile can be any arbitrary path between its endpoints"}, {0, NULL, 0, NULL, NULL}, }; @@ -4061,6 +4076,13 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "profile_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "profile_type"); + RNA_def_property_enum_items(prop, prop_profile_type_items); + RNA_def_property_ui_text( + prop, "Profile Type", "The type of shape used to rebuild a beveled section"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); @@ -4120,12 +4142,6 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_custom_profile", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_CUSTOM_PROFILE); - RNA_def_property_ui_text( - prop, "Custom Profile", "Whether to use a user inputted curve for the bevel's profile"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "custom_profile", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "CurveProfile"); RNA_def_property_pointer_sdna(prop, NULL, "custom_profile"); @@ -5021,7 +5037,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, {MOD_WVG_MAPPING_STEP, "STEP", - ICON_NOCURVE /* Would need a better icon... */, + ICON_IPO_CONSTANT, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, {0, NULL, 0, NULL, NULL}, @@ -5272,7 +5288,7 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, {MOD_WVG_MAPPING_STEP, "STEP", - ICON_NOCURVE /* Would need a better icon... */, + ICON_IPO_CONSTANT, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, {0, NULL, 0, NULL, NULL}, @@ -5438,6 +5454,7 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "voxel_size"); + RNA_def_property_range(prop, 0.0001f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Voxel Size", @@ -6818,12 +6835,10 @@ static void rna_def_modifier_simulation(BlenderRNA *brna) RNA_define_lib_overridable(true); -# ifdef WITH_NEW_SIMULATION_TYPE prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Simulation", "Simulation to access"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_SimulationModifier_simulation_update"); -# endif prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); RNA_def_property_ui_text( diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index f55d44e7bad..f3c73e75434 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -329,7 +329,7 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_SEQUENCE); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file"); RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 32999c91fad..6312c84cf9f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3629,8 +3629,8 @@ static void rna_ShaderNodeTexIES_mode_set(PointerRNA *ptr, int value) if (node->id) { Text *text = (Text *)node->id; - if (value == NODE_IES_EXTERNAL && text->name) { - BLI_strncpy(nss->filepath, text->name, sizeof(nss->filepath)); + if (value == NODE_IES_EXTERNAL && text->filepath) { + BLI_strncpy(nss->filepath, text->filepath, sizeof(nss->filepath)); BLI_path_rel(nss->filepath, BKE_main_blendfile_path_from_global()); } @@ -3654,8 +3654,8 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value) if (node->id) { Text *text = (Text *)node->id; - if (value == NODE_SCRIPT_EXTERNAL && text->name) { - BLI_strncpy(nss->filepath, text->name, sizeof(nss->filepath)); + if (value == NODE_SCRIPT_EXTERNAL && text->filepath) { + BLI_strncpy(nss->filepath, text->filepath, sizeof(nss->filepath)); BLI_path_rel(nss->filepath, BKE_main_blendfile_path_from_global()); } @@ -4405,8 +4405,9 @@ static void def_sh_tex(StructRNA *srna) static void def_sh_tex_sky(StructRNA *srna) { static const EnumPropertyItem prop_sky_type[] = { - {SHD_SKY_OLD, "PREETHAM", 0, "Preetham", ""}, - {SHD_SKY_NEW, "HOSEK_WILKIE", 0, "Hosek / Wilkie", ""}, + {SHD_SKY_PREETHAM, "PREETHAM", 0, "Preetham", "Preetham 1999"}, + {SHD_SKY_HOSEK, "HOSEK_WILKIE", 0, "Hosek / Wilkie", "Hosek / Wilkie 2012"}, + {SHD_SKY_NISHITA, "NISHITA", 0, "Nishita", "Nishita 1993 improved"}, {0, NULL, 0, NULL, NULL}, }; static float default_dir[3] = {0.0f, 0.0f, 1.0f}; @@ -4419,7 +4420,7 @@ static void def_sh_tex_sky(StructRNA *srna) prop = RNA_def_property(srna, "sky_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sky_model"); RNA_def_property_enum_items(prop, prop_sky_type); - RNA_def_property_ui_text(prop, "Sky Type", ""); + RNA_def_property_ui_text(prop, "Sky Type", "Which sky model should be used"); RNA_def_property_update(prop, 0, "rna_Node_update"); prop = RNA_def_property(srna, "sun_direction", PROP_FLOAT, PROP_DIRECTION); @@ -4439,6 +4440,54 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_ui_text( prop, "Ground Albedo", "Ground color that is subtly reflected in the sky"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "sun_disc", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Sun Disc", "Include the sun itself in the output"); + RNA_def_property_boolean_sdna(prop, NULL, "sun_disc", 1); + RNA_def_property_boolean_default(prop, true); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_ui_text(prop, "Sun Size", "Size of sun disc (angular diameter)"); + RNA_def_property_range(prop, 0.0f, M_PI_2); + RNA_def_property_float_default(prop, DEG2RADF(0.545)); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "sun_elevation", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_ui_text(prop, "Sun Elevation", "Angle between sun and horizon"); + RNA_def_property_range(prop, -M_PI_2, M_PI_2); + RNA_def_property_float_default(prop, M_PI_2); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "sun_rotation", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_ui_text(prop, "Sun Rotation", "Rotation of sun around zenith"); + RNA_def_property_range(prop, 0.0f, 2.0f * M_PI); + RNA_def_property_float_default(prop, 0.0f); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "altitude", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, "Altitude", "Altitude height from sea level in meters"); + RNA_def_property_range(prop, 0, 60000); + RNA_def_property_int_default(prop, 0); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "air_density", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_ui_text(prop, "Air", "Density of air molecules (Rayleigh scattering)"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "dust_density", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_ui_text(prop, "Dust", "Density of dust and water molecules (Mie scattering)"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "ozone_density", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_ui_text(prop, "Ozone", "Density of Ozone layer (Ozone absorption)"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } static const EnumPropertyItem sh_tex_prop_interpolation_items[] = { @@ -8971,7 +9020,7 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) /* XXX These types should eventually be registered at runtime. * Then use the nodeStaticSocketType and nodeStaticSocketInterfaceType functions * to get the idname strings from int type and subtype - * (see node_socket.c, register_standard_node_socket_types). + * (see node_socket.cc, register_standard_node_socket_types). */ rna_def_node_socket_float(brna, "NodeSocketFloat", "NodeSocketInterfaceFloat", PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 79a9e0be051..089410ffd25 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -234,10 +234,8 @@ const EnumPropertyItem rna_enum_object_type_items[] = { OBTYPE_CU_SURF, {OB_MBALL, "META", 0, "Meta", ""}, OBTYPE_CU_FONT, -#ifdef WITH_NEW_OBJECT_TYPES {OB_HAIR, "HAIR", 0, "Hair", ""}, {OB_POINTCLOUD, "POINTCLOUD", 0, "PointCloud", ""}, -#endif {OB_VOLUME, "VOLUME", 0, "Volume", ""}, {0, "", 0, NULL, NULL}, {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, @@ -565,12 +563,10 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) return &RNA_LightProbe; case OB_GPENCIL: return &RNA_GreasePencil; -# ifdef WITH_NEW_OBJECT_TYPES case OB_HAIR: return &RNA_Hair; case OB_POINTCLOUD: return &RNA_PointCloud; -# endif case OB_VOLUME: return &RNA_Volume; default: @@ -1501,6 +1497,17 @@ static void rna_Object_constraints_move( WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT, object); } +static bConstraint *rna_Object_constraints_copy(Object *object, Main *bmain, PointerRNA *con_ptr) +{ + bConstraint *con = con_ptr->data; + bConstraint *new_con = BKE_constraint_copy_for_object(object, con); + + ED_object_constraint_tag_update(bmain, object, new_con); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, object); + + return new_con; +} + bool rna_Object_constraints_override_apply(Main *UNUSED(bmain), PointerRNA *ptr_dst, PointerRNA *ptr_src, @@ -2134,6 +2141,8 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Material Slot", "Material slot in an object"); RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA); + RNA_define_lib_overridable(true); + /* WARNING! Order is crucial for override to work properly here... :/ * 'link' must come before material pointer, * since it defines where (in object or obdata) that one is set! */ @@ -2141,7 +2150,6 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_property_enum_items(prop, link_items); RNA_def_property_enum_funcs( prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update"); @@ -2149,7 +2157,6 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_MaterialSlot_material_editable"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", @@ -2163,8 +2170,12 @@ static void rna_def_material_slot(BlenderRNA *brna) prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Material slot name"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_struct_name_property(srna, prop); + RNA_define_lib_overridable(false); + RNA_def_struct_path_func(srna, "rna_MaterialSlot_path"); } @@ -2221,6 +2232,21 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + + func = RNA_def_function(srna, "copy", "rna_Object_constraints_copy"); + RNA_def_function_ui_description(func, "Add a new constraint that is a copy of the given one"); + RNA_def_function_flag(func, FUNC_USE_MAIN); + /* constraint to copy */ + parm = RNA_def_pointer(func, + "constraint", + "Constraint", + "", + "Constraint to copy - may belong to a different object"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); + RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); + /* return type */ + parm = RNA_def_pointer(func, "new_constraint", "Constraint", "", "New constraint"); + RNA_def_function_return(func, parm); } /* object.modifiers */ @@ -2521,11 +2547,15 @@ static void rna_def_object_display(BlenderRNA *brna) RNA_def_struct_nested(brna, srna, "Object"); RNA_def_struct_path_func(srna, "rna_ObjectDisplay_path"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "dtx", OB_DRAW_NO_SHADOW_CAST); RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Shadow", "Object cast shadows in the 3d viewport"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); + + RNA_define_lib_overridable(false); } static void rna_def_object(BlenderRNA *brna) @@ -2572,12 +2602,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_pointer_funcs( prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", "rna_Object_data_poll"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Data", "Object data"); RNA_def_property_update(prop, 0, "rna_Object_internal_update_data_dependency"); @@ -2585,6 +2616,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, rna_enum_object_type_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Type", "Type of Object"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); @@ -2598,6 +2630,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "bound_box", PROP_FLOAT, PROP_NONE); 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_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); RNA_def_property_ui_text( prop, @@ -2609,7 +2642,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_parent_override_apply"); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); @@ -2662,11 +2694,13 @@ static void rna_def_object(BlenderRNA *brna) /* proxy */ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls"); prop = RNA_def_property(srna, "proxy_collection", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "proxy_group"); RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text( prop, "Proxy Collection", "Library collection duplicator object this proxy object controls"); @@ -2674,8 +2708,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "MaterialSlot"); - RNA_def_property_override_flag(prop, - PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_NO_PROP_NAME); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_PROP_NAME); /* don't dereference pointer! */ RNA_def_property_collection_funcs( prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL); @@ -2689,7 +2722,6 @@ static void rna_def_object(BlenderRNA *brna) NULL, "rna_MaterialSlot_material_poll"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_editable_func(prop, "rna_Object_active_material_editable"); RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update"); @@ -2697,7 +2729,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "actcol"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", @@ -2709,7 +2740,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_editable_array_func(prop, "rna_Object_location_editable"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Location", "Location of the object"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); @@ -2717,7 +2747,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); @@ -2730,7 +2759,6 @@ static void rna_def_object(BlenderRNA *brna) prop, "rna_Object_rotation_axis_angle_get", "rna_Object_rotation_axis_angle_set", NULL); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, rna_default_axis_angle); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text( prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); @@ -2738,7 +2766,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); @@ -2751,7 +2778,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_flag(prop, PROP_PROPORTIONAL); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); RNA_def_property_ui_text(prop, "Scale", "Scaling of the object"); @@ -2761,6 +2787,8 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_array(prop, 3); /* Only as convenient helper for py API, and conflicts with animating scale. */ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); 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); @@ -2859,12 +2887,16 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "obmat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_matrix_world_update"); prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text( prop, "Local Matrix", @@ -2878,6 +2910,8 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Input Matrix", "Matrix access to location, rotation and scale (including deltas), " @@ -2890,7 +2924,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "parentinv"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text( prop, "Parent Inverse Matrix", "Inverse of object's parent matrix at time of parenting"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); @@ -2901,8 +2934,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Modifiers", "Modifiers affecting the geometric data of the object"); RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_modifiers_override_apply"); - RNA_def_property_override_flag( - prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION); + RNA_def_property_override_flag(prop, PROPOVERRIDE_LIBRARY_INSERTION); rna_def_object_modifiers(brna, prop); /* Grease Pencil modifiers. */ @@ -2913,8 +2945,7 @@ static void rna_def_object(BlenderRNA *brna) prop, "Grease Pencil Modifiers", "Modifiers affecting the data of the grease pencil object"); RNA_def_property_override_funcs( prop, NULL, NULL, "rna_Object_greasepencil_modifiers_override_apply"); - RNA_def_property_override_flag( - prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION); + RNA_def_property_override_flag(prop, PROPOVERRIDE_LIBRARY_INSERTION); rna_def_object_grease_pencil_modifiers(brna, prop); /* Shader FX. */ @@ -2922,13 +2953,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "shader_fx", NULL); RNA_def_property_struct_type(prop, "ShaderFx"); RNA_def_property_ui_text(prop, "Shader Effects", "Effects affecting display of object"); + RNA_define_lib_overridable(false); rna_def_object_shaderfxs(brna, prop); + RNA_define_lib_overridable(true); /* constraints */ prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); - RNA_def_property_override_flag( - prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION); + RNA_def_property_override_flag(prop, PROPOVERRIDE_LIBRARY_INSERTION); RNA_def_property_ui_text( prop, "Constraints", "Constraints affecting the transformation of the object"); RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_constraints_override_apply"); @@ -2942,6 +2974,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL); RNA_def_property_struct_type(prop, "VertexGroup"); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object"); rna_def_object_vertex_groups(brna, prop); @@ -2949,6 +2982,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "face_maps", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fmaps", NULL); RNA_def_property_struct_type(prop, "FaceMap"); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Face Maps", "Maps of faces of the object"); rna_def_object_face_maps(brna, prop); @@ -3083,7 +3117,6 @@ static void rna_def_object(BlenderRNA *brna) /* restrict */ prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEWPORT); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update"); @@ -3091,14 +3124,12 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update"); prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update"); @@ -3115,12 +3146,6 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_update( prop, NC_OBJECT | ND_DRAW, "rna_Object_duplicator_visibility_flag_update"); - /* anim */ - rna_def_animdata_common(srna); - - rna_def_animviz_common(srna); - rna_def_motionpath_common(srna); - /* instancing */ prop = RNA_def_property(srna, "instance_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); @@ -3150,7 +3175,6 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Collection"); RNA_def_property_pointer_sdna(prop, NULL, "instance_collection"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_dup_collection_set", NULL, NULL); RNA_def_property_ui_text(prop, "Instance Collection", "Instance an existing collection"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); @@ -3158,6 +3182,8 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "is_instancer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); /* drawing */ prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE); @@ -3229,7 +3255,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pose"); RNA_def_property_struct_type(prop, "Pose"); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures"); /* shape keys */ @@ -3249,6 +3274,8 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE | PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key"); @@ -3273,11 +3300,15 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "base_flag", BASE_FROM_DUPLI); RNA_def_property_ui_text(prop, "Base from Instancer", "Object comes from a instancer"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); prop = RNA_def_property(srna, "is_from_set", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "base_flag", BASE_FROM_SET); RNA_def_property_ui_text(prop, "Base from Set", "Object comes from a background set"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); + RNA_def_property_override_clear_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); /* Object Display */ prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE); @@ -3286,6 +3317,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Object_display_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Object Display", "Object display settings for 3d viewport"); + RNA_define_lib_overridable(false); + + /* anim */ + rna_def_animdata_common(srna); + + rna_def_animviz_common(srna); + rna_def_motionpath_common(srna); + RNA_api_object(srna); } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 30e0ba19608..0a4e714c2ef 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1517,6 +1517,15 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Flow", "Convert effector force into air flow velocity"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + prop = RNA_def_property(srna, "wind_factor", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "f_wind_factor"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text( + prop, + "Wind Factor", + "How much the force is reduced when acting parallel to a surface, e.g. cloth"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + /* different ui range to above */ prop = RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_flow"); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 8f28fc56712..8dd3670087a 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -637,6 +637,21 @@ static void rna_PoseChannel_constraints_move( WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT, ob); } +static bConstraint *rna_PoseChannel_constraints_copy(ID *id, + bPoseChannel *pchan, + Main *bmain, + PointerRNA *con_ptr) +{ + Object *ob = (Object *)id; + bConstraint *con = con_ptr->data; + bConstraint *new_con = BKE_constraint_copy_for_pose(ob, pchan, con); + + ED_object_constraint_dependency_tag_update(bmain, ob, new_con); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, id); + + return new_con; +} + bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain), PointerRNA *ptr_dst, PointerRNA *ptr_src, @@ -978,6 +993,21 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + + func = RNA_def_function(srna, "copy", "rna_PoseChannel_constraints_copy"); + RNA_def_function_ui_description(func, "Add a new constraint that is a copy of the given one"); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_SELF_ID); + /* constraint to copy */ + parm = RNA_def_pointer(func, + "constraint", + "Constraint", + "", + "Constraint to copy - may belong to a different object"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); + RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); + /* return type */ + parm = RNA_def_pointer(func, "new_constraint", "Constraint", "", "New constraint"); + RNA_def_function_return(func, parm); } static void rna_def_pose_channel(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 6af031eb7b0..a41abb1a1dd 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -299,7 +299,7 @@ static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type) BLI_freelinkN(&R_engines, et); /* Stop all renders in case we were using this one. */ - ED_render_engine_changed(bmain); + ED_render_engine_changed(bmain, false); } static StructRNA *rna_RenderEngine_register(Main *bmain, diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index d7e93975d31..623b5864f5b 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1133,6 +1133,7 @@ static int rna_BlenderRNA_structs_lookup_string(PointerRNA *ptr, * (if they are IDs, or have different names or RNA type, then this would be meaningless). */ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *propptr_a, PointerRNA *propptr_b, + const bool no_ownership, const bool no_prop_name, bool *r_is_id, bool *r_is_null, @@ -1172,7 +1173,7 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop *r_is_id = RNA_struct_is_ID(propptr_a->type); *r_is_null = (ELEM(NULL, propptr_b, propptr_b->type, propptr_b->data)); *r_is_type_diff = (propptr_b == NULL || propptr_b->type != propptr_a->type); - is_valid_for_diffing = !(*r_is_id || *r_is_null); + is_valid_for_diffing = !((*r_is_id && no_ownership) || *r_is_null); } if (propptr_b == NULL || propptr_a->type != propptr_b->type) { @@ -1248,6 +1249,7 @@ static int rna_property_override_diff_propptr(Main *bmain, const bool no_prop_name, IDOverrideLibrary *override, const char *rna_path, + size_t rna_path_len, const char *rna_itemname_a, const char *rna_itemname_b, const int rna_itemindex_a, @@ -1265,6 +1267,7 @@ static int rna_property_override_diff_propptr(Main *bmain, * so no point in going inside of it at all! */ bool is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing(propptr_a, propptr_b, + no_ownership, no_prop_name, &is_id, &is_null, @@ -1278,7 +1281,7 @@ static int rna_property_override_diff_propptr(Main *bmain, if (is_id) { /* For now, once we deal with nodetrees we'll want to get rid of that one. */ - BLI_assert(no_ownership); + // BLI_assert(no_ownership); } if (override) { @@ -1324,16 +1327,7 @@ static int rna_property_override_diff_propptr(Main *bmain, char extended_rna_path_buffer[RNA_PATH_BUFFSIZE]; char *extended_rna_path = extended_rna_path_buffer; - -# define RNA_PATH_PRINTF(_str, ...) \ - if (BLI_snprintf(extended_rna_path_buffer, RNA_PATH_BUFFSIZE, (_str), __VA_ARGS__) >= \ - RNA_PATH_BUFFSIZE - 1) { \ - extended_rna_path = BLI_sprintfN((_str), __VA_ARGS__); \ - } \ - (void)0 -# define RNA_PATH_FREE() \ - if (extended_rna_path != extended_rna_path_buffer && extended_rna_path != rna_path) \ - MEM_freeN(extended_rna_path) + size_t extended_rna_path_len = 0; /* There may be a propname defined in some cases, while no actual name set * (e.g. happens with point cache), in that case too we want to fall back to index. @@ -1342,31 +1336,82 @@ static int rna_property_override_diff_propptr(Main *bmain, if ((rna_itemname_a != NULL && rna_itemname_a[0] != '\0') && (rna_itemname_b != NULL && rna_itemname_b[0] != '\0')) { BLI_assert(STREQ(rna_itemname_a, rna_itemname_b)); + char esc_item_name[RNA_PATH_BUFFSIZE]; - BLI_strescape(esc_item_name, rna_itemname_a, RNA_PATH_BUFFSIZE); - RNA_PATH_PRINTF("%s[\"%s\"]", rna_path, esc_item_name); + const size_t esc_item_name_len = BLI_strescape( + esc_item_name, rna_itemname_a, RNA_PATH_BUFFSIZE); + extended_rna_path_len = rna_path_len + 2 + esc_item_name_len + 2; + if (extended_rna_path_len >= RNA_PATH_BUFFSIZE) { + extended_rna_path = MEM_mallocN(extended_rna_path_len + 1, __func__); + } + + memcpy(extended_rna_path, rna_path, rna_path_len); + extended_rna_path[rna_path_len] = '['; + extended_rna_path[rna_path_len + 1] = '"'; + memcpy(extended_rna_path + rna_path_len + 2, esc_item_name, esc_item_name_len); + extended_rna_path[rna_path_len + 2 + esc_item_name_len] = '"'; + extended_rna_path[rna_path_len + 2 + esc_item_name_len + 1] = ']'; + extended_rna_path[extended_rna_path_len] = '\0'; } else if (rna_itemindex_a != -1) { /* Based on index... */ BLI_assert(rna_itemindex_a == rna_itemindex_b); - RNA_PATH_PRINTF("%s[%d]", rna_path, rna_itemindex_a); + + /* low-level specific highly-efficient conversion of positive integer to string. */ + char item_index_buff[32]; + size_t item_index_buff_len = 0; + if (rna_itemindex_a == 0) { + item_index_buff[0] = '0'; + item_index_buff_len = 1; + } + else { + uint index; + for (index = rna_itemindex_a; + index > 0 && item_index_buff_len < sizeof(item_index_buff); + index /= 10) { + item_index_buff[item_index_buff_len++] = '0' + (char)(index % 10); + } + BLI_assert(index == 0); + } + + extended_rna_path_len = rna_path_len + item_index_buff_len + 2; + if (extended_rna_path_len >= RNA_PATH_BUFFSIZE) { + extended_rna_path = MEM_mallocN(extended_rna_path_len + 1, __func__); + } + + memcpy(extended_rna_path, rna_path, rna_path_len); + extended_rna_path[rna_path_len] = '['; + for (size_t i = 1; i <= item_index_buff_len; i++) { + /* The first loop above generated inverted string representation of our index number. + */ + extended_rna_path[rna_path_len + i] = item_index_buff[item_index_buff_len - i]; + } + extended_rna_path[rna_path_len + 1 + item_index_buff_len] = ']'; + extended_rna_path[extended_rna_path_len] = '\0'; } else { extended_rna_path = (char *)rna_path; + extended_rna_path_len = rna_path_len; } } eRNAOverrideMatchResult report_flags = 0; - const bool match = RNA_struct_override_matches( - bmain, propptr_a, propptr_b, extended_rna_path, override, flags, &report_flags); + const bool match = RNA_struct_override_matches(bmain, + propptr_a, + propptr_b, + extended_rna_path, + extended_rna_path_len, + override, + flags, + &report_flags); if (r_override_changed && (report_flags & RNA_OVERRIDE_MATCH_RESULT_CREATED) != 0) { *r_override_changed = true; } - RNA_PATH_FREE(); + if (extended_rna_path != extended_rna_path_buffer && extended_rna_path != rna_path) { + MEM_freeN(extended_rna_path); + } # undef RNA_PATH_BUFFSIZE -# undef RNA_PATH_PRINTF -# undef RNA_PATH_FREE return !match; } @@ -1395,6 +1440,7 @@ int rna_property_override_diff_default(Main *bmain, const int mode, IDOverrideLibrary *override, const char *rna_path, + const size_t rna_path_len, const int flags, bool *r_override_changed) { @@ -1684,6 +1730,7 @@ int rna_property_override_diff_default(Main *bmain, no_prop_name, override, rna_path, + rna_path_len, NULL, NULL, -1, @@ -1700,6 +1747,7 @@ int rna_property_override_diff_default(Main *bmain, const bool use_insertion = (RNA_property_override_flag(prop_a) & PROPOVERRIDE_LIBRARY_INSERTION) && do_create; + const bool no_ownership = (RNA_property_flag(prop_a) & PROP_PTR_NO_OWNERSHIP) != 0; const bool no_prop_name = (RNA_property_override_flag(prop_a) & PROPOVERRIDE_NO_PROP_NAME) != 0; bool equals = true; @@ -1733,6 +1781,7 @@ int rna_property_override_diff_default(Main *bmain, is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing( &iter_a.ptr, &iter_b.ptr, + no_ownership, no_prop_name, &is_id, &is_null, @@ -1750,6 +1799,7 @@ int rna_property_override_diff_default(Main *bmain, /* We still need propname from 'a' item... */ rna_property_override_diff_propptr_validate_diffing(&iter_a.ptr, NULL, + no_ownership, no_prop_name, &is_id, &is_null, @@ -1835,7 +1885,6 @@ int rna_property_override_diff_default(Main *bmain, } else if (is_id || is_valid_for_diffing) { if (equals || do_create) { - const bool no_ownership = (RNA_property_flag(prop_a) & PROP_PTR_NO_OWNERSHIP) != 0; const int eq = rna_property_override_diff_propptr(bmain, &iter_a.ptr, &iter_b.ptr, @@ -1844,6 +1893,7 @@ int rna_property_override_diff_default(Main *bmain, no_prop_name, override, rna_path, + rna_path_len, propname_a, propname_b, idx_a, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index edbf4c90524..d141e6f3b19 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1662,7 +1662,7 @@ static void rna_RenderSettings_engine_update(Main *bmain, Scene *UNUSED(unused), PointerRNA *UNUSED(ptr)) { - ED_render_engine_changed(bmain); + ED_render_engine_changed(bmain, true); } static bool rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr)) @@ -3090,6 +3090,13 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop, "Transform Parents", "Transform the parents, leaving the children in place"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT); + RNA_def_property_ui_text(prop, + "Correct Face Attributes", + "Correct data such as UV's and vertex colors when transforming"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "automerge", AUTO_MERGE); RNA_def_property_ui_text( @@ -7150,12 +7157,6 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED); - RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur"); - RNA_def_property_range(prop, 1, 64); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -7163,6 +7164,33 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, + "Background Separation", + "Lower values will reduce background" + " bleeding onto foreground elements"); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL); + RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over"); + RNA_def_property_range(prop, 0, 2048); + RNA_def_property_ui_range(prop, 0, 512, 1, -1); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, + "Motion steps", + "Controls accuracy of motion blur, " + "more steps means longer render time"); + RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_ui_range(prop, 1, 64, 1, -1); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + /* Shadows */ prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, eevee_shadow_size_items); @@ -7469,6 +7497,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Nodes (Compositing) */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); @@ -7699,6 +7728,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "master_collection"); RNA_def_property_struct_type(prop, "Collection"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text( prop, "Collection", diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 381908f7ada..8532bf9afab 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -763,12 +763,6 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - prop = RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP); - RNA_def_property_ui_text( - prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance"); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM); RNA_def_property_ui_text(prop, diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 39ea054456f..7342879e9e6 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -2565,29 +2565,25 @@ static void rna_def_wipe(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text( prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_range(prop, DEG2RADF(-90.0f), DEG2RADF(90.0f)); RNA_def_property_ui_text(prop, "Angle", "Edge angle"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "forward"); RNA_def_property_enum_items(prop, wipe_direction_items); RNA_def_property_ui_text(prop, "Direction", "Wipe direction"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "wipetype"); RNA_def_property_enum_items(prop, wipe_type_items); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE); RNA_def_property_ui_text(prop, "Transition Type", ""); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_glow(StructRNA *srna) @@ -2600,42 +2596,36 @@ static void rna_def_glow(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "fMini"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "fClamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fBoost"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dDist"); RNA_def_property_range(prop, 0.5f, 20.0f); RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dQuality"); RNA_def_property_range(prop, 1, 5); RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0); RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_transform(StructRNA *srna) @@ -2661,57 +2651,49 @@ static void rna_def_transform(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "ScalexIni"); RNA_def_property_ui_text(prop, "Scale X", "Amount to scale the input in the X axis"); RNA_def_property_ui_range(prop, 0, 10, 3, 6); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "ScaleyIni"); RNA_def_property_ui_text(prop, "Scale Y", "Amount to scale the input in the Y axis"); RNA_def_property_ui_range(prop, 0, 10, 3, 6); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0); RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xIni"); RNA_def_property_ui_text(prop, "Translate X", "Amount to move the input on the X axis"); RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yIni"); RNA_def_property_ui_text(prop, "Translate Y", "Amount to move the input on the Y axis"); RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rotIni"); RNA_def_property_ui_text(prop, "Rotation", "Degrees to rotate the input"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "percent"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ RNA_def_property_enum_items(prop, translation_unit_items); RNA_def_property_ui_text(prop, "Translation Unit", "Unit of measure to translate the input"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, interpolation_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ RNA_def_property_ui_text( prop, "Interpolation", "Method to determine how missing pixels are created"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_solid_color(StructRNA *srna) @@ -2738,29 +2720,25 @@ static void rna_def_speed_control(StructRNA *srna) RNA_def_property_ui_text( prop, "Multiply Speed", "Multiply the resulting speed after the speed factor"); RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE); RNA_def_property_ui_text( prop, "Use as Speed", "Interpret the value as speed instead of a frame number"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "use_scale_to_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y); RNA_def_property_ui_text( prop, "Scale to Length", "Scale values from 0.0 to 1.0 to target sequence length"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "frame_interpolation_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_USE_INTERPOLATION); RNA_def_property_ui_text( prop, "Frame interpolation", "Do crossfade blending between current and next frame"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_gaussian_blur(StructRNA *srna) @@ -2771,14 +2749,12 @@ static void rna_def_gaussian_blur(StructRNA *srna) prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Size X", "Size of the blur along X axis"); RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Size Y", "Size of the blur along Y axis"); RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_text(StructRNA *srna) @@ -2807,71 +2783,61 @@ static void rna_def_text(StructRNA *srna) RNA_def_property_ui_text(prop, "Font", "Font of the text. Falls back to the UI font by default"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Sequence_text_font_set", NULL, NULL); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "text_size"); RNA_def_property_ui_text(prop, "Size", "Size of the text"); RNA_def_property_range(prop, 0.0, 2000); RNA_def_property_ui_range(prop, 0.0f, 1000, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "color"); RNA_def_property_ui_text(prop, "Color", "Text color"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "shadow_color"); RNA_def_property_ui_text(prop, "Shadow Color", ""); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", "Location of the text"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "wrap_width", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "wrap_width"); RNA_def_property_ui_text(prop, "Wrap Width", "Word wrap width as factor, zero disables"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); RNA_def_property_enum_items(prop, text_align_x_items); RNA_def_property_ui_text( prop, "Align X", "Align the text along the X axis, relative to the text bounds"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "align_y", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align_y"); RNA_def_property_enum_items(prop, text_align_y_items); RNA_def_property_ui_text( prop, "Align Y", "Align the text along the Y axis, relative to the text bounds"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Text", "Text that will be displayed"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_SHADOW); RNA_def_property_ui_text(prop, "Shadow", "Display shadow behind text"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static void rna_def_color_mix(StructRNA *srna) @@ -2914,15 +2880,13 @@ static void rna_def_color_mix(StructRNA *srna) RNA_def_property_enum_items(prop, blend_color_items); RNA_def_property_ui_text( prop, "Blending Mode", "Method for controlling how the strip combines with other strips"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text( prop, "Blend Factor", "Percentage of how much the strip's colors affect other strips"); - RNA_def_property_update( - prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update"); } static EffectInfo def_effects[] = { diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 6c8f51f97a1..28603132c77 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -114,7 +114,7 @@ static Sequence *rna_Sequences_new_clip(ID *id, Scene *scene = (Scene *)id; Sequence *seq; - seq = alloc_generic_sequence(ed, name, frame_start, channel, SEQ_TYPE_MOVIECLIP, clip->name); + seq = alloc_generic_sequence(ed, name, frame_start, channel, SEQ_TYPE_MOVIECLIP, clip->filepath); seq->clip = clip; seq->len = BKE_movieclip_get_duration(clip); id_us_plus((ID *)clip); @@ -265,7 +265,8 @@ static Sequence *rna_Sequences_new_sound(ID *id, BKE_report(reports, RPT_ERROR, "Sequences.new_sound: unable to open sound file"); return NULL; } - seq = alloc_generic_sequence(ed, name, frame_start, channel, SEQ_TYPE_SOUND_RAM, sound->name); + seq = alloc_generic_sequence( + ed, name, frame_start, channel, SEQ_TYPE_SOUND_RAM, sound->filepath); seq->sound = sound; seq->len = ceil((double)info.length * FPS); @@ -447,6 +448,21 @@ static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports, WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); } +static void rna_Sequence_invalidate_cache_rnafunc(ID *id, Sequence *self, int type) +{ + switch (type) { + case SEQ_CACHE_STORE_RAW: + BKE_sequence_invalidate_cache_raw((Scene *)id, self); + break; + case SEQ_CACHE_STORE_PREPROCESSED: + BKE_sequence_invalidate_cache_preprocessed((Scene *)id, self); + break; + case SEQ_CACHE_STORE_COMPOSITE: + BKE_sequence_invalidate_cache_composite((Scene *)id, self); + break; + } +} + #else void RNA_api_sequence_strip(StructRNA *srna) @@ -454,6 +470,13 @@ void RNA_api_sequence_strip(StructRNA *srna) FunctionRNA *func; PropertyRNA *parm; + static const EnumPropertyItem seq_cahce_type_items[] = { + {SEQ_CACHE_STORE_RAW, "RAW", 0, "Raw", ""}, + {SEQ_CACHE_STORE_PREPROCESSED, "PREPROCESSED", 0, "Preprocessed", ""}, + {SEQ_CACHE_STORE_COMPOSITE, "COMPOSITE", 0, "Composite", ""}, + {0, NULL, 0, NULL, NULL}, + }; + func = RNA_def_function(srna, "update", "rna_Sequence_update_rnafunc"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Update the strip dimensions"); @@ -479,6 +502,13 @@ void RNA_api_sequence_strip(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "other", "Sequence", "Other", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + + func = RNA_def_function(srna, "invalidate_cache", "rna_Sequence_invalidate_cache_rnafunc"); + RNA_def_function_flag(func, FUNC_USE_SELF_ID); + RNA_def_function_ui_description(func, + "Invalidate Cached images for strip and all dependant strips. "); + parm = RNA_def_enum(func, "type", seq_cahce_type_items, 0, "Type", "Cache Type"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); } void RNA_api_sequence_elements(BlenderRNA *brna, PropertyRNA *cprop) diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 71f767fa93b..80f3cab147c 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -336,11 +336,9 @@ static void rna_def_shader_fx_pixel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Size", "Pixel size"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); - prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_float_sdna(prop, NULL, "rgba"); - RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Color", "Color used for lines"); + prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FX_PIXEL_FILTER_NEAREST); + RNA_def_property_ui_text(prop, "Antialiasing", "Antialiase pixels"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); } @@ -424,7 +422,7 @@ static void rna_def_shader_fx_shadow(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Offset", "Offset of the shadow"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); - prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Scale", "Offset of the shadow"); @@ -681,9 +679,9 @@ void RNA_def_shader_fx(BlenderRNA *brna) prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Expanded); + RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_ui_text(prop, "Expanded", "Set effect expanded in the user interface"); + RNA_def_property_ui_text(prop, "Expanded", "Set effect expansion in the user interface"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); /* types */ diff --git a/source/blender/makesrna/intern/rna_simulation.c b/source/blender/makesrna/intern/rna_simulation.c index 789ea299feb..cc9a4bec2e7 100644 --- a/source/blender/makesrna/intern/rna_simulation.c +++ b/source/blender/makesrna/intern/rna_simulation.c @@ -42,6 +42,7 @@ static void rna_def_simulation(BlenderRNA *brna) prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree defining the simulation"); /* common */ diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 28a1c0f3cca..2fb50c2e89e 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -62,7 +62,7 @@ static void rna_def_sound(BlenderRNA *brna) /*rna_def_ipo_common(srna); */ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound data-block"); RNA_def_property_update(prop, 0, "rna_Sound_update"); diff --git a/source/blender/makesrna/intern/rna_sound_api.c b/source/blender/makesrna/intern/rna_sound_api.c index 418205426d2..82da0adf0fe 100644 --- a/source/blender/makesrna/intern/rna_sound_api.c +++ b/source/blender/makesrna/intern/rna_sound_api.c @@ -34,7 +34,8 @@ static void rna_Sound_pack(bSound *sound, Main *bmain, ReportList *reports) { - sound->packedfile = BKE_packedfile_new(reports, sound->name, ID_BLEND_PATH(bmain, &sound->id)); + sound->packedfile = BKE_packedfile_new( + reports, sound->filepath, ID_BLEND_PATH(bmain, &sound->id)); } static void rna_Sound_unpack(bSound *sound, Main *bmain, ReportList *reports, int method) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index e83a49ccb4d..bc8794dac2a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2184,7 +2184,6 @@ static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * ED_node_tree_update(C); } -# ifdef WITH_NEW_SIMULATION_TYPE static PointerRNA rna_SpaceNodeEditor_simulation_get(PointerRNA *ptr) { SpaceNode *snode = (SpaceNode *)ptr->data; @@ -2216,7 +2215,6 @@ static void rna_SpaceNodeEditor_simulation_set(PointerRNA *ptr, } snode->id = &sim->id; } -# endif static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr) { @@ -4363,12 +4361,10 @@ static void rna_def_space_view3d(BlenderRNA *brna) {"Surface", (1 << OB_SURF), {"show_object_viewport_surf", "show_object_select_surf"}}, {"Meta", (1 << OB_MBALL), {"show_object_viewport_meta", "show_object_select_meta"}}, {"Font", (1 << OB_FONT), {"show_object_viewport_font", "show_object_select_font"}}, -# ifdef WITH_NEW_OBJECT_TYPES {"Hair", (1 << OB_HAIR), {"show_object_viewport_hair", "show_object_select_hair"}}, {"Point Cloud", (1 << OB_POINTCLOUD), {"show_object_viewport_pointcloud", "show_object_select_pointcloud"}}, -# endif {"Volume", (1 << OB_VOLUME), {"show_object_viewport_volume", "show_object_select_volume"}}, {"Armature", (1 << OB_ARMATURE), @@ -5580,9 +5576,7 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna) "Grease Pencil", "Show Grease pencil data-blocks"}, {FILTER_ID_GR, "filter_group", ICON_GROUP, "Collections", "Show Collection data-blocks"}, -# ifdef WITH_NEW_OBJECT_TYPES {FILTER_ID_HA, "filter_hair", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"}, -# endif {FILTER_ID_IM, "filter_image", ICON_IMAGE_DATA, "Images", "Show Image data-blocks"}, {FILTER_ID_LA, "filter_light", ICON_LIGHT_DATA, "Lights", "Show Light data-blocks"}, {FILTER_ID_LP, @@ -5626,21 +5620,17 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna) ICON_CURVE_BEZCURVE, "Paint Curves", "Show Paint Curve data-blocks"}, -# ifdef WITH_NEW_OBJECT_TYPES {FILTER_ID_PT, "filter_pointcloud", ICON_POINTCLOUD_DATA, "Point Clouds", "Show/hide Point Cloud data-blocks"}, -# endif {FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"}, -# ifdef WITH_NEW_SIMULATION_TYPE {FILTER_ID_SIM, "filter_simulation", ICON_PHYSICS, "Simulations", "Show Simulation data-blocks"}, /* TODO: Use correct icon. */ -# endif {FILTER_ID_SPK, "filter_speaker", ICON_SPEAKER, "Speakers", "Show Speaker data-blocks"}, {FILTER_ID_SO, "filter_sound", ICON_SOUND, "Sounds", "Show Sound data-blocks"}, {FILTER_ID_TE, "filter_texture", ICON_TEXTURE_DATA, "Textures", "Show Texture data-blocks"}, @@ -6340,7 +6330,6 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_ui_text( prop, "ID From", "Data-block from which the edited data-block is linked"); -# ifdef WITH_NEW_SIMULATION_TYPE prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Simulation"); @@ -6351,7 +6340,6 @@ static void rna_def_space_node(BlenderRNA *brna) NULL, NULL); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, NULL); -# endif prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "treepath", NULL); diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index c8797a8bc74..1351c027004 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -43,8 +43,8 @@ static void rna_Text_filename_get(PointerRNA *ptr, char *value) { Text *text = (Text *)ptr->data; - if (text->name) { - strcpy(value, text->name); + if (text->filepath) { + strcpy(value, text->filepath); } else { value[0] = '\0'; @@ -54,22 +54,22 @@ static void rna_Text_filename_get(PointerRNA *ptr, char *value) static int rna_Text_filename_length(PointerRNA *ptr) { Text *text = (Text *)ptr->data; - return (text->name) ? strlen(text->name) : 0; + return (text->filepath) ? strlen(text->filepath) : 0; } static void rna_Text_filename_set(PointerRNA *ptr, const char *value) { Text *text = (Text *)ptr->data; - if (text->name) { - MEM_freeN(text->name); + if (text->filepath) { + MEM_freeN(text->filepath); } if (value[0]) { - text->name = BLI_strdup(value); + text->filepath = BLI_strdup(value); } else { - text->name = NULL; + text->filepath = NULL; } } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 9184c54ae88..4d5f0f6c2fa 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1634,6 +1634,7 @@ static void rna_def_texture(BlenderRNA *brna) prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index fd65b713d15..8dfa54b95da 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -530,6 +530,22 @@ static void rna_uiTemplateEventFromKeymapItem( uiTemplateEventFromKeymapItem(layout, name, kmi, true); } +static uiLayout *rna_uiLayoutRowWithHeading( + uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate) +{ + /* Get translated heading. */ + heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate); + return uiLayoutRowWithHeading(layout, align, heading); +} + +static uiLayout *rna_uiLayoutColumnWithHeading( + uiLayout *layout, bool align, const char *heading, const char *heading_ctxt, bool translate) +{ + /* Get translated heading. */ + heading = rna_translate_ui_text(heading, heading_ctxt, NULL, NULL, translate); + return uiLayoutColumnWithHeading(layout, align, heading); +} + static int rna_ui_get_rnaptr_icon(bContext *C, PointerRNA *ptr_icon) { return UI_rnaptr_icon_get(C, ptr_icon, RNA_struct_ui_icon(ptr_icon->type), false); @@ -639,6 +655,24 @@ static int rna_ui_get_enum_icon(bContext *C, #else +static void api_ui_item_common_heading(FunctionRNA *func) +{ + RNA_def_string(func, + "heading", + NULL, + UI_MAX_NAME_STR, + "Heading", + "Label to insert into the layout for this sub-layout"); + RNA_def_string(func, + "heading_ctxt", + NULL, + 0, + "", + "Override automatic translation context of the given heading"); + RNA_def_boolean( + func, "translate", true, "", "Translate the given heading, when UI translation is enabled"); +} + static void api_ui_item_common_text(FunctionRNA *func) { PropertyRNA *prop; @@ -708,7 +742,7 @@ void RNA_api_ui_layout(StructRNA *srna) static float node_socket_color_default[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* simple layout specifiers */ - func = RNA_def_function(srna, "row", "uiLayoutRowWithHeading"); + func = RNA_def_function(srna, "row", "rna_uiLayoutRowWithHeading"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); RNA_def_function_ui_description( @@ -716,14 +750,9 @@ void RNA_api_ui_layout(StructRNA *srna) "Sub-layout. Items placed in this sublayout are placed next to each other " "in a row"); RNA_def_boolean(func, "align", false, "", "Align buttons to each other"); - RNA_def_string(func, - "heading", - NULL, - UI_MAX_NAME_STR, - "Heading", - "Label to insert into the layout for this row"); + api_ui_item_common_heading(func); - func = RNA_def_function(srna, "column", "uiLayoutColumnWithHeading"); + func = RNA_def_function(srna, "column", "rna_uiLayoutColumnWithHeading"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); RNA_def_function_ui_description( @@ -731,12 +760,7 @@ void RNA_api_ui_layout(StructRNA *srna) "Sub-layout. Items placed in this sublayout are placed under each other " "in a column"); RNA_def_boolean(func, "align", false, "", "Align buttons to each other"); - RNA_def_string(func, - "heading", - NULL, - UI_MAX_NAME_STR, - "Heading", - "Label to insert into the layout for this column"); + api_ui_item_common_heading(func); func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX); @@ -1213,21 +1237,23 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Generates the UI layout for the modifier stack"); - func = RNA_def_function(srna, "template_greasepencil_modifier", "uiTemplateGpencilModifier"); + func = RNA_def_function(srna, "template_constraints", "uiTemplateConstraints"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Generates the UI layout for grease pencil modifiers"); - parm = RNA_def_pointer(func, "data", "GpencilModifier", "", "Modifier data"); - RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); - parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); - RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Generates the panels for the constraint stack"); + RNA_def_boolean(func, + "use_bone_constraints", + true, + "", + "Add panels for bone constraints instead of object constraints"); + + func = RNA_def_function(srna, "template_grease_pencil_modifiers", "uiTemplateGpencilModifiers"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, + "Generates the panels for the grease pencil modifier stack"); func = RNA_def_function(srna, "template_shaderfx", "uiTemplateShaderFx"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Generates the UI layout for shader effect"); - parm = RNA_def_pointer(func, "data", "ShaderFx", "", "Shader data"); - RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); - parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); - RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Generates the panels for the shader effect stack"); func = RNA_def_function(srna, "template_greasepencil_color", "uiTemplateGpencilColorPreview"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); @@ -1251,12 +1277,10 @@ void RNA_api_ui_layout(StructRNA *srna) "", "Optionally limit the items which can be selected"); - func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); - RNA_def_function_ui_description(func, "Generates the UI layout for constraints"); + func = RNA_def_function(srna, "template_constraint_header", "uiTemplateConstraintHeader"); + RNA_def_function_ui_description(func, "Generates the header for constraint panels"); parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); - parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); - RNA_def_function_return(func, parm); func = RNA_def_function(srna, "template_preview", "uiTemplatePreview"); RNA_def_function_ui_description( diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 49a0121dadb..c31b313d827 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -328,6 +328,8 @@ static void rna_userdef_language_update(Main *UNUSED(bmain), else { U.transopts |= (USER_TR_IFACE | USER_TR_TOOLTIPS | USER_TR_NEWDATANAME); } + + USERDEF_TAG_DIRTY; } static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), @@ -5044,7 +5046,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT); RNA_def_property_ui_text( - prop, "Duplicate Action", "Causes actions to be duplicated with the object"); + prop, "Duplicate Action", "Causes actions to be duplicated with the data-blocks"); prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS); @@ -5061,7 +5063,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Duplicate GPencil", "Causes grease pencil data to be duplicated with the object"); -# ifdef WITH_NEW_OBJECT_TYPES prop = RNA_def_property(srna, "use_duplicate_hair", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_HAIR); RNA_def_property_ui_text( @@ -5071,7 +5072,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_POINTCLOUD); RNA_def_property_ui_text( prop, "Duplicate Point Cloud", "Causes point cloud data to be duplicated with the object"); -# endif prop = RNA_def_property(srna, "use_duplicate_volume", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_VOLUME); @@ -5887,9 +5887,9 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) static const EnumPropertyItem anim_player_presets[] = { {0, "INTERNAL", 0, "Internal", "Built-in animation player"}, - {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"}, + {2, "DJV", 0, "DJV", "Open source frame player: http://djv.sourceforge.net"}, {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"}, - {4, "RV", 0, "rv", "Frame player from Tweak Software"}, + {4, "RV", 0, "RV", "Frame player from Tweak Software"}, {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"}, {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"}, {0, NULL, 0, NULL, NULL}, @@ -6070,6 +6070,20 @@ static void rna_def_userdef_experimental(BlenderRNA *brna) prop, "Undo Legacy", "Use legacy undo (slower than the new default one, but may be more stable in some cases)"); + + prop = RNA_def_property(srna, "use_new_particle_system", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_new_particle_system", 1); + RNA_def_property_ui_text( + prop, "New Particle System", "Enable the new particle system in the ui"); + + prop = RNA_def_property(srna, "use_new_hair_type", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_new_hair_type", 1); + RNA_def_property_ui_text(prop, "New Hair Type", "Enable the new hair type in the ui"); + + prop = RNA_def_property(srna, "use_cycles_debug", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_cycles_debug", 1); + RNA_def_property_ui_text(prop, "Cycles Debug", "Enable Cycles debugging options for developers"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c index 3e96b5816e5..a98a52c2252 100644 --- a/source/blender/makesrna/intern/rna_vfont.c +++ b/source/blender/makesrna/intern/rna_vfont.c @@ -72,7 +72,7 @@ void RNA_def_vfont(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_FILE_FONT); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_string_sdna(prop, NULL, "filepath"); RNA_def_property_editable_func(prop, "rna_VectorFont_filepath_editable"); RNA_def_property_ui_text(prop, "File Path", ""); RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_VectorFont_reload_update"); diff --git a/source/blender/makesrna/intern/rna_vfont_api.c b/source/blender/makesrna/intern/rna_vfont_api.c index 1bf61db4871..80e0511caf9 100644 --- a/source/blender/makesrna/intern/rna_vfont_api.c +++ b/source/blender/makesrna/intern/rna_vfont_api.c @@ -34,7 +34,8 @@ static void rna_VectorFont_pack(VFont *vfont, Main *bmain, ReportList *reports) { - vfont->packedfile = BKE_packedfile_new(reports, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); + vfont->packedfile = BKE_packedfile_new( + reports, vfont->filepath, ID_BLEND_PATH(bmain, &vfont->id)); } static void rna_VectorFont_unpack(VFont *vfont, Main *bmain, ReportList *reports, int method) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 120730b19a5..b103741a994 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -251,7 +251,7 @@ const EnumPropertyItem rna_enum_event_type_items[] = { {EVT_RETKEY, "RET", 0, "Return", "Enter"}, {EVT_SPACEKEY, "SPACE", 0, "Spacebar", "Space"}, {EVT_LINEFEEDKEY, "LINE_FEED", 0, "Line Feed", ""}, - {EVT_BACKSPACEKEY, "BACK_SPACE", 0, "Back Space", "BkSpace"}, + {EVT_BACKSPACEKEY, "BACK_SPACE", 0, "Backspace", "BkSpace"}, {EVT_DELKEY, "DEL", 0, "Delete", "Del"}, {EVT_SEMICOLONKEY, "SEMI_COLON", 0, ";", ""}, {EVT_PERIODKEY, "PERIOD", 0, ".", ""}, diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 07db2755523..1ca0eb74cf5 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -236,6 +236,7 @@ void RNA_def_world(BlenderRNA *brna) /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); |