fix: skeleton loading error
This commit is contained in:
@ -19,17 +19,24 @@ class BlArmature(BlDatablock):
|
|||||||
else:
|
else:
|
||||||
parent_object = bpy.data.objects[data['user']]
|
parent_object = bpy.data.objects[data['user']]
|
||||||
|
|
||||||
# Link it to the correct context
|
is_object_in_master = (data['user_collection'][0] == "Master Collection")
|
||||||
if 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
|
parent_collection = bpy.data.scenes[data['user_scene'][0]].collection
|
||||||
elif data['user_collection'][0] not in bpy.data.collections.keys():
|
elif data['user_collection'][0] not in bpy.data.collections.keys():
|
||||||
parent_collection = bpy.data.collections.new(data['user_collection'][0])
|
parent_collection = bpy.data.collections.new(data['user_collection'][0])
|
||||||
else:
|
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:
|
if parent_object.name not in parent_collection.objects:
|
||||||
parent_collection.objects.link(parent_object)
|
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)
|
# utils.dump_anything.load(target, data)
|
||||||
# with Overrider(name="bpy_",parent=bpy.context) as bpy_:
|
# with Overrider(name="bpy_",parent=bpy.context) as bpy_:
|
||||||
area, region, rv3d = presence.view3d_find()
|
area, region, rv3d = presence.view3d_find()
|
||||||
|
Submodule libs/replication updated: 1133d1d22b...543e9b7d1d
@ -309,6 +309,8 @@ def redresh_handler(dummy):
|
|||||||
|
|
||||||
if client:
|
if client:
|
||||||
user = client.get(uuid=bpy.context.window_manager.session.user_uuid)
|
user = client.get(uuid=bpy.context.window_manager.session.user_uuid)
|
||||||
|
|
||||||
|
if hasattr(user,"pointer"):
|
||||||
user.pointer.is_dirty = True
|
user.pointer.is_dirty = True
|
||||||
|
|
||||||
|
|
||||||
|
2
utils.py
2
utils.py
@ -34,7 +34,7 @@ def get_users(datablock):
|
|||||||
root = getattr(bpy.data,datatype.bl_name)
|
root = getattr(bpy.data,datatype.bl_name)
|
||||||
for item in root:
|
for item in root:
|
||||||
if hasattr(item, 'data') and datablock == item.data or \
|
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)
|
users.append(item)
|
||||||
return users
|
return users
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user