Compare commits

..

10 Commits

Author SHA1 Message Date
dfcfb84c20 fix: text curve material loading 2021-12-17 16:14:42 +01:00
5390e1a60c Merge branch '235-show-color-in-connected-user-pannel' into 'develop'
Resolve "Show color in connected user pannel"

See merge request slumber/multi-user!154
2021-12-13 21:35:33 +00:00
2910ea654b clean: row factor 2021-12-13 22:29:55 +01:00
ff2ecec18b Merge branch '243-server-crash-during-public-sessions' into 'develop'
Resolve "Server crash during public sessions"

See merge request slumber/multi-user!162
2021-12-10 15:00:06 +00:00
7555b1332a feat: update version 2021-12-10 15:56:47 +01:00
690e450349 fix: avoid to store Commit in the replication graph 2021-12-10 15:55:59 +01:00
5ac61b5348 Merge branch 'develop' into 235-show-color-in-connected-user-pannel 2021-11-17 16:23:03 +01:00
189e5c6cf1 Merge branch 'develop' into 235-show-color-in-connected-user-pannel 2021-11-17 16:19:03 +01:00
e28d3860da user color property 2021-10-21 12:00:12 +02:00
7b247372fb test: add user color 2021-10-21 12:00:00 +02:00
10 changed files with 126 additions and 146 deletions

View File

@ -1,43 +1,13 @@
stages: stages:
# - test - test
# - build-addon-zip - build
# - build-amd64 - deploy
- build-arm64 - doc
# - doc
# include: include:
# # - local: .gitlab/ci/test.gitlab-ci.yml - local: .gitlab/ci/test.gitlab-ci.yml
# # - local: .gitlab/ci/build-addon.gitlab-ci.yml - local: .gitlab/ci/build.gitlab-ci.yml
# - local: .gitlab/ci/build-image.gitlab-ci.yml - local: .gitlab/ci/deploy.gitlab-ci.yml
# # - local: .gitlab/ci/doc.gitlab-ci.yml - local: .gitlab/ci/doc.gitlab-ci.yml
build-arm64:
stage: build-arm64
# needs: ["build-addon-zip"]
image: slumber/docker-python
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:19.03.12-dind
before_script:
- apk add curl
- mkdir -p ~/.docker/cli-plugins
- curl -sSLo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker info
script:
- RP_VERSION="$(python scripts/get_replication_version.py)"
- VERSION="$(python scripts/get_addon_version.py)"
- echo "Building docker image with replication ${RP_VERSION}"
- docker buildx create arm64 --use
- docker buildx build --platform linux/arm64 --build-arg version={VERSION} --tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 ./scripts/docker_server
- echo "Pushing to gitlab registry ${VERSION}-arm64"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 registry.gitlab.com/slumber/multi-user/multi-user-server:${CI_COMMIT_REF_NAME}-arm64
- docker push registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64

View File

@ -1,50 +0,0 @@
build-amd64:
stage: build-amd64
needs: ["build-addon-zip"]
image: slumber/docker-python
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:19.03.12-dind
script:
- RP_VERSION="$(python scripts/get_replication_version.py)"
- VERSION="$(python scripts/get_addon_version.py)"
- echo "Building docker image with replication ${RP_VERSION}"
- docker build --build-arg replication_version=${RP_VERSION} --build-arg version={VERSION} -t registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION} ./scripts/docker_server
- echo "Pushing to gitlab registry ${VERSION}"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION} registry.gitlab.com/slumber/multi-user/multi-user-server:${CI_COMMIT_REF_NAME}
- docker push registry.gitlab.com/slumber/multi-user/multi-user-server
build-arm64:
stage: build-arm64
# needs: ["build-addon-zip"]
image: slumber/docker-python
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:19.03.12-dind
before_script:
- apk add curl
- mkdir -p ~/.docker/cli-plugins
- curl -sSLo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker info
script:
- RP_VERSION="$(python scripts/get_replication_version.py)"
- VERSION="$(python scripts/get_addon_version.py)"
- echo "Building docker image with replication ${RP_VERSION}"
- docker buildx create arm64 --use
- docker buildx build --platform linux/arm64 --build-arg version={VERSION} --tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 ./scripts/docker_server
- echo "Pushing to gitlab registry ${VERSION}-arm64"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 registry.gitlab.com/slumber/multi-user/multi-user-server:${CI_COMMIT_REF_NAME}-arm64
- docker push registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64

View File

@ -1,5 +1,5 @@
build-addon-zip: build:
stage: build-addon-zip stage: build
needs: ["test"] needs: ["test"]
image: debian:stable-slim image: debian:stable-slim
script: script:

View File

