diff --git a/__init__.py b/__init__.py index 1002c39..e61c536 100644 --- a/__init__.py +++ b/__init__.py @@ -42,6 +42,7 @@ def generate_supported_types(): props['bl_delay_apply']=_type.bl_delay_apply props['use_as_filter'] = False props['icon'] = _type.bl_icon + props['auto_push']=_type.bl_automatic_push # stype_dict[type]['bl_delay_apply']=_type.bl_delay_apply stype_dict['supported_types'][_type.bl_rep_class.__name__] = props @@ -93,6 +94,7 @@ def save_session_config(self,context): config["supported_types"][bloc.type_name]['bl_delay_apply'] = bloc.bl_delay_apply config["supported_types"][bloc.type_name]['use_as_filter'] = bloc.use_as_filter config["supported_types"][bloc.type_name]['icon'] = bloc.icon + config["supported_types"][bloc.type_name]['auto_push'] = bloc.auto_push # Save out the configuration file @@ -105,6 +107,7 @@ class ReplicatedDatablock(bpy.types.PropertyGroup): bl_delay_refresh: bpy.props.FloatProperty() bl_delay_apply: bpy.props.FloatProperty() use_as_filter: bpy.props.BoolProperty(default=True) + auto_push: bpy.props.BoolProperty(default=True) icon: bpy.props.StringProperty() class SessionProps(bpy.types.PropertyGroup): @@ -195,6 +198,8 @@ class SessionProps(bpy.types.PropertyGroup): rep_value.bl_delay_refresh = config["supported_types"][datablock]['bl_delay_refresh'] rep_value.bl_delay_apply = config["supported_types"][datablock]['bl_delay_apply'] rep_value.icon = config["supported_types"][datablock]['icon'] + rep_value.auto_push = config["supported_types"][datablock]['auto_push'] + def save(self,context): config = environment.load_config() @@ -211,6 +216,7 @@ class SessionProps(bpy.types.PropertyGroup): config["supported_types"][bloc.type_name]['bl_delay_apply'] = bloc.bl_delay_apply config["supported_types"][bloc.type_name]['use_as_filter'] = bloc.use_as_filter config["supported_types"][bloc.type_name]['icon'] = bloc.icon + config["supported_types"][bloc.type_name]['auto_push'] = bloc.auto_push environment.save_config(config) diff --git a/bl_types/bl_user.py b/bl_types/bl_user.py index c109dba..575b58c 100644 --- a/bl_types/bl_user.py +++ b/bl_types/bl_user.py @@ -61,7 +61,7 @@ class BlUser(BlDatablock): bl_id = "users" bl_class = presence.User bl_rep_class = BlUser -bl_delay_refresh = 1 -bl_delay_apply = 1 +bl_delay_refresh = .2 +bl_delay_apply = .2 bl_automatic_push = True bl_icon = 'CON_ARMATURE' \ No newline at end of file diff --git a/libs/replication b/libs/replication index 4434978..67c195f 160000 --- a/libs/replication +++ b/libs/replication @@ -1 +1 @@ -Subproject commit 443497886f91af935bfb8bae1a4273c414debff3 +Subproject commit 67c195f694b005c25c4881e7078d81286522cd40 diff --git a/operators.py b/operators.py index 85fdd47..c7aef18 100644 --- a/operators.py +++ b/operators.py @@ -80,7 +80,7 @@ class SessionStartOperator(bpy.types.Operator): _type.bl_class, _type.bl_rep_class, timer=type_local_config.bl_delay_refresh, - automatic=_type.bl_automatic_push) + automatic=type_local_config.auto_push) if type_local_config.bl_delay_apply > 0: delayables.append(delayable.ApplyTimer( @@ -307,8 +307,9 @@ class SessionCommit(bpy.types.Operator): def redresh_handler(dummy): global client - user = client.get(uuid=bpy.context.window_manager.session.user_uuid) - user.pointer.is_dirty = True + if client: + user = client.get(uuid=bpy.context.window_manager.session.user_uuid) + user.pointer.is_dirty = True classes = ( diff --git a/ui.py b/ui.py index 2dca038..c22eab2 100644 --- a/ui.py +++ b/ui.py @@ -152,12 +152,15 @@ class SESSION_PT_settings_replication(bpy.types.Panel): line.separator() line.label(text="refresh (sec)") line.label(text="apply (sec)") + for item in settings.supported_datablock: line = flow.row(align=True) - line.label(text="", icon=item.icon) + # line.label(text="", icon=item.icon) + line.prop(item, "auto_push", text="", icon=item.icon) line.separator() line.prop(item, "bl_delay_refresh", text="") line.prop(item, "bl_delay_apply", text="") + class SESSION_PT_user(bpy.types.Panel):