Merge branch 'develop' into 218-new-ui-ux-implementation
32
CHANGELOG.md
@ -186,4 +186,34 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Exception access violation during Undo/Redo
|
- Exception access violation during Undo/Redo
|
||||||
- Sync missing armature bone Roll
|
- Sync missing armature bone Roll
|
||||||
- Sync missing driver data_path
|
- Sync missing driver data_path
|
||||||
- Constraint replication
|
- Constraint replication
|
||||||
|
|
||||||
|
## [0.4.0] - 2021-07-20
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Connection preset system (@Kysios)
|
||||||
|
- Display connected users active mode (users pannel and viewport) (@Kysios)
|
||||||
|
- Delta-based replication
|
||||||
|
- Sync timeline marker
|
||||||
|
- Sync images settings (@Kysios)
|
||||||
|
- Sync parent relation type (@Kysios)
|
||||||
|
- Sync uv project modifier
|
||||||
|
- Sync FCurves modifiers
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- User selection optimizations (draw and sync) (@Kysios)
|
||||||
|
- Improved shapekey syncing performances
|
||||||
|
- Improved gpencil syncing performances
|
||||||
|
- Integrate replication as a submodule
|
||||||
|
- The dependencies are now installed in a folder(blender addon folder) that no longer requires administrative rights
|
||||||
|
- Presence overlay UI optimization (@Kysios)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- User selection bounding box glitches for non-mesh objects (@Kysios)
|
||||||
|
- Transforms replication for animated objects
|
||||||
|
- GPencil fill stroke
|
||||||
|
- Sculpt and GPencil brushes deleted when joining a session (@Kysios)
|
||||||
|
- Auto-updater doesn't work for master and develop builds
|
||||||
|
63
README.md
@ -11,9 +11,8 @@ This tool aims to allow multiple users to work on the same scene over the networ
|
|||||||
|
|
||||||
## Quick installation
|
## Quick installation
|
||||||
|
|
||||||
1. Download latest release [multi_user.zip](https://gitlab.com/slumber/multi-user/-/jobs/artifacts/master/download?job=build).
|
1. Download [latest build](https://gitlab.com/slumber/multi-user/-/jobs/artifacts/develop/download?job=build) or [stable build](https://gitlab.com/slumber/multi-user/-/jobs/artifacts/master/download?job=build).
|
||||||
2. Run blender as administrator (dependencies installation).
|
2. Install last_version.zip from your addon preferences.
|
||||||
3. Install last_version.zip from your addon preferences.
|
|
||||||
|
|
||||||
[Dependencies](#dependencies) will be automatically added to your blender python during installation.
|
[Dependencies](#dependencies) will be automatically added to your blender python during installation.
|
||||||
|
|
||||||
@ -29,35 +28,35 @@ See the [troubleshooting guide](https://slumber.gitlab.io/multi-user/getting_sta
|
|||||||
|
|
||||||
Currently, not all data-block are supported for replication over the wire. The following list summarizes the status for each ones.
|
Currently, not all data-block are supported for replication over the wire. The following list summarizes the status for each ones.
|
||||||
|
|
||||||
| Name | Status | Comment |
|
| Name | Status | Comment |
|
||||||
| -------------- | :----: | :----------------------------------------------------------: |
|
| -------------- | :----: | :---------------------------------------------------------------------: |
|
||||||
| action | ✔️ | |
|
| action | ✔️ | |
|
||||||
| camera | ✔️ | |
|
| camera | ✔️ | |
|
||||||
| collection | ✔️ | |
|
| collection | ✔️ | |
|
||||||
| gpencil | ✔️ | |
|
| gpencil | ✔️ | |
|
||||||
| image | ✔️ | |
|
| image | ✔️ | |
|
||||||
| mesh | ✔️ | |
|
| mesh | ✔️ | |
|
||||||
| material | ✔️ | |
|
| material | ✔️ | |
|
||||||
| node_groups | ✔️ | Material & Geometry only |
|
| node_groups | ✔️ | Material & Geometry only |
|
||||||
| geometry nodes | ✔️ | |
|
| geometry nodes | ✔️ | |
|
||||||
| metaball | ✔️ | |
|
| metaball | ✔️ | |
|
||||||
| object | ✔️ | |
|
| object | ✔️ | |
|
||||||
| texts | ✔️ | |
|
| texts | ✔️ | |
|
||||||
| scene | ✔️ | |
|
| scene | ✔️ | |
|
||||||
| world | ✔️ | |
|
| world | ✔️ | |
|
||||||
| volumes | ✔️ | |
|
| volumes | ✔️ | |
|
||||||
| lightprobes | ✔️ | |
|
| lightprobes | ✔️ | |
|
||||||
| physics | ✔️ | |
|
| physics | ✔️ | |
|
||||||
| curve | ❗ | Nurbs surfaces not supported |
|
| textures | ✔️ | |
|
||||||
| textures | ❗ | Supported for modifiers/materials/geo nodes only |
|
| curve | ❗ | Nurbs surfaces not supported |
|
||||||
| armature | ❗ | Not stable |
|
| armature | ❗ | Only for Mesh. [Planned for GPencil](https://gitlab.com/slumber/multi-user/-/issues/161). Not stable yet |
|
||||||
| particles | ❗ | The cache isn't syncing. |
|
| particles | ❗ | The cache isn't syncing. |
|
||||||
| speakers | ❗ | [Partial](https://gitlab.com/slumber/multi-user/-/issues/65) |
|
| speakers | ❗ | [Partial](https://gitlab.com/slumber/multi-user/-/issues/65) |
|
||||||
| vse | ❗ | Mask and Clip not supported yet |
|
| vse | ❗ | Mask and Clip not supported yet |
|
||||||
| libraries | ❗ | Partial |
|
| libraries | ❌ | |
|
||||||
| nla | ❌ | |
|
| nla | ❌ | |
|
||||||
| texts | ❌ | [Planned](https://gitlab.com/slumber/multi-user/-/issues/81) |
|
| texts | ❌ | [Planned for v0.5.0](https://gitlab.com/slumber/multi-user/-/issues/81) |
|
||||||
| compositing | ❌ | [Planned](https://gitlab.com/slumber/multi-user/-/issues/46) |
|
| compositing | ❌ | [Planned for v0.5.0](https://gitlab.com/slumber/multi-user/-/issues/46) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 365 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 26 KiB |
@ -215,8 +215,10 @@ One of the most vital tools is the **Online user panel**. It lists all connected
|
|||||||
users' information including your own:
|
users' information including your own:
|
||||||
|
|
||||||
* **Role** : if a user is an admin or a regular user.
|
* **Role** : if a user is an admin or a regular user.
|
||||||
* **Location**: Where the user is actually working.
|
* **Username** : Name of the user.
|
||||||
|
* **Mode** : User's active editing mode (edit_mesh, paint,etc.).
|
||||||
* **Frame**: When (on which frame) the user is working.
|
* **Frame**: When (on which frame) the user is working.
|
||||||
|
* **Location**: Where the user is actually working.
|
||||||
* **Ping**: user's connection delay in milliseconds
|
* **Ping**: user's connection delay in milliseconds
|
||||||
|
|
||||||
.. figure:: img/quickstart_users.png
|
.. figure:: img/quickstart_users.png
|
||||||
@ -273,6 +275,7 @@ it draw users' related information in your viewport such as:
|
|||||||
|
|
||||||
* Username
|
* Username
|
||||||
* User point of view
|
* User point of view
|
||||||
|
* User active mode
|
||||||
* User selection
|
* User selection
|
||||||
|
|
||||||
.. figure:: img/quickstart_presence.png
|
.. figure:: img/quickstart_presence.png
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
"name": "Multi-User",
|
"name": "Multi-User",
|
||||||
"author": "Swann Martinez",
|
"author": "Swann Martinez",
|
||||||
"version": (0, 5, 0),
|
"version": (0, 4, 0),
|
||||||
"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",
|
||||||
|
@ -162,7 +162,7 @@ def dump_layer(layer):
|
|||||||
'hide',
|
'hide',
|
||||||
'annotation_hide',
|
'annotation_hide',
|
||||||
'lock',
|
'lock',
|
||||||
# 'lock_frame',
|
'lock_frame',
|
||||||
# 'lock_material',
|
# 'lock_material',
|
||||||
# 'use_mask_layer',
|
# 'use_mask_layer',
|
||||||
'use_lights',
|
'use_lights',
|
||||||
@ -170,12 +170,13 @@ def dump_layer(layer):
|
|||||||
'select',
|
'select',
|
||||||
'show_points',
|
'show_points',
|
||||||
'show_in_front',
|
'show_in_front',
|
||||||
|
# 'thickness'
|
||||||
# 'parent',
|
# 'parent',
|
||||||
# 'parent_type',
|
# 'parent_type',
|
||||||
# 'parent_bone',
|
# 'parent_bone',
|
||||||
# 'matrix_inverse',
|
# 'matrix_inverse',
|
||||||
]
|
]
|
||||||
if layer.id_data.is_annotation:
|
if layer.thickness != 0:
|
||||||
dumper.include_filter.append('thickness')
|
dumper.include_filter.append('thickness')
|
||||||
|
|
||||||
dumped_layer = dumper.dump(layer)
|
dumped_layer = dumper.dump(layer)
|
||||||
|
@ -94,18 +94,21 @@ def project_to_viewport(region: bpy.types.Region, rv3d: bpy.types.RegionView3D,
|
|||||||
return [target.x, target.y, target.z]
|
return [target.x, target.y, target.z]
|
||||||
|
|
||||||
|
|
||||||
def bbox_from_obj(obj: bpy.types.Object) -> list:
|
def bbox_from_obj(obj: bpy.types.Object, index: int = 1) -> list:
|
||||||
""" Generate a bounding box for a given object by using its world matrix
|
""" Generate a bounding box for a given object by using its world matrix
|
||||||
|
|
||||||
:param obj: target object
|
:param obj: target object
|
||||||
:type obj: bpy.types.Object
|
:type obj: bpy.types.Object
|
||||||
|
:param index: indice offset
|
||||||
|
:type index: int
|
||||||
:return: list of 8 points [(x,y,z),...], list of 12 link between these points [(1,2),...]
|
:return: list of 8 points [(x,y,z),...], list of 12 link between these points [(1,2),...]
|
||||||
"""
|
"""
|
||||||
radius = 1.0 # Radius of the bounding box
|
radius = 1.0 # Radius of the bounding box
|
||||||
|
index = 8*index
|
||||||
vertex_indices = (
|
vertex_indices = (
|
||||||
(0, 1), (0, 2), (1, 3), (2, 3),
|
(0+index, 1+index), (0+index, 2+index), (1+index, 3+index), (2+index, 3+index),
|
||||||
(4, 5), (4, 6), (5, 7), (6, 7),
|
(4+index, 5+index), (4+index, 6+index), (5+index, 7+index), (6+index, 7+index),
|
||||||
(0, 4), (1, 5), (2, 6), (3, 7))
|
(0+index, 4+index), (1+index, 5+index), (2+index, 6+index), (3+index, 7+index))
|
||||||
|
|
||||||
if obj.type == 'EMPTY':
|
if obj.type == 'EMPTY':
|
||||||
radius = obj.empty_display_size
|
radius = obj.empty_display_size
|
||||||
@ -117,9 +120,12 @@ def bbox_from_obj(obj: bpy.types.Object) -> list:
|
|||||||
radius = obj.data.display_size
|
radius = obj.data.display_size
|
||||||
elif hasattr(obj, 'bound_box'):
|
elif hasattr(obj, 'bound_box'):
|
||||||
vertex_indices = (
|
vertex_indices = (
|
||||||
(0, 1), (1, 2), (2, 3), (0, 3),
|
(0+index, 1+index), (1+index, 2+index),
|
||||||
(4, 5), (5, 6), (6, 7), (4, 7),
|
(2+index, 3+index), (0+index, 3+index),
|
||||||
(0, 4), (1, 5), (2, 6), (3, 7))
|
(4+index, 5+index), (5+index, 6+index),
|
||||||
|
(6+index, 7+index), (4+index, 7+index),
|
||||||
|
(0+index, 4+index), (1+index, 5+index),
|
||||||
|
(2+index, 6+index), (3+index, 7+index))
|
||||||
vertex_pos = get_bb_coords_from_obj(obj)
|
vertex_pos = get_bb_coords_from_obj(obj)
|
||||||
return vertex_pos, vertex_indices
|
return vertex_pos, vertex_indices
|
||||||
|
|
||||||
@ -136,26 +142,21 @@ def bbox_from_obj(obj: bpy.types.Object) -> list:
|
|||||||
|
|
||||||
return vertex_pos, vertex_indices
|
return vertex_pos, vertex_indices
|
||||||
|
|
||||||
def bbox_from_instance_collection(ic: bpy.types.Object) -> list:
|
def bbox_from_instance_collection(ic: bpy.types.Object, index: int = 0) -> list:
|
||||||
""" Generate a bounding box for a given instance collection by using its objects
|
""" Generate a bounding box for a given instance collection by using its objects
|
||||||
|
|
||||||
:param ic: target instance collection
|
:param ic: target instance collection
|
||||||
:type ic: bpy.types.Object
|
:type ic: bpy.types.Object
|
||||||
:param radius: bounding box radius
|
:param index: indice offset
|
||||||
:type radius: float
|
:type index: int
|
||||||
:return: list of 8*objs points [(x,y,z),...], tuple of 12*objs link between these points [(1,2),...]
|
:return: list of 8*objs points [(x,y,z),...], tuple of 12*objs link between these points [(1,2),...]
|
||||||
"""
|
"""
|
||||||
vertex_pos = []
|
vertex_pos = []
|
||||||
vertex_indices = ()
|
vertex_indices = ()
|
||||||
|
|
||||||
for obj_index, obj in enumerate(ic.instance_collection.objects):
|
for obj_index, obj in enumerate(ic.instance_collection.objects):
|
||||||
vertex_pos_temp, vertex_indices_temp = bbox_from_obj(obj)
|
vertex_pos_temp, vertex_indices_temp = bbox_from_obj(obj, index=index+obj_index)
|
||||||
vertex_pos += vertex_pos_temp
|
vertex_pos += vertex_pos_temp
|
||||||
vertex_indices_list_temp = list(list(indice) for indice in vertex_indices_temp)
|
|
||||||
for indice in vertex_indices_list_temp:
|
|
||||||
indice[0] += 8*obj_index
|
|
||||||
indice[1] += 8*obj_index
|
|
||||||
vertex_indices_temp = tuple(tuple(indice) for indice in vertex_indices_list_temp)
|
|
||||||
vertex_indices += vertex_indices_temp
|
vertex_indices += vertex_indices_temp
|
||||||
|
|
||||||
bbox_corners = [ic.matrix_world @ mathutils.Vector(vertex) for vertex in vertex_pos]
|
bbox_corners = [ic.matrix_world @ mathutils.Vector(vertex) for vertex in vertex_pos]
|
||||||
@ -223,7 +224,7 @@ def get_bb_coords_from_obj(object: bpy.types.Object, instance: bpy.types.Object
|
|||||||
|
|
||||||
bbox_corners = [base @ mathutils.Vector(
|
bbox_corners = [base @ mathutils.Vector(
|
||||||
corner) for corner in object.bound_box]
|
corner) for corner in object.bound_box]
|
||||||
|
|
||||||
|
|
||||||
return [(point.x, point.y, point.z) for point in bbox_corners]
|
return [(point.x, point.y, point.z) for point in bbox_corners]
|
||||||
|
|
||||||
@ -322,6 +323,8 @@ class UserSelectionWidget(Widget):
|
|||||||
username):
|
username):
|
||||||
self.username = username
|
self.username = username
|
||||||
self.settings = bpy.context.window_manager.session
|
self.settings = bpy.context.window_manager.session
|
||||||
|
self.current_selection_ids = []
|
||||||
|
self.current_selected_objects = []
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data(self):
|
def data(self):
|
||||||
@ -331,6 +334,15 @@ class UserSelectionWidget(Widget):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def selected_objects(self):
|
||||||
|
user_selection = self.data.get('selected_objects')
|
||||||
|
if self.current_selection_ids != user_selection:
|
||||||
|
self.current_selected_objects = [find_from_attr("uuid", uid, bpy.data.objects) for uid in user_selection]
|
||||||
|
self.current_selection_ids = user_selection
|
||||||
|
|
||||||
|
return self.current_selected_objects
|
||||||
|
|
||||||
def poll(self):
|
def poll(self):
|
||||||
if self.data is None:
|
if self.data is None:
|
||||||
return False
|
return False
|
||||||
@ -344,27 +356,32 @@ class UserSelectionWidget(Widget):
|
|||||||
self.settings.presence_show_selected and \
|
self.settings.presence_show_selected and \
|
||||||
self.settings.enable_presence
|
self.settings.enable_presence
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
user_selection = self.data.get('selected_objects')
|
vertex_pos = []
|
||||||
for select_obj in user_selection:
|
vertex_ind = []
|
||||||
obj = find_from_attr("uuid", select_obj, bpy.data.objects)
|
collection_offset = 0
|
||||||
if not obj:
|
for obj_index, obj in enumerate(self.selected_objects):
|
||||||
return
|
if obj is None:
|
||||||
if obj.instance_collection:
|
continue
|
||||||
vertex_pos, vertex_indices = bbox_from_instance_collection(obj)
|
obj_index+=collection_offset
|
||||||
|
if hasattr(obj, 'instance_collection') and obj.instance_collection:
|
||||||
|
bbox_pos, bbox_ind = bbox_from_instance_collection(obj, index=obj_index)
|
||||||
|
collection_offset+=len(obj.instance_collection.objects)-1
|
||||||
else :
|
else :
|
||||||
vertex_pos, vertex_indices = bbox_from_obj(obj)
|
bbox_pos, bbox_ind = bbox_from_obj(obj, index=obj_index)
|
||||||
|
vertex_pos += bbox_pos
|
||||||
|
vertex_ind += bbox_ind
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
batch = batch_for_shader(
|
batch = batch_for_shader(
|
||||||
shader,
|
shader,
|
||||||
'LINES',
|
'LINES',
|
||||||
{"pos": vertex_pos},
|
{"pos": vertex_pos},
|
||||||
indices=vertex_indices)
|
indices=vertex_ind)
|
||||||
|
|
||||||
shader.bind()
|
shader.bind()
|
||||||
shader.uniform_float("color", self.data.get('color'))
|
shader.uniform_float("color", self.data.get('color'))
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
class UserNameWidget(Widget):
|
class UserNameWidget(Widget):
|
||||||
draw_type = 'POST_PIXEL'
|
draw_type = 'POST_PIXEL'
|
||||||
|
@ -162,7 +162,7 @@ class AnnotationUpdates(Timer):
|
|||||||
logging.debug(
|
logging.debug(
|
||||||
"Getting the right on the annotation GP")
|
"Getting the right on the annotation GP")
|
||||||
porcelain.lock(session.repository,
|
porcelain.lock(session.repository,
|
||||||
registered_gp.uuid,
|
[registered_gp.uuid],
|
||||||
ignore_warnings=True,
|
ignore_warnings=True,
|
||||||
affect_dependencies=False)
|
affect_dependencies=False)
|
||||||
|
|
||||||
@ -172,14 +172,15 @@ class AnnotationUpdates(Timer):
|
|||||||
|
|
||||||
elif self._annotating:
|
elif self._annotating:
|
||||||
porcelain.unlock(session.repository,
|
porcelain.unlock(session.repository,
|
||||||
registered_gp.uuid,
|
[registered_gp.uuid],
|
||||||
ignore_warnings=True,
|
ignore_warnings=True,
|
||||||
affect_dependencies=False)
|
affect_dependencies=False)
|
||||||
|
self._annotating = False
|
||||||
|
|
||||||
class DynamicRightSelectTimer(Timer):
|
class DynamicRightSelectTimer(Timer):
|
||||||
def __init__(self, timeout=.1):
|
def __init__(self, timeout=.1):
|
||||||
super().__init__(timeout)
|
super().__init__(timeout)
|
||||||
self._last_selection = []
|
self._last_selection = set()
|
||||||
self._user = None
|
self._user = None
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
@ -191,52 +192,46 @@ class DynamicRightSelectTimer(Timer):
|
|||||||
self._user = session.online_users.get(settings.username)
|
self._user = session.online_users.get(settings.username)
|
||||||
|
|
||||||
if self._user:
|
if self._user:
|
||||||
current_selection = utils.get_selected_objects(
|
current_selection = set(utils.get_selected_objects(
|
||||||
bpy.context.scene,
|
bpy.context.scene,
|
||||||
bpy.data.window_managers['WinMan'].windows[0].view_layer
|
bpy.data.window_managers['WinMan'].windows[0].view_layer
|
||||||
)
|
))
|
||||||
if current_selection != self._last_selection:
|
if current_selection != self._last_selection:
|
||||||
obj_common = [
|
to_lock = list(current_selection.difference(self._last_selection))
|
||||||
o for o in self._last_selection if o not in current_selection]
|
to_release = list(self._last_selection.difference(current_selection))
|
||||||
obj_ours = [
|
instances_to_lock = list()
|
||||||
o for o in current_selection if o not in self._last_selection]
|
|
||||||
|
|
||||||
# change old selection right to common
|
for node_id in to_lock:
|
||||||
for obj in obj_common:
|
node = session.repository.graph.get(node_id)
|
||||||
node = session.repository.graph.get(obj)
|
instance_mode = node.data.get('instance_type')
|
||||||
|
if instance_mode and instance_mode == 'COLLECTION':
|
||||||
|
to_lock.remove(node_id)
|
||||||
|
instances_to_lock.append(node_id)
|
||||||
|
if instances_to_lock:
|
||||||
|
try:
|
||||||
|
porcelain.lock(session.repository,
|
||||||
|
instances_to_lock,
|
||||||
|
ignore_warnings=True,
|
||||||
|
affect_dependencies=False)
|
||||||
|
except NonAuthorizedOperationError as e:
|
||||||
|
logging.warning(e)
|
||||||
|
|
||||||
if node and (node.owner == settings.username or node.owner == RP_COMMON):
|
if to_release:
|
||||||
recursive = True
|
try:
|
||||||
if node.data and 'instance_type' in node.data.keys():
|
porcelain.unlock(session.repository,
|
||||||
recursive = node.data['instance_type'] != 'COLLECTION'
|
to_release,
|
||||||
try:
|
ignore_warnings=True,
|
||||||
porcelain.unlock(session.repository,
|
affect_dependencies=True)
|
||||||
node.uuid,
|
except NonAuthorizedOperationError as e:
|
||||||
ignore_warnings=True,
|
logging.warning(e)
|
||||||
affect_dependencies=recursive)
|
if to_lock:
|
||||||
except NonAuthorizedOperationError:
|
try:
|
||||||
logging.warning(
|
porcelain.lock(session.repository,
|
||||||
f"Not authorized to change {node} owner")
|
to_lock,
|
||||||
|
ignore_warnings=True,
|
||||||
# change new selection to our
|
affect_dependencies=True)
|
||||||
for obj in obj_ours:
|
except NonAuthorizedOperationError as e:
|
||||||
node = session.repository.graph.get(obj)
|
logging.warning(e)
|
||||||
|
|
||||||
if node and node.owner == RP_COMMON:
|
|
||||||
recursive = True
|
|
||||||
if node.data and 'instance_type' in node.data.keys():
|
|
||||||
recursive = node.data['instance_type'] != 'COLLECTION'
|
|
||||||
|
|
||||||
try:
|
|
||||||
porcelain.lock(session.repository,
|
|
||||||
node.uuid,
|
|
||||||
ignore_warnings=True,
|
|
||||||
affect_dependencies=recursive)
|
|
||||||
except NonAuthorizedOperationError:
|
|
||||||
logging.warning(
|
|
||||||
f"Not authorized to change {node} owner")
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
self._last_selection = current_selection
|
self._last_selection = current_selection
|
||||||
|
|
||||||
@ -250,17 +245,16 @@ class DynamicRightSelectTimer(Timer):
|
|||||||
# Fix deselection until right managment refactoring (with Roles concepts)
|
# Fix deselection until right managment refactoring (with Roles concepts)
|
||||||
if len(current_selection) == 0 :
|
if len(current_selection) == 0 :
|
||||||
owned_keys = [k for k, v in session.repository.graph.items() if v.owner==settings.username]
|
owned_keys = [k for k, v in session.repository.graph.items() if v.owner==settings.username]
|
||||||
for key in owned_keys:
|
if owned_keys:
|
||||||
node = session.repository.graph.get(key)
|
|
||||||
try:
|
try:
|
||||||
porcelain.unlock(session.repository,
|
porcelain.unlock(session.repository,
|
||||||
key,
|
owned_keys,
|
||||||
ignore_warnings=True,
|
ignore_warnings=True,
|
||||||
affect_dependencies=True)
|
affect_dependencies=True)
|
||||||
except NonAuthorizedOperationError:
|
except NonAuthorizedOperationError as e:
|
||||||
logging.warning(
|
logging.warning(e)
|
||||||
f"Not authorized to change {key} owner")
|
|
||||||
|
|
||||||
|
# Objects selectability
|
||||||
for obj in bpy.data.objects:
|
for obj in bpy.data.objects:
|
||||||
object_uuid = getattr(obj, 'uuid', None)
|
object_uuid = getattr(obj, 'uuid', None)
|
||||||
if object_uuid:
|
if object_uuid:
|
||||||
|