fix(rcf): fix add object

This commit is contained in:
Swann Martinez 2019-03-29 18:19:53 +01:00
parent c366da3e5c
commit 2e931585ff
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1

View File

@ -510,6 +510,7 @@ class session_join(bpy.types.Operator):
# REGISTER Updaters
bpy.app.timers.register(tick)
bpy.app.timers.register(mesh_tick)
bpy.app.timers.register(object_tick)
bpy.ops.session.draw('INVOKE_DEFAULT')
@ -626,6 +627,7 @@ class session_stop(bpy.types.Operator):
bpy.ops.asyncio.stop()
net_settings.is_running = False
bpy.app.timers.unregister(tick)
bpy.app.timers.unregister(mesh_tick)
bpy.app.timers.unregister(object_tick)
else:
logger.debug("No server/client running.")
@ -898,6 +900,10 @@ classes = (
)
def mesh_tick():
mesh = get_update("Mesh")
if mesh:
upload_mesh(bpy.data.meshes[mesh])
return 2
@ -923,20 +929,22 @@ def tick():
# TODO: Enqueu tqsks
def depsgraph_update(scene):
for c in bpy.context.depsgraph.updates.items():
print(c[1].id)
global client
if client:
if client.status == net_components.RCFStatus.CONNECTED:
print(c[1].id)
if scene.session_settings.active_object:
if c[1].is_updated_geometry:
pass
if c[1].id.name == scene.session_settings.active_object.name:
add_update(c[1].id.bl_rna.name,c[1].id.name)
elif c[1].is_updated_transform:
if c[1].id.name == scene.session_settings.active_object.name:
add_update(c[1].id.bl_rna.name,c[1].id.name)
else:
if c[1].id.bl_rna.name == 'Material' or c[1].id.bl_rna.name == 'Shader Nodetree':
# if c[1].id.bl_rna.name == 'Material' or c[1].id.bl_rna.name== 'Shader Nodetree':
print(c[1].id.bl_rna.name)
data_name = c[1].id.name
if c[1].id.bl_rna.name == "Object":
if data_name in bpy.data.objects.keys():
found = False
for k in client.property_map.keys():