feat: common right progress
This commit is contained in:
parent
51db89ca7a
commit
db4dea94ed
@ -58,8 +58,7 @@ class BlGpencil(BlDatablock):
|
||||
target.materials.append(bpy.data.materials[mat])
|
||||
|
||||
def diff(self):
|
||||
return (self.bl_diff() or
|
||||
len(diff(self.dump(pointer=self.pointer), self.buffer)) > 0)
|
||||
return (self.bl_diff())
|
||||
|
||||
def dump(self, pointer=None):
|
||||
assert(pointer)
|
||||
|
15
delayable.py
15
delayable.py
@ -85,16 +85,25 @@ class DynamicRightSelectTimer(Timer):
|
||||
elif user_ref.pointer:
|
||||
current_selection = utils.get_selected_objects(bpy.context.scene)
|
||||
if current_selection != self.last_selection:
|
||||
self.last_selection = current_selection
|
||||
user_ref.pointer.update_selected_objects(bpy.context)
|
||||
|
||||
if settings.use_select_right:
|
||||
obj_common = [o for o in self.last_selection if o not in current_selection]
|
||||
obj_ours = [o for o in current_selection if o not in self.last_selection]
|
||||
|
||||
for obj in obj_common:
|
||||
node = operators.client.get(reference=bpy.data.objects[obj])
|
||||
if node:
|
||||
node.owner = settings.username
|
||||
operators.client.change_owner(node.uuid, 'common')
|
||||
|
||||
# update our rights
|
||||
for selected_obj in self.last_selection:
|
||||
node = operators.client.get(reference=bpy.data.objects[selected_obj])
|
||||
for obj in obj_ours:
|
||||
node = operators.client.get(reference=bpy.data.objects[obj])
|
||||
if node:
|
||||
node.owner = settings.username
|
||||
operators.client.change_owner(node.uuid, settings.username)
|
||||
self.last_selection = current_selection
|
||||
return self._timeout
|
||||
|
||||
# class CheckNewTimer(Timer):
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b33d715ceb30d9e625926ca01fd44a42570aa793
|
||||
Subproject commit 3d4a4b0b862680baa81f44bbf6c4a0df212da8df
|
6
ui.py
6
ui.py
@ -241,7 +241,11 @@ def draw_property(context, parent, property_uuid, level=0):
|
||||
# Operations
|
||||
|
||||
have_right_to_modify = settings.is_admin or item.owner == settings.username
|
||||
|
||||
detail_item_box.operator(
|
||||
"session.commit",
|
||||
text="",
|
||||
icon='TRIA_UP').target = item.uuid
|
||||
detail_item_box.separator()
|
||||
if item.state in [FETCHED, UP]:
|
||||
detail_item_box.operator(
|
||||
"session.apply",
|
||||
|
Loading…
x
Reference in New Issue
Block a user