fix: presence selection error
This commit is contained in:
@ -44,6 +44,8 @@ class BlUser(BlDatablock):
|
|||||||
|
|
||||||
|
|
||||||
def diff(self):
|
def diff(self):
|
||||||
|
if not self.pointer:
|
||||||
|
return False
|
||||||
if self.pointer.is_dirty:
|
if self.pointer.is_dirty:
|
||||||
self.pointer.is_dirty = False
|
self.pointer.is_dirty = False
|
||||||
return True
|
return True
|
||||||
|
@ -126,7 +126,7 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
settings.client_color.b,
|
settings.client_color.b,
|
||||||
1),
|
1),
|
||||||
)
|
)
|
||||||
settings.user_uuid = client.add(usr)
|
settings.user_uuid = client.add(usr,owner=settings.username)
|
||||||
client.commit(settings.user_uuid)
|
client.commit(settings.user_uuid)
|
||||||
|
|
||||||
delayables.append(delayable.ClientUpdate(
|
delayables.append(delayable.ClientUpdate(
|
||||||
|
41
presence.py
41
presence.py
@ -187,12 +187,10 @@ class DrawFactory(object):
|
|||||||
self.d2d_items.clear()
|
self.d2d_items.clear()
|
||||||
|
|
||||||
def draw_client_selection(self, client_uuid, client_color, client_selection):
|
def draw_client_selection(self, client_uuid, client_color, client_selection):
|
||||||
local_username = bpy.context.window_manager.session.username
|
local_user = bpy.context.window_manager.session.user_uuid
|
||||||
|
|
||||||
self.flush_selection()
|
|
||||||
|
|
||||||
if client_selection:
|
|
||||||
|
|
||||||
|
if client_selection and local_user != client_uuid:
|
||||||
|
self.flush_selection()
|
||||||
for select_ob in client_selection:
|
for select_ob in client_selection:
|
||||||
drawable_key = "{}_select_{}".format(client_uuid, select_ob)
|
drawable_key = "{}_select_{}".format(client_uuid, select_ob)
|
||||||
indices = (
|
indices = (
|
||||||
@ -220,27 +218,28 @@ class DrawFactory(object):
|
|||||||
|
|
||||||
def draw_client_camera(self, client_uuid, client_location, client_color):
|
def draw_client_camera(self, client_uuid, client_location, client_color):
|
||||||
if client_location:
|
if client_location:
|
||||||
local_username = bpy.context.window_manager.session.username
|
local_user = bpy.context.window_manager.session.user_uuid
|
||||||
|
|
||||||
try:
|
if local_user != client_uuid:
|
||||||
indices = (
|
try:
|
||||||
(1, 3), (2, 1), (3, 0),
|
indices = (
|
||||||
(2, 0), (4, 5), (1, 6),
|
(1, 3), (2, 1), (3, 0),
|
||||||
(2, 6), (3, 6), (0, 6)
|
(2, 0), (4, 5), (1, 6),
|
||||||
)
|
(2, 6), (3, 6), (0, 6)
|
||||||
|
)
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
position = [tuple(coord) for coord in client_location]
|
position = [tuple(coord) for coord in client_location]
|
||||||
color = client_color
|
color = client_color
|
||||||
|
|
||||||
batch = batch_for_shader(
|
batch = batch_for_shader(
|
||||||
shader, 'LINES', {"pos": position}, indices=indices)
|
shader, 'LINES', {"pos": position}, indices=indices)
|
||||||
|
|
||||||
self.d3d_items[client_uuid] = (shader, batch, color)
|
self.d3d_items[client_uuid] = (shader, batch, color)
|
||||||
self.d2d_items[client_uuid] = (position[1], client_uuid, color)
|
self.d2d_items[client_uuid] = (position[1], client_uuid, color)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Draw client exception {}".format(e))
|
logger.error("Draw client exception {}".format(e))
|
||||||
|
|
||||||
def draw3d_callback(self):
|
def draw3d_callback(self):
|
||||||
bgl.glLineWidth(1.5)
|
bgl.glLineWidth(1.5)
|
||||||
|
Reference in New Issue
Block a user