File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -65,27 +65,22 @@ namespace ms {
6565 void InstancesManager::add (InstanceInfoPtr info)
6666 {
6767 auto & rec = lockAndGet (info->path );
68-
69- bool existed = false ;
70-
68+
7169 for (int i = 0 ; i < rec.instancesPerParent [info->parent_path ].size (); ++i)
7270 {
7371 const auto & instance = rec.instancesPerParent [info->parent_path ][i];
7472
7573 if (instance->parent_path == info->parent_path )
7674 {
77- existed = true ;
78-
7975 // Remove instance from the list, the new one will be added below:
8076 rec.instancesPerParent [info->parent_path ].erase (rec.instancesPerParent [info->parent_path ].begin () + i);
8177
8278 break ;
8379 }
8480 }
8581
86- if (m_always_mark_dirty || !existed) {
87- rec.dirtyInstances = true ;
88- }
82+ // instanceInfos need to be sent every update because it's how the server knows which instances are still alive:
83+ rec.dirtyInstances = true ;
8984
9085 rec.instancesPerParent [info->parent_path ].push_back (info);
9186 rec.updatedParents [info->parent_path ] = true ;
Original file line number Diff line number Diff line change @@ -37,10 +37,7 @@ void msblenContext::exportInstances() {
3737 auto id = static_cast <ID*>(obj->data );
3838 scene_objects.insert (id->name + 2 );
3939 });
40-
41- // Assume everything is now dirty
42- m_instances_state->manager .setAlwaysMarkDirty (true );
43-
40+
4441 std::unordered_map<std::string, ms::TransformPtr> exportedTransforms;
4542
4643 m_geometryNodeUtils.each_instanced_object (
You can’t perform that action at this time.
0 commit comments