feat: skip external updates

This commit is contained in:
Swann 2021-06-03 15:43:47 +02:00
parent 07358802f7
commit 569543650f
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
2 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,8 @@
import bpy
import mathutils
from deepdiff import DeepDiff, Delta
from .. import utils
from replication.protocol import ReplicatedDatablock
from .dump_anything import Loader, Dumper
@ -140,5 +142,22 @@ class BlCollection(ReplicatedDatablock):
def resolve_deps(datablock: object) -> [object]:
return resolve_collection_dependencies(datablock)
@staticmethod
def compute_delta(last_data: dict, current_data: dict) -> Delta:
diff_params = {
'ignore_order': True,
'report_repetition': True
}
delta_params = {
# 'mutate': True
}
return Delta(
DeepDiff(last_data,
current_data,
cache_size=5000,
**diff_params),
**delta_params)
_type = bpy.types.Collection
_class = BlCollection

View File

@ -952,7 +952,11 @@ def depsgraph_evaluation(scene):
update_external_dependencies()
is_internal = [u for u in dependency_updates if u.is_updated_geometry or u.is_updated_shading or u.is_updated_transform]
# NOTE: maybe we don't need to check each update but only the first
if not is_internal:
return
for update in reversed(dependency_updates):
# Is the object tracked ?
if update.id.uuid: