ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Jun 2016 15:29:38 +0000 (17:29 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Jun 2016 15:53:50 +0000 (17:53 +0200)
commit897e97f078e64e5ee5fbbd929fd1e46240371ef4
tree1450381a5bf063cd5d935df58ee36548d9c54af7
parent73cfbb0ab937d837a40a03765108b3af11606b7c
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).

This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.

Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).

One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).

This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).

This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.

A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)

Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
95 files changed:
source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_library_query.h
source/blender/blenkernel/BKE_library_remap.h [new file with mode: 0644]
source/blender/blenkernel/BKE_linestyle.h
source/blender/blenkernel/BKE_mask.h
source/blender/blenkernel/BKE_mball.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_sca.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_world.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lamp.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/library_remap.c [new file with mode: 0644]
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/speaker.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/compositor/operations/COM_MaskOperation.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/include/ED_buttons.h
source/blender/editors/include/ED_node.h
source/blender/editors/include/ED_outliner.h
source/blender/editors/include/ED_util.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/mesh/editmesh_undo.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_group.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/util/ed_util.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_texture.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp