From 61050f75b13ef706d3a80b86137436d3fb0bfa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Sat, 6 Aug 2016 06:20:37 +0200 Subject: Basic Alembic support All in all, this patch adds an Alembic importer, an Alembic exporter, and a new CacheFile data block which, for now, wraps around an Alembic archive. This data block is made available through a new modifier ("Mesh Sequence Cache") as well as a new constraint ("Transform Cache") to somewhat properly support respectively geometric and transformation data streaming from alembic caches. A more in-depth documentation is to be found on the wiki, as well as a guide to compile alembic: https://wiki.blender.org/index.php/ User:Kevindietrich/AlembicBasicIo. Many thanks to everyone involved in this little project, and huge shout out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the custom builds and compile fixes. Reviewers: sergey, campbellbarton, mont29 Reviewed By: sergey, campbellbarton, mont29 Differential Revision: https://developer.blender.org/D2060 --- release/scripts/modules/sys_info.py | 7 +++++++ .../scripts/startup/bl_ui/properties_constraint.py | 13 +++++++++++++ .../scripts/startup/bl_ui/properties_data_modifier.py | 19 +++++++++++++++++++ release/scripts/startup/bl_ui/space_info.py | 4 ++++ 4 files changed, 43 insertions(+) (limited to 'release/scripts') diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index b225325ba27..30b9cdfaf37 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -158,6 +158,13 @@ def write_sysinfo(filepath): else: output.write("Blender was built without OpenVDB support\n") + alembic = bpy.app.alembic + output.write("Alembic: ") + if alembic.supported: + output.write("%s\n" % alembic.version_string) + else: + output.write("Blender was built without Alembic support\n") + if not bpy.app.build_options.sdl: output.write("SDL: Blender was built without SDL support\n") diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 4ca2f773dcc..cb5f1595ff3 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -880,6 +880,19 @@ class ConstraintButtonsPanel: layout.operator("clip.constraint_to_fcurve") + def TRANSFORM_CACHE(self, context, layout, con): + layout.label(text="Cache File Properties:") + box = layout.box() + box.template_cache_file(con, "cache_file") + + cache_file = con.cache_file + + layout.label(text="Constraint Properties:") + box = layout.box() + + if cache_file is not None: + box.prop_search(con, "object_path", cache_file, "object_paths") + def SCRIPT(self, context, layout, con): layout.label("Blender 2.6 doesn't support python constraints yet") diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index de3e98611d7..50221d57b49 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -181,6 +181,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "cache_format") layout.prop(md, "filepath") + if md.cache_format == 'ABC': + layout.prop(md, "sub_object") + layout.label(text="Evaluation:") layout.prop(md, "factor", slider=True) layout.prop(md, "deform_mode") @@ -215,6 +218,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): row = split.row() row.prop(md, "flip_axis") + def MESH_SEQUENCE_CACHE(self, layout, ob, md): + layout.label(text="Cache File Properties:") + box = layout.box() + box.template_cache_file(md, "cache_file") + + cache_file = md.cache_file + + layout.label(text="Modifier Properties:") + box = layout.box() + + if cache_file is not None: + box.prop_search(md, "object_path", cache_file, "object_paths") + + if ob.type == 'MESH': + box.row().prop(md, "read_data") + def CAST(self, layout, ob, md): split = layout.split(percentage=0.25) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 97ef37fa5e0..780dc4cf982 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -158,6 +158,8 @@ class INFO_MT_file_import(Menu): def draw(self, context): if bpy.app.build_options.collada: self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)") + if bpy.app.build_options.alembic: + self.layout.operator("wm.alembic_import", text="Alembic (.abc)") class INFO_MT_file_export(Menu): @@ -167,6 +169,8 @@ class INFO_MT_file_export(Menu): def draw(self, context): if bpy.app.build_options.collada: self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)") + if bpy.app.build_options.alembic: + self.layout.operator("wm.alembic_export", text="Alembic (.abc)") class INFO_MT_file_external_data(Menu): -- cgit v1.2.3