|
Blender V5.0
|
#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 StringRefNull | result_to_string (const IDRemapperApplyResult result) |
Public Attributes | |
| bool | allow_idtype_mismatch = false |
Definition at line 270 of file BKE_lib_remap.hh.
Add a new remapping. Does not replace an existing mapping for old_id, if any.
Definition at line 13 of file lib_id_remapper.cc.
References allow_idtype_mismatch, BKE_idtype_idcode_to_idfilter(), BLI_assert, GS, and ID::name.
Referenced by BKE_libblock_relink_ex(), BKE_libblock_remap_locked(), BKE_main_merge(), blendfile_library_relocate_id_remap_prepare(), 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(), make_selected_objects_local(), pack_linked_id(), 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_F(), and blender::bke::tests::TEST_F().
Add a new remapping, replacing a potential already existing mapping of old_id.
Definition at line 24 of file lib_id_remapper.cc.
References 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 53 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(), 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(), blender::ed::vse::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 287 of file BKE_lib_remap.hh.
Referenced by foreach_libblock_remap_callback(), id_delete(), and blender::bke::id::tests::TEST().
|
inline |
Definition at line 299 of file BKE_lib_remap.hh.
References filter.
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 35 of file lib_id_remapper.cc.
References ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF, ID_REMAP_RESULT_SOURCE_REMAPPED, ID_REMAP_RESULT_SOURCE_UNASSIGNED, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, 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 294 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 337 of file BKE_lib_remap.hh.
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 331 of file BKE_lib_remap.hh.
Referenced by id_delete(), blender::bke::tests::TEST_F(), and blender::bke::tests::TEST_F().
|
inline |
Definition at line 326 of file BKE_lib_remap.hh.
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 110 of file lib_id_remapper.cc.
|
static |
Return a readable string for the given result. Can be used for debugging purposes.
Definition at line 94 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, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, and result.
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 285 of file BKE_lib_remap.hh.
Referenced by add(), add_overwrite(), and blender::bke::greasepencil::convert::legacy_main().