fix: skeleton loading error

This commit is contained in:
Swann
2019-09-17 17:23:57 +02:00
parent 3710b3ca14
commit 85f1db829b
4 changed files with 15 additions and 6 deletions

View File

@ -19,17 +19,24 @@ class BlArmature(BlDatablock):
else:
parent_object = bpy.data.objects[data['user']]
# Link it to the correct context
if data['user_collection'][0] == "Master Collection":
is_object_in_master = (data['user_collection'][0] == "Master Collection")
#TODO: recursive parent collection loading
# Link parent object to the collection
if is_object_in_master:
parent_collection = bpy.data.scenes[data['user_scene'][0]].collection
elif data['user_collection'][0] not in bpy.data.collections.keys():
parent_collection = bpy.data.collections.new(data['user_collection'][0])
else:
parent_collection = bpy.data.collection['user_collection'][0]
parent_collection = bpy.data.collections[data['user_collection'][0]]
if parent_object.name not in parent_collection.objects:
parent_collection.objects.link(parent_object)
# Link parent collection to the scene master collection
if not is_object_in_master and parent_collection.name not in bpy.data.scenes[data['user_scene'][0]].collection.children:
bpy.data.scenes[data['user_scene'][0]].collection. children.link(parent_collection)
# utils.dump_anything.load(target, data)
# with Overrider(name="bpy_",parent=bpy.context) as bpy_:
area, region, rv3d = presence.view3d_find()

View File

@ -309,6 +309,8 @@ def redresh_handler(dummy):
if client:
user = client.get(uuid=bpy.context.window_manager.session.user_uuid)
if hasattr(user,"pointer"):
user.pointer.is_dirty = True

View File

@ -34,7 +34,7 @@ def get_users(datablock):
root = getattr(bpy.data,datatype.bl_name)
for item in root:
if hasattr(item, 'data') and datablock == item.data or \
hasattr(item, 'children') and datablock in item.children:
datatype.bl_name != 'collections' and hasattr(item, 'children') and datablock in item.children:
users.append(item)
return users