refactor: code formatting
This commit is contained in:
parent
b86f987e3e
commit
3710b3ca14
14
operators.py
14
operators.py
@ -101,10 +101,9 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
)
|
)
|
||||||
settings.is_admin = True
|
settings.is_admin = True
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
utils.clean_scene()
|
utils.clean_scene()
|
||||||
|
|
||||||
client.connect(
|
client.connect(
|
||||||
id=settings.username,
|
id=settings.username,
|
||||||
address=settings.ip,
|
address=settings.ip,
|
||||||
@ -141,7 +140,6 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
# Push all added values
|
# Push all added values
|
||||||
client.push()
|
client.push()
|
||||||
|
|
||||||
|
|
||||||
# Launch drawing module
|
# Launch drawing module
|
||||||
if settings.enable_presence:
|
if settings.enable_presence:
|
||||||
presence.renderer.run()
|
presence.renderer.run()
|
||||||
@ -149,8 +147,8 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
for d in delayables:
|
for d in delayables:
|
||||||
d.register()
|
d.register()
|
||||||
self.report(
|
self.report(
|
||||||
{'INFO'},
|
{'INFO'},
|
||||||
"connexion on tcp://{}:{}".format(settings.ip,settings.port))
|
"connexion on tcp://{}:{}".format(settings.ip, settings.port))
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@ -199,7 +197,7 @@ class SessionPropertyRemoveOperator(bpy.types.Operator):
|
|||||||
client.remove(self.property_path)
|
client.remove(self.property_path)
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
except:# NonAuthorizedOperationError:
|
except: # NonAuthorizedOperationError:
|
||||||
self.report(
|
self.report(
|
||||||
{'ERROR'},
|
{'ERROR'},
|
||||||
"Non authorized operation")
|
"Non authorized operation")
|
||||||
@ -284,6 +282,7 @@ class SessionApply(bpy.types.Operator):
|
|||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class SessionCommit(bpy.types.Operator):
|
class SessionCommit(bpy.types.Operator):
|
||||||
bl_idname = "session.commit"
|
bl_idname = "session.commit"
|
||||||
bl_label = "commit and push the target to other clients"
|
bl_label = "commit and push the target to other clients"
|
||||||
@ -303,6 +302,7 @@ class SessionCommit(bpy.types.Operator):
|
|||||||
client.push(uuid=self.target)
|
client.push(uuid=self.target)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def redresh_handler(dummy):
|
def redresh_handler(dummy):
|
||||||
global client
|
global client
|
||||||
@ -344,7 +344,7 @@ def unregister():
|
|||||||
from bpy.utils import unregister_class
|
from bpy.utils import unregister_class
|
||||||
for cls in reversed(classes):
|
for cls in reversed(classes):
|
||||||
unregister_class(cls)
|
unregister_class(cls)
|
||||||
|
|
||||||
bpy.app.handlers.depsgraph_update_post.remove(redresh_handler)
|
bpy.app.handlers.depsgraph_update_post.remove(redresh_handler)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user