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

63 lines
1.8 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 #####
2020-12-02 18:13:11 +01:00
import bpy
2021-04-21 11:10:24 +02:00
from replication.protocol import ReplicatedDatablock
2020-03-20 14:56:50 +01:00
__all__ = [
'bl_object',
2019-08-08 16:29:16 +02:00
'bl_mesh',
# 'bl_camera',
'bl_collection',
# 'bl_curve',
# 'bl_gpencil',
# 'bl_image',
# 'bl_light',
'bl_scene',
'bl_material',
2021-04-20 09:53:59 +02:00
# 'bl_library',
# 'bl_armature',
# 'bl_action',
# 'bl_world',
# 'bl_metaball',
# 'bl_lattice',
# 'bl_lightprobe',
# 'bl_speaker',
# 'bl_font',
# 'bl_sound',
# 'bl_file',
2021-01-28 23:59:19 +01:00
# 'bl_sequencer',
2021-04-20 09:53:59 +02:00
# 'bl_node_group',
# 'bl_texture',
# "bl_particle",
] # Order here defines execution order
# if bpy.app.version[1] >= 91:
# __all__.append('bl_volume')
2020-12-02 18:13:11 +01:00
from replication.protocol import DataTranslationProtocol
2021-04-21 11:10:24 +02:00
def get_data_translation_protocol()-> DataTranslationProtocol:
""" Return a data translation protocol from implemented bpy types
"""
bpy_protocol = DataTranslationProtocol()
for module_name in __all__:
impl = globals().get(module_name)
if impl and hasattr(impl, "_type") and hasattr(impl, "_type"):
bpy_protocol.register_implementation(impl._type, impl._class)
return bpy_protocol