feat: scene annotation
This commit is contained in:
15
helpers.py
15
helpers.py
@ -369,8 +369,11 @@ def load_scene(target=None, data=None, create=False):
|
|||||||
|
|
||||||
target.id = data['id']
|
target.id = data['id']
|
||||||
# Load annotation
|
# Load annotation
|
||||||
# if data["grease_pencil"]:
|
if data["grease_pencil"]:
|
||||||
# target.grease_pencil = bpy.data.grease_pencils[data["grease_pencil"]["name"]]
|
target.grease_pencil = bpy.data.grease_pencils[data["grease_pencil"]["name"]]
|
||||||
|
else:
|
||||||
|
target.grease_pencil = None
|
||||||
|
|
||||||
except:
|
except:
|
||||||
logger.error("Scene loading error")
|
logger.error("Scene loading error")
|
||||||
|
|
||||||
@ -526,8 +529,10 @@ def dump(key):
|
|||||||
if target_type == 'Material':
|
if target_type == 'Material':
|
||||||
data = dump_datablock_attibute(target, ['name','grease_pencil' ,'node_tree', 'id'], 7)
|
data = dump_datablock_attibute(target, ['name','grease_pencil' ,'node_tree', 'id'], 7)
|
||||||
elif target_type == 'Grease Pencil':
|
elif target_type == 'Grease Pencil':
|
||||||
data = dump_datablock_attibute(
|
data = dump_datablock(target, 2)
|
||||||
target, ['name', 'layers', 'materials', 'id'], 9)
|
dump_datablock_attibute(
|
||||||
|
target, ['layers'], 9,data)
|
||||||
|
|
||||||
elif target_type == 'Camera':
|
elif target_type == 'Camera':
|
||||||
data = dump_datablock(target, 1)
|
data = dump_datablock(target, 1)
|
||||||
elif target_type == 'Light':
|
elif target_type == 'Light':
|
||||||
@ -556,6 +561,8 @@ def dump(key):
|
|||||||
elif target_type == 'Collection':
|
elif target_type == 'Collection':
|
||||||
data = dump_datablock(target, 4)
|
data = dump_datablock(target, 4)
|
||||||
elif target_type == 'Scene':
|
elif target_type == 'Scene':
|
||||||
|
if target_type.grease_pencil:
|
||||||
|
pass
|
||||||
data = dump_datablock_attibute(
|
data = dump_datablock_attibute(
|
||||||
target, ['name', 'collection', 'id', 'camera', 'grease_pencil'], 4)
|
target, ['name', 'collection', 'id', 'camera', 'grease_pencil'], 4)
|
||||||
|
|
||||||
|
@ -549,7 +549,8 @@ def depsgraph_update(scene):
|
|||||||
|
|
||||||
|
|
||||||
if client_state == 3:
|
if client_state == 3:
|
||||||
if bpy.context.mode == 'OBJECT':
|
print(bpy.context.mode)
|
||||||
|
if bpy.context.mode in ['OBJECT','PAINT_GPENCIL']:
|
||||||
updates = bpy.context.depsgraph.updates
|
updates = bpy.context.depsgraph.updates
|
||||||
username = bpy.context.scene.session_settings.username
|
username = bpy.context.scene.session_settings.username
|
||||||
update_selected_object(bpy.context)
|
update_selected_object(bpy.context)
|
||||||
|
Reference in New Issue
Block a user