|
Blender V4.3
|
#include <BKE_lib_remap.hh>
Public Member Functions | |
| void | clear () |
| bool | is_empty () const |
| bool | contains_mappings_for_any (IDTypeFilter filter) const |
| void | add (ID *old_id, ID *new_id) |
| void | add_overwrite (ID *old_id, ID *new_id) |
| IDRemapperApplyResult | get_mapping_result (ID *id, IDRemapperApplyOptions options, const ID *id_self) const |
| IDRemapperApplyResult | apply (ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const |
| void | never_null_users_add (ID *id) |
| const Set< ID * > & | never_null_users () const |
| void | iter (FunctionRef< void(ID *old_id, ID *new_id)> func) const |
| void | print () const |
Static Public Member Functions | |
| static const StringRefNull | result_to_string (const IDRemapperApplyResult result) |
Public Attributes | |
| bool | allow_idtype_mismatch = false |
Definition at line 268 of file BKE_lib_remap.hh.
Add a new remapping. Does not replace an existing mapping for old_id, if any.
Definition at line 15 of file lib_id_remapper.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), allow_idtype_mismatch, BKE_idtype_idcode_to_idfilter(), BLI_assert, GS, and ID::name.
Referenced by blender::bke::asset_main_create_from_ID(), BKE_libblock_relink_ex(), BKE_libblock_remap_locked(), BKE_main_merge(), ED_spacedata_id_remap_single(), foreach_libblock_remap_callback(), id_delete(), id_embedded_swap(), id_free(), id_relink_to_newid_looper(), id_swap(), blender::bke::greasepencil::convert::legacy_main(), lib_override_library_remap(), lib_override_remapper_overrides_add(), main_merge_add_id_to_move(), reuse_bmain_data_remapper_ensure(), reuse_bmain_move_id(), reuse_editable_asset_bmain_data_dependencies_process_cb(), reuse_editable_asset_bmain_data_for_blendfile(), swap_old_bmain_data_for_blendfile(), swap_old_bmain_data_for_blendfile_dependencies_process_cb(), swap_wm_data_for_blendfile(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
Add a new remapping, replacing a potential already existing mapping of old_id.
Definition at line 26 of file lib_id_remapper.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), allow_idtype_mismatch, BKE_idtype_idcode_to_idfilter(), BLI_assert, GS, and ID::name.
Referenced by swap_old_bmain_data_for_blendfile().
| IDRemapperApplyResult blender::bke::id::IDRemapper::apply | ( | ID ** | r_id_ptr, |
| IDRemapperApplyOptions | options, | ||
| ID * | id_self = nullptr ) const |
Apply a remapping.
Update the id pointer stored in the given r_id_ptr if a remapping rule exists.
| id_self | Only for ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF. When remapping to id_self it will then be remapped to nullptr instead. |
Definition at line 55 of file lib_id_remapper.cc.
References BLI_assert, BLI_assert_msg, ID_REMAP_APPLY_ENSURE_REAL, ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF, ID_REMAP_APPLY_UPDATE_REFCOUNT, ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE, ID_REMAP_RESULT_SOURCE_REMAPPED, ID_REMAP_RESULT_SOURCE_UNASSIGNED, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, id_us_ensure_real(), id_us_min(), id_us_plus_no_lib(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and options.
Referenced by action_id_remap(), BKE_viewer_path_id_remap(), buttons_id_remap(), clip_id_remap(), foreach_libblock_remap_callback_apply(), graph_id_remap(), image_id_remap(), nla_id_remap(), blender::ed::outliner::outliner_id_remap(), blender::asset_system::AssetLibrary::remap_ids_and_remove_invalid(), reuse_bmain_data_dependencies_new_library_get(), sequencer_id_remap(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), text_id_remap(), view3d_id_remap_v3d(), and view3d_id_remap_v3d_ob_centers().
|
inline |
Definition at line 286 of file BKE_lib_remap.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), and blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear().
Referenced by foreach_libblock_remap_callback(), id_delete(), and blender::bke::id::tests::TEST().
|
inline |
Definition at line 298 of file BKE_lib_remap.hh.
Referenced by clip_id_remap(), image_id_remap(), libblock_remap_data(), libblock_remap_data_preprocess_ob(), and view3d_id_remap().
| IDRemapperApplyResult blender::bke::id::IDRemapper::get_mapping_result | ( | ID * | id, |
| IDRemapperApplyOptions | options, | ||
| const ID * | id_self ) const |
Determine the mapping result, without applying the mapping.
Definition at line 37 of file lib_id_remapper.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF, ID_REMAP_RESULT_SOURCE_REMAPPED, ID_REMAP_RESULT_SOURCE_UNASSIGNED, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), and options.
Referenced by foreach_libblock_remap_callback(), libblock_remap_data_preprocess_ob(), and reuse_bmain_data_remapper_is_id_remapped().
|
inline |
Definition at line 293 of file BKE_lib_remap.hh.
Referenced by BKE_libblock_relink_multiple(), BKE_libblock_remap_multiple_locked(), and BKE_libblock_remap_multiple_raw().
|
inline |
Iterate over all remapping pairs in the remapper, and call the callback function on them.
Definition at line 336 of file BKE_lib_remap.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items().
Referenced by BKE_libblock_relink_multiple(), BKE_libblock_remap_multiple_locked(), libblock_remap_data(), blender::ed::space_node::node_id_remap(), print(), and WM_main_remap_editor_id_reference().
Definition at line 330 of file BKE_lib_remap.hh.
Referenced by id_delete(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
|
inline |
Definition at line 325 of file BKE_lib_remap.hh.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add().
Referenced by foreach_libblock_remap_callback().
| void blender::bke::id::IDRemapper::print | ( | ) | const |
Print out the rules inside the given id_remapper. Can be used for debugging purposes.
Definition at line 112 of file lib_id_remapper.cc.
|
static |
Return a readable string for the given result. Can be used for debugging purposes.
Definition at line 96 of file lib_id_remapper.cc.
References BLI_assert_unreachable, ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE, ID_REMAP_RESULT_SOURCE_REMAPPED, ID_REMAP_RESULT_SOURCE_UNASSIGNED, and ID_REMAP_RESULT_SOURCE_UNAVAILABLE.
Referenced by foreach_libblock_remap_callback().
| bool blender::bke::id::IDRemapper::allow_idtype_mismatch = false |
In almost all cases, the original pointer and its new replacement should be of the same type. however, there are some rare exceptions, e.g. when converting from one ID type to another.
Definition at line 283 of file BKE_lib_remap.hh.
Referenced by add(), add_overwrite(), and blender::bke::greasepencil::convert::legacy_main().