Blender
V3.3
|
#include <string.h>
#include <CLG_log.h>
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_anim_types.h"
#include "DNA_camera_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_key_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_armature.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lib_override.h"
#include "BKE_main.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_path.h"
#include "RNA_prototypes.h"
#include "rna_access_internal.h"
#include "rna_internal.h"
Go to the source code of this file.
Macros | |
#define | RNA_PATH_BUFFSIZE 8192 |
Variables | |
static CLG_LogRef | LOG = {"rna.access_compare_override"} |
#define RNA_PATH_BUFFSIZE 8192 |
|
static |
Definition at line 955 of file rna_access_compare_override.c.
References CLOG_INFO, LOG, ID::name, NULL, PointerRNA::owner_id, PROP_COLLECTION, IDOverrideLibraryProperty::rna_path, RNA_POINTER_INVALIDATE, RNA_property_collection_lookup_int(), RNA_property_collection_lookup_string(), RNA_property_type(), IDOverrideLibraryPropertyOperation::subitem_local_index, IDOverrideLibraryPropertyOperation::subitem_local_name, IDOverrideLibraryPropertyOperation::subitem_reference_index, and IDOverrideLibraryPropertyOperation::subitem_reference_name.
Referenced by rna_property_override_apply_ex(), and RNA_struct_override_apply().
bool RNA_property_comparable | ( | PointerRNA * | UNUSEDptr, |
PropertyRNA * | prop | ||
) |
Definition at line 194 of file rna_access_compare_override.c.
References PropertyRNA::flag_override, PROPOVERRIDE_NO_COMPARISON, and rna_ensure_property().
bool RNA_property_copy | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PointerRNA * | fromptr, | ||
PropertyRNA * | prop, | ||
int | index | ||
) |
Definition at line 213 of file rna_access_compare_override.c.
References BLI_assert, ELEM, IDOVERRIDE_LIBRARY_OP_REPLACE, IDP_AddToGroup(), IDP_CopyProperty(), PropertyRNA::magic, NULL, IDOverrideLibraryPropertyOperation::operation, ptr, rna_ensure_property_realdata(), rna_idproperty_touch(), RNA_MAGIC, RNA_property_editable(), RNA_property_is_set(), rna_property_override_operation_apply(), and RNA_struct_idprops().
Referenced by copy_to_selected_button(), and override_remove_button_exec().
bool RNA_property_equals | ( | Main * | bmain, |
PointerRNA * | ptr_a, | ||
PointerRNA * | ptr_b, | ||
PropertyRNA * | prop, | ||
eRNACompareMode | mode | ||
) |
Definition at line 264 of file rna_access_compare_override.c.
References BLI_assert, ELEM, NULL, RNA_EQ_STRICT, RNA_EQ_UNSET_MATCH_ANY, RNA_EQ_UNSET_MATCH_NONE, rna_property_override_diff(), and rna_property_rna_or_id_get().
Referenced by RNA_struct_equals(), and rna_struct_update_when_changed().
bool RNA_property_overridable_get | ( | PointerRNA * | ptr, |
PropertyRNA * | prop | ||
) |
Definition at line 118 of file rna_access_compare_override.c.
References CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL, CONSTRAINT_OVERRIDE_LIBRARY_LOCAL, PointerRNA::data, eGpencilModifierFlag_OverrideLibrary_Local, eModifierFlag_OverrideLibrary_Local, NlaTrack::flag, CameraBGImage::flag, bConstraint::flag, GpencilModifierData::flag, IDProperty::flag, PropertyRNA::flag_override, IDP_FLAG_OVERRIDABLE_LIBRARY, PropertyRNA::magic, mod(), NLATRACK_OVERRIDELIBRARY_LOCAL, PROPOVERRIDE_NO_COMPARISON, PROPOVERRIDE_OVERRIDABLE_LIBRARY, ptr, RNA_MAGIC, RNA_struct_is_a(), and PointerRNA::type.
Referenced by property_collection_liboverride_editable(), pyrna_struct_is_property_overridable_library(), rna_property_editable_do(), rna_property_override_diff(), RNA_property_override_library_status(), and RNA_struct_override_matches().
bool RNA_property_overridable_library_set | ( | PointerRNA * | UNUSEDptr, |
PropertyRNA * | prop, | ||
const bool | is_overridable | ||
) |
Definition at line 166 of file rna_access_compare_override.c.
References IDProperty::flag, IDP_FLAG_OVERRIDABLE_LIBRARY, PropertyRNA::magic, and RNA_MAGIC.
Referenced by pyrna_struct_property_overridable_library_set().
bool RNA_property_overridden | ( | PointerRNA * | ptr, |
PropertyRNA * | prop | ||
) |
Definition at line 182 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_find(), id, ID_IS_OVERRIDE_LIBRARY, NULL, ID::override_library, PointerRNA::owner_id, ptr, and RNA_path_from_ID_to_property().
|
static |
Definition at line 1128 of file rna_access_compare_override.c.
References CLOG_INFO, ELEM, IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE, LISTBASE_FOREACH, LOG, ID::name, IDOverrideLibraryProperty::operations, PointerRNA::owner_id, IDOverrideLibraryProperty::rna_path, rna_porperty_override_collection_subitem_lookup(), IDOverrideLibraryProperty::rna_prop_type, rna_property_override_operation_apply(), and RNA_property_type().
Referenced by RNA_struct_override_apply().
|
static |
Definition at line 1080 of file rna_access_compare_override.c.
References BLI_assert, CLOG_INFO, ELEM, IDOverrideLibrary::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY, ID::lib, LIB_TAG_LIB_OVERRIDE_NEED_RESYNC, LIBRARY_TAG_RESYNC_REQUIRED, LOG, ID::name, NULL, ID::override_library, IDOverrideLibrary::reference, rna_property_override_property_real_id_owner(), ID::tag, and Library::tag.
Referenced by RNA_struct_override_apply().
|
static |
Generic RNA property diff function.
Definition at line 325 of file rna_access_compare_override.c.
References PropertyRNAOrID::array_len, BLI_assert, BLI_assert_unreachable, CLOG_ERROR, KDL::diff(), ELEM, PropertyRNA::flag_override, PropertyRNAOrID::identifier, PropertyRNAOrID::idprop, PropertyRNAOrID::is_array, PropertyRNAOrID::is_idprop, PropertyRNAOrID::is_set, LOG, NULL, PropertyRNA::override_diff, PROP_COLLECTION, PROP_POINTER, PROPOVERRIDE_NO_COMPARISON, PropertyRNAOrID::ptr, PropertyRNAOrID::rawprop, RNA_EQ_UNSET_MATCH_ANY, RNA_EQ_UNSET_MATCH_NONE, RNA_OVERRIDE_COMPARE_CREATE, RNA_OVERRIDE_MATCH_RESULT_CREATED, RNA_property_editable_flag(), RNA_property_overridable_get(), rna_property_override_diff_default(), RNA_property_type(), and PropertyRNAOrID::rnaprop.
Referenced by RNA_property_equals(), and RNA_struct_override_matches().
int RNA_property_override_flag | ( | PropertyRNA * | prop | ) |
Definition at line 113 of file rna_access_compare_override.c.
References PropertyRNA::flag_override, and rna_ensure_property().
Referenced by RNA_struct_override_matches().
eRNAOverrideStatus RNA_property_override_library_status | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
const int | index | ||
) |
Definition at line 1440 of file rna_access_compare_override.c.
References IDOverrideLibraryPropertyOperation::flag, ID_IS_OVERRIDE_LIBRARY, IDOVERRIDE_LIBRARY_FLAG_LOCKED, IDOVERRIDE_LIBRARY_FLAG_MANDATORY, NULL, PointerRNA::owner_id, ptr, RNA_OVERRIDE_STATUS_LOCKED, RNA_OVERRIDE_STATUS_MANDATORY, RNA_OVERRIDE_STATUS_OVERRIDABLE, RNA_OVERRIDE_STATUS_OVERRIDDEN, RNA_property_editable_flag(), RNA_property_overridable_get(), and RNA_property_override_property_operation_find().
Referenced by override_remove_button_poll(), override_type_set_button_poll(), ui_but_override_flag(), and ui_popup_context_menu_for_button().
|
static |
Definition at line 533 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_operation_operands_validate(), BLI_assert_unreachable, CLOG_ERROR, ELEM, IDOVERRIDE_LIBRARY_OP_NOOP, LOG, PropertyRNA::magic, NULL, IDOverrideLibraryPropertyOperation::operation, PropertyRNA::override_apply, RNA_MAGIC, RNA_property_array_length(), and rna_property_override_apply_default().
Referenced by RNA_property_copy(), rna_property_override_apply_ex(), and RNA_struct_override_matches().
|
static |
Definition at line 441 of file rna_access_compare_override.c.
References BLI_assert_unreachable, CLOG_ERROR, ELEM, IDOVERRIDE_LIBRARY_OP_ADD, IDOVERRIDE_LIBRARY_OP_MULTIPLY, IDOVERRIDE_LIBRARY_OP_SUBTRACT, LISTBASE_FOREACH, LOG, PropertyRNA::magic, NULL, IDOverrideLibraryProperty::operations, PropertyRNA::override_store, RNA_MAGIC, IDOverrideLibraryProperty::rna_path, RNA_property_array_length(), and rna_property_override_store_default().
Referenced by RNA_struct_override_store().
IDOverrideLibraryProperty* RNA_property_override_property_find | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
ID ** | r_owner_id | ||
) |
Definition at line 1359 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_find(), MEM_freeN, NULL, ptr, and rna_property_override_property_real_id_owner().
Referenced by override_remove_button_exec(), and RNA_property_override_property_operation_find().
IDOverrideLibraryProperty* RNA_property_override_property_get | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
bool * | r_created | ||
) |
Definition at line 1376 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_get(), id, MEM_freeN, NULL, ID::override_library, ptr, and rna_property_override_property_real_id_owner().
Referenced by RNA_property_override_property_operation_get().
IDOverrideLibraryPropertyOperation* RNA_property_override_property_operation_find | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
const int | index, | ||
const bool | strict, | ||
bool * | r_strict | ||
) |
Definition at line 1397 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_operation_find(), NULL, ptr, and RNA_property_override_property_find().
Referenced by RNA_property_override_library_status().
IDOverrideLibraryPropertyOperation* RNA_property_override_property_operation_get | ( | Main * | bmain, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
const short | operation, | ||
const int | index, | ||
const bool | strict, | ||
bool * | r_strict, | ||
bool * | r_created | ||
) |
Definition at line 1416 of file rna_access_compare_override.c.
References BKE_lib_override_library_property_operation_get(), NULL, ptr, and RNA_property_override_property_get().
Referenced by override_type_set_button_exec().
|
static |
Find the actual ID owner of the given ptr PointerRNA, in override sense, and generate the full rna path from it to given prop PropertyRNA if rna_path is given.
Definition at line 57 of file rna_access_compare_override.c.
References BLI_assert_unreachable, BLI_sprintfN(), ID::flag, GS, id, ID_GR, ID_KE, ID_NT, LIB_EMBEDDED_DATA, LIB_EMBEDDED_DATA_LIB_OVERRIDE, MEM_freeN, ID::name, NULL, PointerRNA::owner_id, ptr, RNA_find_real_ID_and_path(), and RNA_path_from_ID_to_property().
Referenced by rna_property_override_check_resync(), RNA_property_override_property_find(), RNA_property_override_property_get(), and RNA_struct_override_apply().
bool RNA_struct_equals | ( | Main * | bmain, |
PointerRNA * | ptr_a, | ||
PointerRNA * | ptr_b, | ||
eRNACompareMode | mode | ||
) |
Definition at line 277 of file rna_access_compare_override.c.
References PointerRNA::data, NULL, CollectionPropertyIterator::ptr, RNA_property_collection_begin(), RNA_property_collection_end(), RNA_property_collection_next(), RNA_property_equals(), RNA_struct_iterator_property(), PointerRNA::type, and CollectionPropertyIterator::valid.
Referenced by wm_keymap_item_equals_result().
void RNA_struct_override_apply | ( | struct Main * | bmain, |
struct PointerRNA * | ptr_dst, | ||
struct PointerRNA * | ptr_src, | ||
struct PointerRNA * | ptr_storage, | ||
struct IDOverrideLibrary * | override, | ||
eRNAOverrideApplyFlag | flag | ||
) |
Apply given override operations on ptr_dst, using ptr_src (and ptr_storage for differential ops) as source.
Definition at line 1196 of file rna_access_compare_override.c.
References BKE_idtype_get_info_from_id(), BLI_assert, CLOG_INFO, PointerRNA::data, IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE, IDTypeInfo::lib_override_apply_post, LIB_TAG_LIB_OVERRIDE_NEED_RESYNC, LISTBASE_FOREACH, LOG, ID::name, NULL, override, PointerRNA::owner_id, PROP_COLLECTION, PROP_POINTER, RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS, RNA_path_resolve_property(), RNA_path_resolve_property_and_item_pointer(), rna_porperty_override_collection_subitem_lookup(), rna_property_override_apply_ex(), rna_property_override_check_resync(), rna_property_override_property_real_id_owner(), RNA_property_pointer_get(), RNA_property_pointer_type(), RNA_struct_is_a(), RNA_struct_is_ID(), ID::tag, TIMEIT_END_AVERAGED, TIMEIT_START_AVERAGED, and PointerRNA::type.
Referenced by BKE_lib_override_library_update(), and lib_override_library_resync().
bool RNA_struct_override_matches | ( | struct Main * | bmain, |
struct PointerRNA * | ptr_local, | ||
struct PointerRNA * | ptr_reference, | ||
const char * | root_path, | ||
size_t | root_path_len, | ||
struct IDOverrideLibrary * | override, | ||
eRNAOverrideMatch | flags, | ||
eRNAOverrideMatchResult * | r_report_flags | ||
) |
Check whether reference and local overridden data match (are the same), with respect to given restrictive sets of properties. If requested, will generate needed new property overrides, and/or restore values from reference.
r_report_flags | If given, will be set with flags matching actions taken by the function on ptr_local. |
Definition at line 626 of file rna_access_compare_override.c.
References BKE_lib_override_library_operations_tag(), BKE_lib_override_library_property_find(), BKE_pose_ensure(), BLI_assert, BLI_assert_msg, CLOG_INFO, Object::data, PointerRNA::data, KDL::diff(), ELEM, ListBase::first, float(), GS, ID_OB, PropertyRNAOrID::identifier, IDOVERRIDE_LIBRARY_OP_NOOP, IDOVERRIDE_LIBRARY_OP_REPLACE, IDOVERRIDE_LIBRARY_TAG_UNUSED, PropertyRNAOrID::idprop, if(), PropertyRNAOrID::is_idprop, LOG, MEM_freeN, MEM_mallocN, ID::name, NULL, OB_ARMATURE, IDOverrideLibraryPropertyOperation::operation, IDOverrideLibraryProperty::operations, ID::override_library, PointerRNA::owner_id, PIL_check_seconds_timer(), PROPOVERRIDE_IGNORE, PropertyRNAOrID::ptr, CollectionPropertyIterator::ptr, IDOverrideLibrary::reference, RNA_EQ_STRICT, RNA_OVERRIDE_COMPARE_CREATE, RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE, RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN, RNA_OVERRIDE_COMPARE_RESTORE, RNA_OVERRIDE_MATCH_RESULT_CREATED, RNA_OVERRIDE_MATCH_RESULT_RESTORED, RNA_PATH_BUFFSIZE, RNA_path_from_ID_to_property(), RNA_property_animated(), RNA_property_collection_begin(), RNA_property_collection_end(), RNA_property_collection_next(), RNA_property_editable(), RNA_property_overridable_get(), rna_property_override_diff(), RNA_property_override_flag(), rna_property_override_operation_apply(), rna_property_rna_or_id_get(), RNA_struct_iterator_property(), PropertyRNAOrID::rnaprop, Object::type, PointerRNA::type, and CollectionPropertyIterator::valid.
Referenced by BKE_lib_override_library_operations_create(), BKE_lib_override_library_status_check_local(), and BKE_lib_override_library_status_check_reference().
bool RNA_struct_override_store | ( | struct Main * | bmain, |
struct PointerRNA * | ptr_local, | ||
struct PointerRNA * | ptr_reference, | ||
PointerRNA * | ptr_storage, | ||
struct IDOverrideLibrary * | override | ||
) |
Store needed second operands into storage data-block for differential override operations.
Definition at line 909 of file rna_access_compare_override.c.
References LISTBASE_FOREACH, NULL, override, PointerRNA::owner_id, RNA_path_resolve_property(), rna_property_override_operation_store(), TIMEIT_END_AVERAGED, and TIMEIT_START_AVERAGED.
Referenced by BKE_lib_override_library_operations_store_start().
|
static |
Definition at line 47 of file rna_access_compare_override.c.
Referenced by rna_porperty_override_collection_subitem_lookup(), rna_property_override_apply_ex(), rna_property_override_check_resync(), rna_property_override_diff(), rna_property_override_operation_apply(), rna_property_override_operation_store(), RNA_struct_override_apply(), and RNA_struct_override_matches().