Files
multi-user/multi_user/io_bpy/bl_library.py

46 lines
1.4 KiB
Python
Raw Normal View History

2020-03-20 14:56:50 +01:00
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####
2019-08-29 18:23:29 +02:00
import bpy
import mathutils
from .dump_anything import Loader, Dumper
2019-08-29 18:23:29 +02:00
from .bl_datablock import BlDatablock
class BlLibrary(BlDatablock):
bl_id = "libraries"
bl_class = bpy.types.Library
2020-09-17 22:47:11 +02:00
bl_check_common = False
bl_icon = 'LIBRARY_DATA_DIRECT'
bl_reload_parent = False
def construct(data: dict) -> object:
2019-08-29 18:23:29 +02:00
with bpy.data.libraries.load(filepath=data["filepath"], link=True) as (sourceData, targetData):
targetData = sourceData
return sourceData
def load(self, data, target):
2019-08-29 18:23:29 +02:00
pass
def dump(self, instance=None):
assert(instance)
2020-04-01 11:34:24 +02:00
dumper = Dumper()
return dumper.dump(instance)
2020-03-09 15:59:30 +01:00
2020-03-11 15:17:13 +01:00