forked from bartvdbraak/blender
Depsgraph: add some missing depsgraph tags when relations change.
This commit is contained in:
parent
0d0d8935a5
commit
e1dff01e29
@ -852,6 +852,7 @@ static void import_endjob(void *user_data)
|
|||||||
base = BKE_view_layer_base_find(view_layer, ob);
|
base = BKE_view_layer_base_find(view_layer, ob);
|
||||||
BKE_view_layer_base_select(view_layer, base);
|
BKE_view_layer_base_select(view_layer, base);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&lc->collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_id_tag_update_ex(data->bmain, &ob->id,
|
DEG_id_tag_update_ex(data->bmain, &ob->id,
|
||||||
OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | DEG_TAG_BASE_FLAGS_UPDATE);
|
OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | DEG_TAG_BASE_FLAGS_UPDATE);
|
||||||
}
|
}
|
||||||
|
@ -359,6 +359,7 @@ void BKE_material_resize_id(Main *bmain, ID *id, short totcol, bool do_id_user)
|
|||||||
}
|
}
|
||||||
*totcolp = totcol;
|
*totcolp = totcol;
|
||||||
|
|
||||||
|
DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,6 +377,8 @@ void BKE_material_append_id(Main *bmain, ID *id, Material *ma)
|
|||||||
|
|
||||||
id_us_plus((ID *)ma);
|
id_us_plus((ID *)ma);
|
||||||
test_all_objects_materials(bmain, id);
|
test_all_objects_materials(bmain, id);
|
||||||
|
|
||||||
|
DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -410,6 +413,7 @@ Material *BKE_material_pop_id(Main *bmain, ID *id, int index_i, bool update_data
|
|||||||
material_data_index_remove_id(id, index);
|
material_data_index_remove_id(id, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,6 +441,7 @@ void BKE_material_clear_id(Main *bmain, ID *id, bool update_data)
|
|||||||
material_data_index_clear_id(id);
|
material_data_index_clear_id(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,6 +537,7 @@ void BKE_material_resize_object(Main *bmain, Object *ob, const short totcol, boo
|
|||||||
if (ob->totcol && ob->actcol == 0) ob->actcol = 1;
|
if (ob->totcol && ob->actcol == 0) ob->actcol = 1;
|
||||||
if (ob->actcol > ob->totcol) ob->actcol = ob->totcol;
|
if (ob->actcol > ob->totcol) ob->actcol = ob->totcol;
|
||||||
|
|
||||||
|
DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3528,6 +3528,7 @@ void BKE_object_groups_clear(Main *bmain, Object *ob)
|
|||||||
Collection *collection = NULL;
|
Collection *collection = NULL;
|
||||||
while ((collection = BKE_collection_object_find(bmain, collection, ob))) {
|
while ((collection = BKE_collection_object_find(bmain, collection, ob))) {
|
||||||
BKE_collection_object_remove(bmain, collection, ob, false);
|
BKE_collection_object_remove(bmain, collection, ob, false);
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,11 +232,6 @@ void DocumentImporter::finish()
|
|||||||
objects_to_scale->insert(objects_to_scale->end(), objects_done->begin(), objects_done->end());
|
objects_to_scale->insert(objects_to_scale->end(), objects_done->begin(), objects_done->end());
|
||||||
delete objects_done;
|
delete objects_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update scene
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
WM_event_add_notifier(mContext, NC_OBJECT | ND_TRANSFORM, NULL);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -245,7 +240,6 @@ void DocumentImporter::finish()
|
|||||||
armature_importer.set_tags_map(this->uid_tags_map);
|
armature_importer.set_tags_map(this->uid_tags_map);
|
||||||
armature_importer.make_armatures(mContext, *objects_to_scale);
|
armature_importer.make_armatures(mContext, *objects_to_scale);
|
||||||
armature_importer.make_shape_keys(mContext);
|
armature_importer.make_shape_keys(mContext);
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
armature_importer.fix_animation();
|
armature_importer.fix_animation();
|
||||||
@ -269,13 +263,16 @@ void DocumentImporter::finish()
|
|||||||
BKE_scene_collections_object_remove(bmain, sce, ob, true);
|
BKE_scene_collections_object_remove(bmain, sce, ob, true);
|
||||||
}
|
}
|
||||||
libnode_ob.clear();
|
libnode_ob.clear();
|
||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bc_match_scale(objects_to_scale, unit_converter, !this->import_settings->import_units);
|
bc_match_scale(objects_to_scale, unit_converter, !this->import_settings->import_units);
|
||||||
|
|
||||||
delete objects_to_scale;
|
delete objects_to_scale;
|
||||||
|
|
||||||
|
// update scene
|
||||||
|
DEG_id_tag_update(&sce->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
|
DEG_relations_tag_update(bmain);
|
||||||
|
WM_event_add_notifier(mContext, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,9 +242,6 @@ void SkinInfo::link_armature(bContext *C, Object *ob, std::map<COLLADAFW::Unique
|
|||||||
invert_m4_m4(ob->parentinv, workob.obmat);
|
invert_m4_m4(ob->parentinv, workob.obmat);
|
||||||
|
|
||||||
DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA);
|
DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA);
|
||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
|
||||||
#endif
|
#endif
|
||||||
copy_m4_m4(ob->obmat, bind_shape_matrix);
|
copy_m4_m4(ob->obmat, bind_shape_matrix);
|
||||||
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
||||||
|
@ -128,12 +128,6 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
|
|||||||
DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA);
|
DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA);
|
||||||
DEG_id_tag_update(&par->id, OB_RECALC_OB);
|
DEG_id_tag_update(&par->id, OB_RECALC_OB);
|
||||||
|
|
||||||
/** done once after import */
|
|
||||||
#if 0
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,8 +1097,6 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* works without this except if you try render right after, see: 22027 */
|
/* works without this except if you try render right after, see: 22027 */
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&collection->id, 0);
|
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
|
DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
||||||
|
|
||||||
@ -2002,9 +2000,6 @@ static int convert_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
FOREACH_SCENE_OBJECT_END;
|
FOREACH_SCENE_OBJECT_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete object should renew depsgraph */
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX ED_object_editmode_enter(C, 0);
|
// XXX ED_object_editmode_enter(C, 0);
|
||||||
|
@ -885,7 +885,6 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||||||
Base *base;
|
Base *base;
|
||||||
Curve *cu, *cu1;
|
Curve *cu, *cu1;
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
bool do_depgraph_update = false;
|
|
||||||
|
|
||||||
if (ID_IS_LINKED(scene)) return;
|
if (ID_IS_LINKED(scene)) return;
|
||||||
|
|
||||||
@ -1042,8 +1041,8 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||||||
else if (event == 22) {
|
else if (event == 22) {
|
||||||
/* Copy the constraint channels over */
|
/* Copy the constraint channels over */
|
||||||
BKE_constraints_copy(&base->object->constraints, &ob->constraints, true);
|
BKE_constraints_copy(&base->object->constraints, &ob->constraints, true);
|
||||||
|
DEG_id_tag_update(&base->object->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
do_depgraph_update = true;
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
else if (event == 23) {
|
else if (event == 23) {
|
||||||
base->object->softflag = ob->softflag;
|
base->object->softflag = ob->softflag;
|
||||||
@ -1054,6 +1053,9 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||||||
if (!modifiers_findByType(base->object, eModifierType_Softbody)) {
|
if (!modifiers_findByType(base->object, eModifierType_Softbody)) {
|
||||||
BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody));
|
BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(&base->object->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
else if (event == 26) {
|
else if (event == 26) {
|
||||||
#if 0 // XXX old animation system
|
#if 0 // XXX old animation system
|
||||||
@ -1094,9 +1096,6 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_depgraph_update)
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *view_layer, Object *obedit)
|
static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *view_layer, Object *obedit)
|
||||||
@ -1859,7 +1858,7 @@ static int move_to_collection_exec(bContext *C, wmOperator *op)
|
|||||||
is_link ? "linked" : "moved",
|
is_link ? "linked" : "moved",
|
||||||
collection->id.name + 2);
|
collection->id.name + 2);
|
||||||
|
|
||||||
DEG_relations_tag_update(CTX_data_main(C));
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE);
|
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "BKE_report.h"
|
#include "BKE_report.h"
|
||||||
#include "BKE_object.h"
|
#include "BKE_object.h"
|
||||||
|
|
||||||
|
#include "DEG_depsgraph.h"
|
||||||
#include "DEG_depsgraph_build.h"
|
#include "DEG_depsgraph_build.h"
|
||||||
|
|
||||||
#include "ED_screen.h"
|
#include "ED_screen.h"
|
||||||
@ -153,6 +154,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
if (!BKE_collection_object_cyclic_check(bmain, base->object, collection)) {
|
if (!BKE_collection_object_cyclic_check(bmain, base->object, collection)) {
|
||||||
BKE_collection_object_add(bmain, collection, base->object);
|
BKE_collection_object_add(bmain, collection, base->object);
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -223,6 +225,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
|
|||||||
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
|
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
|
||||||
{
|
{
|
||||||
BKE_collection_object_remove(bmain, collection, base->object, false);
|
BKE_collection_object_remove(bmain, collection, base->object, false);
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
ok = 1;
|
ok = 1;
|
||||||
}
|
}
|
||||||
CTX_DATA_END;
|
CTX_DATA_END;
|
||||||
@ -315,6 +318,7 @@ static int collection_objects_remove_exec(bContext *C, wmOperator *op)
|
|||||||
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
|
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
|
||||||
{
|
{
|
||||||
BKE_collection_object_remove(bmain, collection, base->object, false);
|
BKE_collection_object_remove(bmain, collection, base->object, false);
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
CTX_DATA_END;
|
CTX_DATA_END;
|
||||||
@ -366,6 +370,7 @@ static int collection_create_exec(bContext *C, wmOperator *op)
|
|||||||
CTX_DATA_BEGIN (C, Base *, base, selected_bases)
|
CTX_DATA_BEGIN (C, Base *, base, selected_bases)
|
||||||
{
|
{
|
||||||
BKE_collection_object_add(bmain, collection, base->object);
|
BKE_collection_object_add(bmain, collection, base->object);
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
}
|
}
|
||||||
CTX_DATA_END;
|
CTX_DATA_END;
|
||||||
|
|
||||||
|
@ -324,8 +324,6 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
|
|||||||
ob->mode &= ~OB_MODE_PARTICLE_EDIT;
|
ob->mode &= ~OB_MODE_PARTICLE_EDIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
|
||||||
|
|
||||||
BLI_remlink(&ob->modifiers, md);
|
BLI_remlink(&ob->modifiers, md);
|
||||||
modifier_free(md);
|
modifier_free(md);
|
||||||
BKE_object_free_derived_caches(ob);
|
BKE_object_free_derived_caches(ob);
|
||||||
|
@ -94,6 +94,8 @@ bool ED_rigidbody_constraint_add(Main *bmain, Scene *scene, Object *ob, int type
|
|||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
||||||
|
DEG_id_tag_update(&rbw->constraints->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,8 +104,10 @@ void ED_rigidbody_constraint_remove(Main *bmain, Scene *scene, Object *ob)
|
|||||||
RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
|
RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
|
||||||
|
|
||||||
BKE_rigidbody_remove_constraint(scene, ob);
|
BKE_rigidbody_remove_constraint(scene, ob);
|
||||||
if (rbw)
|
if (rbw) {
|
||||||
BKE_collection_object_remove(bmain, rbw->constraints, ob, false);
|
BKE_collection_object_remove(bmain, rbw->constraints, ob, false);
|
||||||
|
DEG_id_tag_update(&rbw->constraints->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
||||||
|
@ -125,6 +125,7 @@ bool ED_rigidbody_object_add(Main *bmain, Scene *scene, Object *ob, int type, Re
|
|||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
||||||
|
DEG_id_tag_update(&rbw->group->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -164,8 +164,10 @@ static int collection_new_exec(bContext *C, wmOperator *op)
|
|||||||
data.collection,
|
data.collection,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
outliner_cleanup_tree(soops);
|
DEG_id_tag_update(&data.collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
|
|
||||||
|
outliner_cleanup_tree(soops);
|
||||||
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
@ -236,18 +238,19 @@ static int collection_delete_exec(bContext *C, wmOperator *op)
|
|||||||
/* Effectively delete the collections. */
|
/* Effectively delete the collections. */
|
||||||
GSetIterator collections_to_edit_iter;
|
GSetIterator collections_to_edit_iter;
|
||||||
GSET_ITER(collections_to_edit_iter, data.collections_to_edit) {
|
GSET_ITER(collections_to_edit_iter, data.collections_to_edit) {
|
||||||
/* TODO: what if collection was child and got deleted in the meantime? */
|
|
||||||
Collection *collection = BLI_gsetIterator_getKey(&collections_to_edit_iter);
|
Collection *collection = BLI_gsetIterator_getKey(&collections_to_edit_iter);
|
||||||
BKE_collection_delete(bmain, collection, hierarchy);
|
|
||||||
|
/* Test in case collection got deleted as part of another one. */
|
||||||
|
if (BLI_findindex(&bmain->collection, collection) != -1) {
|
||||||
|
BKE_collection_delete(bmain, collection, hierarchy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_gset_free(data.collections_to_edit, NULL);
|
BLI_gset_free(data.collections_to_edit, NULL);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
|
|
||||||
/* TODO(sergey): Use proper flag for tagging here. */
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@ -462,11 +465,9 @@ static int collection_link_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
BLI_gset_free(data.collections_to_edit, NULL);
|
BLI_gset_free(data.collections_to_edit, NULL);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&active_collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
|
|
||||||
/* TODO(sergey): Use proper flag for tagging here. */
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@ -527,9 +528,6 @@ static int collection_instance_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
|
|
||||||
/* TODO(sergey): Use proper flag for tagging here. */
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
|
@ -2366,6 +2366,7 @@ static int collection_drop_invoke(bContext *C, wmOperator *op, const wmEvent *ev
|
|||||||
Object *ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname);
|
Object *ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname);
|
||||||
BKE_collection_object_add(bmain, collection, ob);
|
BKE_collection_object_add(bmain, collection, ob);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
|
||||||
|
|
||||||
|
@ -229,18 +229,22 @@ static void unlink_collection_cb(
|
|||||||
if (GS(tsep->id->name) == ID_OB) {
|
if (GS(tsep->id->name) == ID_OB) {
|
||||||
Object *ob = (Object *)tsep->id;
|
Object *ob = (Object *)tsep->id;
|
||||||
ob->dup_group = NULL;
|
ob->dup_group = NULL;
|
||||||
|
DEG_id_tag_update(&ob->id, OB_RECALC_OB);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
else if (GS(tsep->id->name) == ID_GR) {
|
else if (GS(tsep->id->name) == ID_GR) {
|
||||||
Collection *parent = (Collection *)tsep->id;
|
Collection *parent = (Collection *)tsep->id;
|
||||||
id_fake_user_set(&collection->id);
|
id_fake_user_set(&collection->id);
|
||||||
BKE_collection_child_remove(bmain, parent, collection);
|
BKE_collection_child_remove(bmain, parent, collection);
|
||||||
|
DEG_id_tag_update(&parent->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
else if (GS(tsep->id->name) == ID_SCE) {
|
else if (GS(tsep->id->name) == ID_SCE) {
|
||||||
Collection *parent = BKE_collection_master((Scene *)tsep->id);
|
Scene *scene = (Scene *)tsep->id;
|
||||||
|
Collection *parent = BKE_collection_master(scene);
|
||||||
id_fake_user_set(&collection->id);
|
id_fake_user_set(&collection->id);
|
||||||
BKE_collection_child_remove(bmain, parent, collection);
|
BKE_collection_child_remove(bmain, parent, collection);
|
||||||
|
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -257,11 +261,14 @@ static void unlink_object_cb(
|
|||||||
if (GS(tsep->id->name) == ID_GR) {
|
if (GS(tsep->id->name) == ID_GR) {
|
||||||
Collection *parent = (Collection *)tsep->id;
|
Collection *parent = (Collection *)tsep->id;
|
||||||
BKE_collection_object_remove(bmain, parent, ob, true);
|
BKE_collection_object_remove(bmain, parent, ob, true);
|
||||||
|
DEG_id_tag_update(&parent->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
else if (GS(tsep->id->name) == ID_SCE) {
|
else if (GS(tsep->id->name) == ID_SCE) {
|
||||||
Collection *parent = BKE_collection_master((Scene *)tsep->id);
|
Scene *scene = (Scene *)tsep->id;
|
||||||
|
Collection *parent = BKE_collection_master(scene);
|
||||||
BKE_collection_object_remove(bmain, parent, ob, true);
|
BKE_collection_object_remove(bmain, parent, ob, true);
|
||||||
|
DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ static void rna_Collection_objects_link(Collection *collection, Main *bmain, Rep
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
|
||||||
}
|
}
|
||||||
@ -98,6 +99,7 @@ static void rna_Collection_objects_unlink(Collection *collection, Main *bmain, R
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
|
||||||
}
|
}
|
||||||
@ -124,6 +126,7 @@ static void rna_Collection_children_link(Collection *collection, Main *bmain, Re
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &child->id);
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &child->id);
|
||||||
}
|
}
|
||||||
@ -135,6 +138,7 @@ static void rna_Collection_children_unlink(Collection *collection, Main *bmain,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &child->id);
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &child->id);
|
||||||
}
|
}
|
||||||
@ -145,8 +149,8 @@ static void rna_Collection_flag_update(Main *bmain, Scene *scene, PointerRNA *pt
|
|||||||
BKE_collection_object_cache_free(collection);
|
BKE_collection_object_cache_free(collection);
|
||||||
BKE_main_collection_sync(bmain);
|
BKE_main_collection_sync(bmain);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
DEG_id_tag_update(&collection->id, 0);
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
|
WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,8 +198,7 @@ static void rna_LayerCollection_use_update(Main *bmain, Scene *UNUSED(scene), Po
|
|||||||
|
|
||||||
BKE_layer_collection_sync(scene, view_layer);
|
BKE_layer_collection_sync(scene, view_layer);
|
||||||
|
|
||||||
/* TODO(sergey): Use proper flag for tagging here. */
|
DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE);
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,7 @@ static void rna_Material_use_nodes_update(bContext *C, PointerRNA *ptr)
|
|||||||
if (ma->use_nodes && ma->nodetree == NULL)
|
if (ma->use_nodes && ma->nodetree == NULL)
|
||||||
ED_node_shader_default(C, &ma->id);
|
ED_node_shader_default(C, &ma->id);
|
||||||
|
|
||||||
|
DEG_id_tag_update(&ma->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
rna_Material_draw_update(bmain, CTX_data_scene(C), ptr);
|
rna_Material_draw_update(bmain, CTX_data_scene(C), ptr);
|
||||||
}
|
}
|
||||||
|
@ -224,6 +224,7 @@ static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
|
|||||||
{
|
{
|
||||||
Object *ob = ptr->id.data;
|
Object *ob = ptr->id.data;
|
||||||
BKE_main_collection_sync(bmain);
|
BKE_main_collection_sync(bmain);
|
||||||
|
DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user