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
|
|
|
|
|
2020-04-01 11:37:05 +02:00
|
|
|
from .dump_anything import Loader, Dumper
|
2019-08-29 18:23:29 +02:00
|
|
|
from .bl_datablock import BlDatablock
|
|
|
|
|
|
|
|
|
|
|
|
class BlLibrary(BlDatablock):
|
2020-01-13 18:51:31 +01:00
|
|
|
bl_id = "libraries"
|
|
|
|
bl_class = bpy.types.Library
|
2020-09-17 22:47:11 +02:00
|
|
|
bl_check_common = False
|
2020-01-13 18:51:31 +01:00
|
|
|
bl_icon = 'LIBRARY_DATA_DIRECT'
|
2020-12-09 14:49:26 +01:00
|
|
|
bl_reload_parent = False
|
2020-01-13 18:51:31 +01:00
|
|
|
|
2021-03-26 12:30:15 +01:00
|
|
|
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
|
2021-03-24 16:08:12 +01:00
|
|
|
def load(self, data, target):
|
2019-08-29 18:23:29 +02:00
|
|
|
pass
|
|
|
|
|
2021-03-24 16:08:12 +01:00
|
|
|
def dump(self, instance=None):
|
2020-04-07 14:49:43 +02:00
|
|
|
assert(instance)
|
2020-04-01 11:34:24 +02:00
|
|
|
dumper = Dumper()
|
2020-04-07 14:49:43 +02:00
|
|
|
return dumper.dump(instance)
|
2020-03-09 15:59:30 +01:00
|
|
|
|
2020-03-11 15:17:13 +01:00
|
|
|
|