feat: factory setup
This commit is contained in:
parent
11b6866045
commit
e376650df2
@ -1 +1 @@
|
||||
Subproject commit 130845f74dc59d2bb0e5fee8c66e199ac377cff0
|
||||
Subproject commit e3de7fbfb9758fd576eba3a87d4a8c418066f16c
|
30
operators.py
30
operators.py
@ -17,6 +17,7 @@ from pathlib import Path
|
||||
from . import environment, presence, ui, utils
|
||||
from .libs import umsgpack
|
||||
from .libs.replication.client import Client
|
||||
from .libs.replication.data import ReplicatedDataFactory
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -116,9 +117,8 @@ def unregister_ticks():
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# OPERATORS
|
||||
|
||||
|
||||
class SessionStartOperator(bpy.types.Operator):
|
||||
bl_idname = "session.start"
|
||||
bl_label = "start"
|
||||
@ -142,20 +142,28 @@ class SessionStartOperator(bpy.types.Operator):
|
||||
if settings.start_empty:
|
||||
clean_scene()
|
||||
|
||||
# Session setup
|
||||
if settings.username == "DefaultUser":
|
||||
settings.username = "{}_{}".format(
|
||||
settings.username, utils.random_string_digits())
|
||||
# Setup data factory
|
||||
bpy_factory = ReplicatedDataFactory()
|
||||
|
||||
# Setup client
|
||||
client = Client(factory=bpy_factory)
|
||||
|
||||
client = Client()
|
||||
client.connect(settings.username,
|
||||
settings.ip,
|
||||
settings.port)
|
||||
if self.host:
|
||||
client.host(
|
||||
id=settings.username,
|
||||
address=settings.ip,
|
||||
port=settings.port
|
||||
)
|
||||
else:
|
||||
client.connect(
|
||||
id=settings.username,
|
||||
address=settings.ip,
|
||||
port=settings.port
|
||||
)
|
||||
|
||||
# settings.is_running = True
|
||||
# bpy.ops.session.refresh()
|
||||
register_ticks()
|
||||
#register_ticks()
|
||||
|
||||
# Launch drawing module
|
||||
if settings.enable_presence:
|
||||
|
Loading…
x
Reference in New Issue
Block a user