fix: annotation tool

This commit is contained in:
Swann 2021-01-13 14:24:16 +01:00
parent f5c77fec3a
commit 2bde136bb6
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB

View File

@ -174,6 +174,9 @@ class DynamicRightSelectTimer(Timer):
ctx = bpy.context
annotation_gp = ctx.scene.grease_pencil
if annotation_gp and not annotation_gp.uuid:
ctx.scene.update_tag()
# if an annotation exist and is tracked
if annotation_gp and annotation_gp.uuid:
registered_gp = session.get(uuid=annotation_gp.uuid)
@ -188,6 +191,13 @@ class DynamicRightSelectTimer(Timer):
settings.username,
ignore_warnings=True,
affect_dependencies=False)
if registered_gp.owner == settings.username:
gp_node = session.get(uuid=annotation_gp.uuid)
if gp_node.has_changed():
session.commit(gp_node.uuid)
session.push(gp_node.uuid, check_data=False)
elif self._annotating:
session.change_owner(
registered_gp.uuid,