feat: one apply timer for all
This commit is contained in:
@ -59,21 +59,20 @@ class Timer(Delayable):
|
||||
|
||||
|
||||
class ApplyTimer(Timer):
|
||||
def __init__(self, timout=1, target_type=None):
|
||||
self._type = target_type
|
||||
def __init__(self, timout=1):
|
||||
super().__init__(timout)
|
||||
|
||||
def execute(self):
|
||||
client = operators.client
|
||||
if client and client.state['STATE'] == STATE_ACTIVE:
|
||||
nodes = client.list(filter=self._type)
|
||||
nodes = client.list()
|
||||
|
||||
for node in nodes:
|
||||
node_ref = client.get(uuid=node)
|
||||
|
||||
if node_ref.state == FETCHED:
|
||||
try:
|
||||
client.apply(node)
|
||||
client.apply(node, force=True)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
"fail to apply {}: {}".format(node_ref.uuid, e))
|
||||
|
Submodule multi_user/libs/replication updated: cb31158d22...5b2425c44d
@ -87,16 +87,13 @@ class SessionStartOperator(bpy.types.Operator):
|
||||
timer=type_local_config.bl_delay_refresh,
|
||||
automatic=type_local_config.auto_push)
|
||||
|
||||
if type_local_config.bl_delay_apply > 0:
|
||||
delayables.append(delayable.ApplyTimer(
|
||||
timout=type_local_config.bl_delay_apply,
|
||||
target_type=type_module_class))
|
||||
|
||||
client = Session(
|
||||
factory=bpy_factory,
|
||||
python_path=bpy.app.binary_path_python,
|
||||
default_strategy=settings.right_strategy)
|
||||
|
||||
delayables.append(delayable.ApplyTimer())
|
||||
|
||||
# Host a session
|
||||
if self.host:
|
||||
# Scene setup
|
||||
@ -500,6 +497,8 @@ def depsgraph_evaluation(scene):
|
||||
# Avoid slow geometry update
|
||||
if 'EDIT' in context.mode:
|
||||
break
|
||||
|
||||
logger.error(node.data['name'])
|
||||
client.stash(node.uuid)
|
||||
else:
|
||||
# Distant update
|
||||
|
Reference in New Issue
Block a user