Compare commits
9 Commits
v0.5.6
...
fix-replic
Author | SHA1 | Date | |
---|---|---|---|
e02143c296 | |||
2a8498fe38 | |||
5b60a31fbb | |||
1e620b5f88 | |||
814b1d5044 | |||
ab48357b4a | |||
38e4375689 | |||
c3dcb9fc44 | |||
4c42a5be92 |
@ -1,13 +1,5 @@
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
- doc
|
||||
|
||||
|
||||
|
||||
include:
|
||||
- local: .gitlab/ci/test.gitlab-ci.yml
|
||||
- local: .gitlab/ci/build.gitlab-ci.yml
|
||||
- local: .gitlab/ci/deploy.gitlab-ci.yml
|
||||
- local: .gitlab/ci/doc.gitlab-ci.yml
|
||||
- local: .gitlab/ci/build.gitlab-ci.yml
|
@ -1,6 +1,5 @@
|
||||
build:
|
||||
stage: build
|
||||
needs: ["test"]
|
||||
image: debian:stable-slim
|
||||
script:
|
||||
- rm -rf tests .git .gitignore script
|
||||
|
@ -19,7 +19,7 @@
|
||||
bl_info = {
|
||||
"name": "Multi-User",
|
||||
"author": "Swann Martinez",
|
||||
"version": (0, 5, 7),
|
||||
"version": (0, 5, 8),
|
||||
"description": "Enable real-time collaborative workflow inside blender",
|
||||
"blender": (2, 82, 0),
|
||||
"location": "3D View > Sidebar > Multi-User tab",
|
||||
|
@ -30,8 +30,8 @@ VERSION_EXPR = re.compile('\d+.\d+.\d+')
|
||||
DEFAULT_CACHE_DIR = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)), "cache")
|
||||
REPLICATION_DEPENDENCIES = {
|
||||
"zmq",
|
||||
"deepdiff==5.7.0"
|
||||
("pyzmq", "25.0.0"),
|
||||
("deepdiff","5.7.0"),
|
||||
}
|
||||
LIBS = os.path.join(os.path.dirname(os.path.abspath(__file__)), "libs")
|
||||
REPLICATION = os.path.join(LIBS,"replication")
|
||||
@ -55,7 +55,7 @@ def install_pip():
|
||||
subprocess.run([str(PYTHON_PATH), "-m", "ensurepip"])
|
||||
|
||||
|
||||
def install_package(name: str, install_dir: str):
|
||||
def install_package(name: str, version:str=None, install_dir: str=None):
|
||||
logging.info(f"installing {name} version...")
|
||||
env = os.environ
|
||||
if "PIP_REQUIRE_VIRTUALENV" in env:
|
||||
@ -65,7 +65,8 @@ def install_package(name: str, install_dir: str):
|
||||
# env var for the subprocess.
|
||||
env = os.environ.copy()
|
||||
del env["PIP_REQUIRE_VIRTUALENV"]
|
||||
subprocess.run([str(PYTHON_PATH), "-m", "pip", "install", f"{name}", "-t", install_dir], env=env)
|
||||
module_name = f"{name}" if version is None else f"{name}=={version}"
|
||||
subprocess.run([str(PYTHON_PATH), "-m", "pip", "install", module_name, "-t", install_dir], env=env)
|
||||
|
||||
if name in sys.modules:
|
||||
del sys.modules[name]
|
||||
@ -119,7 +120,7 @@ def remove_paths(paths: list):
|
||||
sys.path.remove(path)
|
||||
|
||||
|
||||
def install_modules(dependencies: list, python_path: str, install_dir: str):
|
||||
def install_modules(dependencies: tuple, python_path: str, install_dir: str):
|
||||
global PYTHON_PATH, SUBPROCESS_DIR
|
||||
|
||||
PYTHON_PATH = Path(python_path)
|
||||
@ -128,9 +129,9 @@ def install_modules(dependencies: list, python_path: str, install_dir: str):
|
||||
if not module_can_be_imported("pip"):
|
||||
install_pip()
|
||||
|
||||
for package_name in dependencies:
|
||||
for package_name, package_version in dependencies:
|
||||
if not module_can_be_imported(package_name):
|
||||
install_package(package_name, install_dir=install_dir)
|
||||
install_package(package_name, version=package_version, install_dir=install_dir)
|
||||
module_can_be_imported(package_name)
|
||||
|
||||
def register():
|
||||
|
@ -133,7 +133,7 @@ def load_pre_handler(dummy):
|
||||
|
||||
@persistent
|
||||
def update_client_frame(scene):
|
||||
if session and session.state == STATE_ACTIVE:
|
||||
if session and session.state == STATE_ACTIVE and bpy.context.screen and not bpy.context.screen.is_animation_playing:
|
||||
porcelain.update_user_metadata(session.repository, {
|
||||
'frame_current': scene.frame_current
|
||||
})
|
||||
|
Submodule multi_user/libs/replication updated: d722cf0d65...b60feead9d
@ -297,17 +297,20 @@ def setup_timer():
|
||||
session_user_sync = timers.SessionUserSync()
|
||||
session_background_executor = timers.MainThreadExecutor(execution_queue=background_execution_queue)
|
||||
session_listen = timers.SessionListenTimer(timeout=0.001)
|
||||
session_frame_sync = timers.SessionFrameSync(timeout=1)
|
||||
|
||||
session_listen.register()
|
||||
session_update.register()
|
||||
session_user_sync.register()
|
||||
session_background_executor.register()
|
||||
session_frame_sync.register()
|
||||
|
||||
deleyables.append(session_background_executor)
|
||||
deleyables.append(session_update)
|
||||
deleyables.append(session_user_sync)
|
||||
deleyables.append(session_listen)
|
||||
deleyables.append(timers.AnnotationUpdates())
|
||||
deleyables.append(session_frame_sync)
|
||||
|
||||
def get_active_server_preset(context):
|
||||
active_index = context.window_manager.server_index
|
||||
|
@ -44,13 +44,27 @@ DEFAULT_PRESETS = {
|
||||
"admin_password": "admin",
|
||||
"server_password": ""
|
||||
},
|
||||
"public session" : {
|
||||
"server_name": "public session",
|
||||
"ip": "51.75.71.183",
|
||||
"NTHU Session 1" : {
|
||||
"server_name": "Session 1",
|
||||
"ip": "31.38.153.178",
|
||||
"port": 5555,
|
||||
"admin_password": "",
|
||||
"server_password": ""
|
||||
},
|
||||
"NTHU Session 2" : {
|
||||
"server_name": "Session 2",
|
||||
"ip": "31.38.153.178",
|
||||
"port": 5655,
|
||||
"admin_password": "",
|
||||
"server_password": ""
|
||||
},
|
||||
"NTHU Session 3" : {
|
||||
"server_name": "Session 3",
|
||||
"ip": "31.38.153.178",
|
||||
"port": 5755,
|
||||
"admin_password": "",
|
||||
"server_password": ""
|
||||
}
|
||||
}
|
||||
|
||||
def randomColor():
|
||||
|
@ -177,6 +177,7 @@ class AnnotationUpdates(Timer):
|
||||
affect_dependencies=False)
|
||||
self._annotating = False
|
||||
|
||||
|
||||
class DynamicRightSelectTimer(Timer):
|
||||
def __init__(self, timeout=.1):
|
||||
super().__init__(timeout)
|
||||
@ -266,7 +267,7 @@ class DynamicRightSelectTimer(Timer):
|
||||
|
||||
|
||||
class ClientUpdate(Timer):
|
||||
def __init__(self, timeout=.1):
|
||||
def __init__(self, timeout=1):
|
||||
super().__init__(timeout)
|
||||
self.handle_quit = False
|
||||
self.users_metadata = {}
|
||||
@ -387,3 +388,12 @@ class MainThreadExecutor(Timer):
|
||||
function, kwargs = self.execution_queue.get()
|
||||
logging.debug(f"Executing {function.__name__}")
|
||||
function(**kwargs)
|
||||
|
||||
|
||||
class SessionFrameSync(Timer):
|
||||
def execute(self):
|
||||
if session and session.state == STATE_ACTIVE:
|
||||
if bpy.context.screen and bpy.context.screen.is_animation_playing:
|
||||
porcelain.update_user_metadata(session.repository, {
|
||||
'frame_current': bpy.context.scene.frame_current
|
||||
})
|
Reference in New Issue
Block a user