Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index b92123f445b..9bb78cb483d 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -76,7 +76,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""},
{ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
- {ID_HA, "HAIR", ICON_HAIR_DATA, "Hair", ""},
+ {ID_CV, "CURVES", ICON_CURVES_DATA, "Hair Curves", ""},
{ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""},
{ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""},
{ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""},
@@ -151,7 +151,7 @@ const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = {
ICON_OUTLINER_COLLECTION,
"Collections",
"Show Collection data-blocks"},
- {FILTER_ID_HA, "filter_hair", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"},
+ {FILTER_ID_CV, "filter_hair", ICON_CURVES_DATA, "Hairs", "Show/hide Hair data-blocks"},
{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,
@@ -385,9 +385,9 @@ short RNA_type_to_ID_code(const StructRNA *type)
if (base_type == &RNA_FreestyleLineStyle) {
return ID_LS;
}
-# ifdef WITH_HAIR_NODES
- if (base_type == &RNA_Hair) {
- return ID_HA;
+# ifdef WITH_NEW_CURVES_TYPE
+ if (base_type == &RNA_Curves) {
+ return ID_CV;
}
# endif
if (base_type == &RNA_Lattice) {
@@ -423,11 +423,9 @@ short RNA_type_to_ID_code(const StructRNA *type)
if (base_type == &RNA_PaintCurve) {
return ID_PC;
}
-# ifdef WITH_POINT_CLOUD
if (base_type == &RNA_PointCloud) {
return ID_PT;
}
-# endif
if (base_type == &RNA_LightProbe) {
return ID_LP;
}
@@ -494,9 +492,9 @@ StructRNA *ID_code_to_RNA_type(short idcode)
return &RNA_GreasePencil;
case ID_GR:
return &RNA_Collection;
- case ID_HA:
-# ifdef WITH_HAIR_NODES
- return &RNA_Hair;
+ case ID_CV:
+# ifdef WITH_NEW_CURVES_TYPE
+ return &RNA_Curves;
# else
return &RNA_ID;
# endif
@@ -533,11 +531,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_PC:
return &RNA_PaintCurve;
case ID_PT:
-# ifdef WITH_POINT_CLOUD
return &RNA_PointCloud;
-# else
- return &RNA_ID;
-# endif
case ID_LP:
return &RNA_LightProbe;
case ID_SCE:
@@ -710,6 +704,7 @@ static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages)
}
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
return local_id;
}
@@ -724,9 +719,11 @@ static ID *rna_ID_override_hierarchy_create(
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
ID *id_root_override = NULL;
- BKE_lib_override_library_create(bmain, scene, view_layer, id, id_reference, &id_root_override);
+ BKE_lib_override_library_create(
+ bmain, scene, view_layer, NULL, id, id_reference, &id_root_override);
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
return id_root_override;
}
@@ -747,6 +744,8 @@ static void rna_ID_override_template_create(ID *id, ReportList *reports)
return;
}
BKE_lib_override_library_template_create(id);
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static void rna_ID_override_library_operations_update(ID *id,
@@ -760,6 +759,8 @@ static void rna_ID_override_library_operations_update(ID *id,
}
BKE_lib_override_library_operations_create(bmain, id);
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static void rna_ID_override_library_reset(ID *id,
@@ -779,6 +780,8 @@ static void rna_ID_override_library_reset(ID *id,
else {
BKE_lib_override_library_id_reset(bmain, id);
}
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static void rna_ID_override_library_destroy(ID *id,
@@ -799,6 +802,8 @@ static void rna_ID_override_library_destroy(ID *id,
BKE_libblock_remap(bmain, id, id->override_library->reference, ID_REMAP_SKIP_INDIRECT_USAGE);
BKE_id_delete(bmain, id);
}
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static IDOverrideLibraryProperty *rna_ID_override_library_properties_add(
@@ -812,6 +817,7 @@ static IDOverrideLibraryProperty *rna_ID_override_library_properties_add(
BKE_report(reports, RPT_DEBUG, "No new override property created, property already exists");
}
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
return result;
}
@@ -825,6 +831,8 @@ static void rna_ID_override_library_properties_remove(IDOverrideLibrary *overrid
}
BKE_lib_override_library_property_delete(override_library, override_property);
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static IDOverrideLibraryPropertyOperation *rna_ID_override_library_property_operations_add(
@@ -851,6 +859,8 @@ static IDOverrideLibraryPropertyOperation *rna_ID_override_library_property_oper
if (!created) {
BKE_report(reports, RPT_DEBUG, "No new override operation created, operation already exists");
}
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
return result;
}
@@ -865,6 +875,8 @@ static void rna_ID_override_library_property_operations_remove(
}
BKE_lib_override_library_property_operation_delete(override_property, override_operation);
+
+ WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
}
static void rna_ID_update_tag(ID *id, Main *bmain, ReportList *reports, int flag)
@@ -937,9 +949,9 @@ static void rna_ID_user_remap(ID *id, Main *bmain, ID *new_id)
}
}
-static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool clear_proxy)
+static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool UNUSED(clear_proxy))
{
- BKE_lib_id_make_local(bmain, self, clear_proxy ? 0 : LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING);
+ BKE_lib_id_make_local(bmain, self, 0);
ID *ret_id = self->newid ? self->newid : self;
BKE_id_newptr_and_tag_clear(self);
@@ -1753,6 +1765,7 @@ static void rna_def_ID_override_library_property(BlenderRNA *brna)
"IDOverrideLibraryPropertyOperation",
"Operations",
"List of overriding operations for a property");
+ RNA_def_property_update(prop, NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
rna_def_ID_override_library_property_operations(brna, prop);
rna_def_ID_override_library_property_operation(brna);
@@ -1805,8 +1818,9 @@ static void rna_def_ID_override_library(BlenderRNA *brna)
RNA_def_struct_ui_text(
srna, "ID Library Override", "Struct gathering all data needed by overridden linked IDs");
- RNA_def_pointer(
+ prop = RNA_def_pointer(
srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
+ RNA_def_property_update(prop, NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
prop = RNA_def_boolean(srna,
"is_in_hierarchy",
@@ -1814,6 +1828,7 @@ static void rna_def_ID_override_library(BlenderRNA *brna)
"Is In Hierarchy",
"Whether this library override is defined as part of a library "
"hierarchy, or as a single, isolated and autonomous override");
+ RNA_def_property_update(prop, NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY);
prop = RNA_def_collection(srna,
@@ -1821,6 +1836,7 @@ static void rna_def_ID_override_library(BlenderRNA *brna)
"IDOverrideLibraryProperty",
"Properties",
"List of overridden properties");
+ RNA_def_property_update(prop, NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);
rna_def_ID_override_library_properties(brna, prop);
/* Update function. */
@@ -2073,13 +2089,7 @@ static void rna_def_ID(BlenderRNA *brna)
"Make this datablock local, return local one "
"(may be a copy of the original, in case it is also indirectly used)");
RNA_def_function_flag(func, FUNC_USE_MAIN);
- parm = RNA_def_boolean(
- func,
- "clear_proxy",
- true,
- "",
- "Whether to clear proxies (the default behavior, "
- "note that if object has to be duplicated to be made local, proxies are always cleared)");
+ parm = RNA_def_boolean(func, "clear_proxy", true, "", "Deprecated, has no effect");
parm = RNA_def_pointer(func, "id", "ID", "", "This ID, or the new ID if it was copied");
RNA_def_function_return(func, parm);