Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_access.c
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_idtype.h" | #include "BKE_idtype.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_build.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_message.h" | #include "WM_message.h" | ||||
| ▲ Show 20 Lines • Show All 2,221 Lines • ▼ Show 20 Lines | if (!is_rna || (prop->flag & PROP_IDPROPERTY)) { | ||||
| * for data storage. Further, the root ID isn't available with nested data-structures. | * for data storage. Further, the root ID isn't available with nested data-structures. | ||||
| * | * | ||||
| * So editing custom properties only causes updates in the UI, | * So editing custom properties only causes updates in the UI, | ||||
| * keep this exception because it happens to be useful for driving settings. | * keep this exception because it happens to be useful for driving settings. | ||||
| * Python developers on the other hand will need to manually 'update_tag', see: T74000. */ | * Python developers on the other hand will need to manually 'update_tag', see: T74000. */ | ||||
| DEG_id_tag_update(ptr->owner_id, | DEG_id_tag_update(ptr->owner_id, | ||||
| ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_PARAMETERS); | ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_PARAMETERS); | ||||
| /* When updating an ID pointer property, tag depsgraph for update. */ | |||||
| if (prop->type == PROP_POINTER && RNA_struct_is_ID(RNA_property_pointer_type(ptr, prop))) { | |||||
| DEG_relations_tag_update(bmain); | |||||
| } | |||||
| WM_main_add_notifier(NC_WINDOW, NULL); | WM_main_add_notifier(NC_WINDOW, NULL); | ||||
| /* Not nice as well, but the only way to make sure material preview | /* Not nice as well, but the only way to make sure material preview | ||||
| * is updated with custom nodes. | * is updated with custom nodes. | ||||
| */ | */ | ||||
| if ((prop->flag & PROP_IDPROPERTY) != 0 && (ptr->owner_id != NULL) && | if ((prop->flag & PROP_IDPROPERTY) != 0 && (ptr->owner_id != NULL) && | ||||
| (GS(ptr->owner_id->name) == ID_NT)) { | (GS(ptr->owner_id->name) == ID_NT)) { | ||||
| WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL); | WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,373 Lines • ▼ Show 20 Lines | PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop) | ||||
| return PointerRNA_NULL; | return PointerRNA_NULL; | ||||
| } | } | ||||
| void RNA_property_pointer_set(PointerRNA *ptr, | void RNA_property_pointer_set(PointerRNA *ptr, | ||||
| PropertyRNA *prop, | PropertyRNA *prop, | ||||
| PointerRNA ptr_value, | PointerRNA ptr_value, | ||||
| ReportList *reports) | ReportList *reports) | ||||
| { | { | ||||
| PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; | /* Detect IDProperty and retrieve the actual PropertyRNA pointer before cast. */ | ||||
| IDProperty *idprop = rna_idproperty_check(&prop, ptr); | IDProperty *idprop = rna_idproperty_check(&prop, ptr); | ||||
| PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; | |||||
| BLI_assert(RNA_property_type(prop) == PROP_POINTER); | BLI_assert(RNA_property_type(prop) == PROP_POINTER); | ||||
| /* Check types. */ | /* Check types. */ | ||||
| if (pprop->set != NULL) { | if (pprop->set != NULL) { | ||||
| /* Assigning to a real RNA property. */ | /* Assigning to a real RNA property. */ | ||||
| if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, pprop->type)) { | if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, pprop->type)) { | ||||
| BKE_reportf(reports, | BKE_reportf(reports, | ||||
| RPT_ERROR, | RPT_ERROR, | ||||
| ▲ Show 20 Lines • Show All 4,512 Lines • Show Last 20 Lines | |||||