@ -0,0 +1,21 @@
deploy:
stage: deploy
needs: ["build"]
image: slumber/docker-python
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:19.03.12-dind
script:
- RP_VERSION="$(python scripts/get_replication_version.py)"
- VERSION="$(python scripts/get_addon_version.py)"
- echo "Building docker image with replication ${RP_VERSION}"
- docker build --build-arg replication_version=${RP_VERSION} --build-arg version={VERSION} -t registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION} ./scripts/docker_server
- echo "Pushing to gitlab registry ${VERSION}"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION} registry.gitlab.com/slumber/multi-user/multi-user-server:${CI_COMMIT_REF_NAME}
- docker push registry.gitlab.com/slumber/multi-user/multi-user-server

View File

@ -1,6 +1,6 @@
pages: pages:
stage: doc stage: doc
needs: ["build-arm64","build-amd64"] needs: ["deploy"]
image: python image: python
script: script:
- pip install -U sphinx sphinx_rtd_theme sphinx-material - pip install -U sphinx sphinx_rtd_theme sphinx-material

View File

@ -19,7 +19,7 @@
bl_info = { bl_info = {
"name": "Multi-User", "name": "Multi-User",
"author": "Swann Martinez", "author": "Swann Martinez",
"version": (0, 4, 0), "version": (0, 4, 1),
"description": "Enable real-time collaborative workflow inside blender", "description": "Enable real-time collaborative workflow inside blender",
"blender": (2, 82, 0), "blender": (2, 82, 0),
"location": "3D View > Sidebar > Multi-User tab", "location": "3D View > Sidebar > Multi-User tab",

View File

@ -178,10 +178,10 @@ class BlCurve(ReplicatedDatablock):
loader.load(new_spline, spline) loader.load(new_spline, spline)
# MATERIAL SLOTS # MATERIAL SLOTS
src_materials = data.get('materials', None) src_materials = data.get('materials', None)
if src_materials: if src_materials:
load_materials_slots(src_materials, datablock.materials) load_materials_slots(src_materials, datablock.materials)
@staticmethod @staticmethod
def dump(datablock: object) -> dict: def dump(datablock: object) -> dict:

View File

@ -619,6 +619,11 @@ class SessionUser(bpy.types.PropertyGroup):
""" """
username: bpy.props.StringProperty(name="username") username: bpy.props.StringProperty(name="username")
current_frame: bpy.props.IntProperty(name="current_frame") current_frame: bpy.props.IntProperty(name="current_frame")
color: bpy.props.FloatVectorProperty(name="color", subtype="COLOR",
min=0.0,
max=1.0,
size=4,
default=(1.0, 1.0, 1.0, 1.0))
class SessionProps(bpy.types.PropertyGroup): class SessionProps(bpy.types.PropertyGroup):

View File

@ -62,7 +62,41 @@ def printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=
bar = fill * filledLength + fill_empty * (length - filledLength) bar = fill * filledLength + fill_empty * (length - filledLength)
return f"{prefix} |{bar}| {iteration}/{total}{suffix}" return f"{prefix} |{bar}| {iteration}/{total}{suffix}"
def get_mode_icon(mode_name: str) -> str:
""" given a mode name retrieve a built-in icon
"""
mode_icon = "NONE"
if mode_name == "OBJECT" :
mode_icon = "OBJECT_DATAMODE"
elif mode_name == "EDIT_MESH" :
mode_icon = "EDITMODE_HLT"
elif mode_name == 'EDIT_CURVE':
mode_icon = "CURVE_DATA"
elif mode_name == 'EDIT_SURFACE':
mode_icon = "SURFACE_DATA"
elif mode_name == 'EDIT_TEXT':
mode_icon = "FILE_FONT"
elif mode_name == 'EDIT_ARMATURE':
mode_icon = "ARMATURE_DATA"
elif mode_name == 'EDIT_METABALL':
mode_icon = "META_BALL"
elif mode_name == 'EDIT_LATTICE':
mode_icon = "LATTICE_DATA"
elif mode_name == 'POSE':
mode_icon = "POSE_HLT"
elif mode_name == 'SCULPT':
mode_icon = "SCULPTMODE_HLT"
elif mode_name == 'PAINT_WEIGHT':
mode_icon = "WPAINT_HLT"
elif mode_name == 'PAINT_VERTEX':
mode_icon = "VPAINT_HLT"
elif mode_name == 'PAINT_TEXTURE':
mode_icon = "TPAINT_HLT"
elif mode_name == 'PARTICLE':
mode_icon = "PARTICLES"
elif mode_name == 'PAINT_GPENCIL' or mode_name =='EDIT_GPENCIL' or mode_name =='SCULPT_GPENCIL' or mode_name =='WEIGHT_GPENCIL' or mode_name =='VERTEX_GPENCIL':
mode_icon = "GREASEPENCIL"
return mode_icon
class SESSION_PT_settings(bpy.types.Panel): class SESSION_PT_settings(bpy.types.Panel):
"""Settings panel""" """Settings panel"""
bl_idname = "MULTIUSER_SETTINGS_PT_panel" bl_idname = "MULTIUSER_SETTINGS_PT_panel"
@ -375,18 +409,31 @@ class SESSION_PT_user(bpy.types.Panel):
online_users)-1 >= selected_user else 0 online_users)-1 >= selected_user else 0
#USER LIST #USER LIST
row = layout.row() col = layout.column(align=True)
row = col.row(align=True)
row = row.split(factor=0.35, align=True)
box = row.box() box = row.box()
split = box.split(factor=0.35) brow = box.row(align=True)
split.label(text="user") brow.label(text="user")
split = split.split(factor=0.3)
split.label(text="mode")
split.label(text="frame")
split.label(text="location")
split.label(text="ping")
row = layout.row() row = row.split(factor=0.25, align=True)
layout.template_list("SESSION_UL_users", "", context.window_manager,
box = row.box()
brow = box.row(align=True)
brow.label(text="mode")
box = row.box()
brow = box.row(align=True)
brow.label(text="frame")
box = row.box()
brow = box.row(align=True)
brow.label(text="scene")
box = row.box()
brow = box.row(align=True)
brow.label(text="ping")
row = col.row(align=True)
row.template_list("SESSION_UL_users", "", context.window_manager,
"online_users", context.window_manager, "user_index") "online_users", context.window_manager, "user_index")
#OPERATOR ON USER #OPERATOR ON USER
@ -433,45 +480,32 @@ class SESSION_UL_users(bpy.types.UIList):
frame_current = str(metadata.get('frame_current','-')) frame_current = str(metadata.get('frame_current','-'))
scene_current = metadata.get('scene_current','-') scene_current = metadata.get('scene_current','-')
mode_current = metadata.get('mode_current','-') mode_current = metadata.get('mode_current','-')
if mode_current == "OBJECT" : mode_current = metadata.get('mode_current','-')
mode_icon = "OBJECT_DATAMODE" mode_icon = get_mode_icon(mode_current)
elif mode_current == "EDIT_MESH" : user_color = metadata.get('color',[1.0,1.0,1.0,1.0])
mode_icon = "EDITMODE_HLT" item.color = user_color
elif mode_current == 'EDIT_CURVE':
mode_icon = "CURVE_DATA"
elif mode_current == 'EDIT_SURFACE':
mode_icon = "SURFACE_DATA"
elif mode_current == 'EDIT_TEXT':
mode_icon = "FILE_FONT"
elif mode_current == 'EDIT_ARMATURE':
mode_icon = "ARMATURE_DATA"
elif mode_current == 'EDIT_METABALL':
mode_icon = "META_BALL"
elif mode_current == 'EDIT_LATTICE':
mode_icon = "LATTICE_DATA"
elif mode_current == 'POSE':
mode_icon = "POSE_HLT"
elif mode_current == 'SCULPT':
mode_icon = "SCULPTMODE_HLT"
elif mode_current == 'PAINT_WEIGHT':
mode_icon = "WPAINT_HLT"
elif mode_current == 'PAINT_VERTEX':
mode_icon = "VPAINT_HLT"
elif mode_current == 'PAINT_TEXTURE':
mode_icon = "TPAINT_HLT"
elif mode_current == 'PARTICLE':
mode_icon = "PARTICLES"
elif mode_current == 'PAINT_GPENCIL' or mode_current =='EDIT_GPENCIL' or mode_current =='SCULPT_GPENCIL' or mode_current =='WEIGHT_GPENCIL' or mode_current =='VERTEX_GPENCIL':
mode_icon = "GREASEPENCIL"
if user['admin']: if user['admin']:
status_icon = 'FAKE_USER_ON' status_icon = 'FAKE_USER_ON'
split = layout.split(factor=0.35) row = layout.split(factor=0.35, align=True)
split.label(text=item.username, icon=status_icon) entry = row.row(align=True)
split = split.split(factor=0.3) entry.scale_x = 0.05
split.label(icon=mode_icon) entry.enabled = False
split.label(text=frame_current) entry.prop(item, 'color', text="", event=False, full_event=False)
split.label(text=scene_current) entry.enabled = True
split.label(text=ping) entry.scale_x = 1.0
entry.label(icon=status_icon, text="")
entry.label(text=item.username)
row = row.split(factor=0.25, align=True)
entry = row.row()
entry.label(icon=mode_icon)
entry = row.row()
entry.label(text=frame_current)
entry = row.row()
entry.label(text=scene_current)
entry = row.row()
entry.label(text=ping)
def draw_property(context, parent, property_uuid, level=0): def draw_property(context, parent, property_uuid, level=0):
settings = get_preferences() settings = get_preferences()