[Bf-blender-cvs] [e8b4646] id-remap: Merge branch 'master' into id-remap
Bastien Montagne
noreply at git.blender.org
Thu Dec 3 16:36:53 CET 2015
Commit: e8b46461e67d9d0d6ba4072944b5bdee36ee69c0
Author: Bastien Montagne
Date: Thu Dec 3 14:25:05 2015 +0100
Branches: id-remap
https://developer.blender.org/rBe8b46461e67d9d0d6ba4072944b5bdee36ee69c0
Merge branch 'master' into id-remap
===================================================================
===================================================================
diff --cc source/blender/editors/include/ED_util.h
index dbdb2d4,cb33155..bda2430
--- a/source/blender/editors/include/ED_util.h
+++ b/source/blender/editors/include/ED_util.h
@@@ -42,8 -42,10 +42,10 @@@ void ED_editors_exit(struct bContex
bool ED_editors_flush_edits(const struct bContext *C, bool for_render);
-void ED_spacedata_id_unref(struct SpaceLink *sl, const struct ID *id);
+void ED_spacedata_id_remap(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id);
+ void ED_OT_flush_edits(struct wmOperatorType *ot);
+
/* ************** Undo ************************ */
/* undo.c */
diff --cc source/blender/editors/util/ed_util.c
index 1e6e4a4,0463980..29d0504
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@@ -327,13 -326,41 +327,33 @@@ void ED_region_draw_mouse_line_cb(cons
/**
* Use to free ID references within runtime data (stored outside of DNA)
*
- * \note Typically notifiers take care of this,
- * but there are times we have to free references immediately, see: T44376
+ * \param new_id may be NULL to unlink \a old_id.
*/
-void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
+void ED_spacedata_id_remap(struct ScrArea *sa, struct SpaceLink *sl, ID *old_id, ID *new_id)
{
+ SpaceType *st = BKE_spacetype_from_id(sl->spacetype);
- switch (sl->spacetype) {
- case SPACE_OUTLINER:
- ED_outliner_id_unref((SpaceOops *)sl, id);
- break;
- case SPACE_BUTS:
- ED_buttons_id_unref((SpaceButs *)sl, id);
- break;
- case SPACE_NODE:
- ED_node_id_unref((SpaceNode *)sl, id);
- break;
+ if (st && st->id_remap) {
+ st->id_remap(sa, sl, old_id, new_id);
}
}
+
+ static int ed_flush_edits_exec(bContext *C, wmOperator *UNUSED(op))
+ {
+ ED_editors_flush_edits(C, false);
+ return OPERATOR_FINISHED;
+ }
+
+ void ED_OT_flush_edits(wmOperatorType *ot)
+ {
+ /* identifiers */
+ ot->name = "Flush Edits";
+ ot->description = "Flush edit data from active editing modes";
+ ot->idname = "ED_OT_flush_edits";
+
+ /* api callbacks */
+ ot->exec = ed_flush_edits_exec;
+
+ /* flags */
+ ot->flag = OPTYPE_INTERNAL;
+ }
More information about the Bf-blender-cvs
mailing list