Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-06-03 13:11:15 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-06-03 13:11:15 +0300
commit44276743cfb31996f90a19c6d98839bea3cc1ce4 (patch)
treef4dc2ac62399d4b2754fbde1cee522b6b705761b
parent08667e616f560f9d89d7f75c940a6a5ba22469d6 (diff)
parentd3923677821c32d0e67934969ebb698c07f17f51 (diff)
Merge branch 'alembic' into gooseberry
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py29
-rw-r--r--source/blender/blenkernel/BKE_cache_library.h3
-rw-r--r--source/blender/blenkernel/intern/cache_library.c33
-rw-r--r--source/blender/editors/io/io_cache_library.c20
-rw-r--r--source/blender/pointcache/PTC_api.cpp8
-rw-r--r--source/blender/pointcache/PTC_api.h5
-rw-r--r--source/blender/pointcache/alembic/abc_info.cpp99
-rw-r--r--source/blender/pointcache/alembic/abc_reader.cpp6
-rw-r--r--source/blender/pointcache/alembic/abc_reader.h2
-rw-r--r--source/blender/pointcache/alembic/abc_writer.cpp26
-rw-r--r--source/blender/pointcache/alembic/abc_writer.h2
-rw-r--r--source/blender/pointcache/alembic/alembic.cpp4
-rw-r--r--source/blender/pointcache/alembic/alembic.h9
-rw-r--r--source/blender/pointcache/intern/ptc_types.h3
-rw-r--r--source/blender/pointcache/intern/reader.h3
15 files changed, 198 insertions, 54 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 9d5d2623bcf..cba1454086c 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -268,6 +268,13 @@ bpy.types.CacheLibrary.filter_string = \
name="Filter Object Name",
description="Filter cache library objects by name",
)
+bpy.types.CacheLibrary.show_metadata = \
+ bpy.props.BoolProperty(
+ name="Show Metadata",
+ description="Show metadata for the input archive",
+ default=False,
+ )
+
def cachelib_objects(cachelib, group):
if not cachelib or not group:
@@ -448,13 +455,20 @@ class CacheArchiveInfoPanel():
for child in node.child_nodes:
self.draw_node_info(context, layout, child, column)
- def draw_info(self, context, layout, info):
- layout.prop(info, "filepath", text="File")
+ def draw_info(self, context, layout, info, metadata=None):
row = layout.row(align=True)
row.label("Created by: {} | {}".format(info.app_name if info.app_name else "-", info.date_written if info.date_written else "-"))
if info.description:
layout.label(info.description)
+ if metadata:
+ row = layout.row(align=True)
+ col_key = row.column()
+ col_value = row.column()
+ for key, value in metadata.items():
+ col_key.label(key)
+ col_value.label(str(value))
+
if info.root_node:
row = layout.row()
@@ -496,8 +510,9 @@ class OBJECT_PT_cache_library(CacheArchiveInfoPanel, ObjectButtonsPanel, Panel):
row = box.row(align=True)
row.enabled = (cachelib.source_mode == 'CACHE')
row.prop(cachelib, "input_filepath", text="")
- if cachelib.archive_info:
- self.draw_info(context, box, cachelib.archive_info)
+ row.prop(cachelib, "show_metadata", text="", icon='QUESTION', toggle=True)
+ if cachelib.show_metadata and cachelib.archive_info:
+ self.draw_info(context, box, cachelib.archive_info, cachelib['input_metadata'])
layout.separator()
@@ -514,11 +529,6 @@ class OBJECT_PT_cache_library(CacheArchiveInfoPanel, ObjectButtonsPanel, Panel):
row = layout.row(align=True)
row.enabled = (cachelib.display_mode == 'RESULT')
row.prop(cachelib, "output_filepath", text="")
- props = row.operator("cachelibrary.archive_info", text="", icon='QUESTION')
- props.filepath = cachelib.output_filepath
- props.use_stdout = True
- props.use_popup = True
- props.use_clipboard = True
box = layout.box()
row = box.row()
@@ -805,6 +815,7 @@ class OBJECT_PT_cache_archive_info(CacheArchiveInfoPanel, ObjectButtonsPanel, Pa
layout.separator()
+ layout.prop(info, "filepath", text="File")
self.draw_info(context, layout, info)
diff --git a/source/blender/blenkernel/BKE_cache_library.h b/source/blender/blenkernel/BKE_cache_library.h
index 88eb7e986c4..62ec261f123 100644
--- a/source/blender/blenkernel/BKE_cache_library.h
+++ b/source/blender/blenkernel/BKE_cache_library.h
@@ -69,6 +69,9 @@ eCacheReadSampleResult BKE_cache_read_result(int ptc_result);
bool BKE_cache_library_validate_item(struct CacheLibrary *cachelib, struct Object *ob, int type, int index);
+struct IDProperty *BKE_cache_library_get_input_metadata(struct CacheLibrary *cachelib, bool create);
+struct IDProperty *BKE_cache_library_get_output_metadata(struct CacheLibrary *cachelib, bool create);
+
/* ========================================================================= */
void BKE_cache_library_get_read_flags(struct CacheLibrary *cachelib, bool use_render, bool for_display, bool *read_strands_motion, bool *read_strands_children);
diff --git a/source/blender/blenkernel/intern/cache_library.c b/source/blender/blenkernel/intern/cache_library.c
index 37cc45d7f9e..370a2fc1887 100644
--- a/source/blender/blenkernel/intern/cache_library.c
+++ b/source/blender/blenkernel/intern/cache_library.c
@@ -61,6 +61,7 @@
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_group.h"
+#include "BKE_idprop.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -271,6 +272,32 @@ void BKE_cache_library_tag_used_objects(CacheLibrary *cachelib)
/* ========================================================================= */
+static IDProperty *cache_library_get_metadata(CacheLibrary *cachelib, const char *name, bool create)
+{
+ IDProperty *idprops = IDP_GetProperties((ID *)cachelib, create);
+ IDProperty *metadata = NULL;
+ if (idprops) {
+ metadata = IDP_GetPropertyFromGroup(idprops, name);
+ if (!metadata && create) {
+ IDPropertyTemplate val;
+ val.i = 0;
+ metadata = IDP_New(IDP_GROUP, &val, name);
+ IDP_AddToGroup(idprops, metadata);
+ }
+ }
+ return metadata;
+}
+
+IDProperty *BKE_cache_library_get_input_metadata(CacheLibrary *cachelib, bool create)
+{
+ return cache_library_get_metadata(cachelib, "input_metadata", create);
+}
+
+IDProperty *BKE_cache_library_get_output_metadata(CacheLibrary *cachelib, bool create)
+{
+ return cache_library_get_metadata(cachelib, "output_metadata", create);
+}
+
BLI_INLINE bool path_is_dirpath(const char *path)
{
/* last char is a slash? */
@@ -377,8 +404,10 @@ static struct PTCReaderArchive *find_active_cache(Scene *scene, CacheLibrary *ca
else
cachelib->archive_info = BKE_cache_archive_info_new();
BLI_strncpy(cachelib->archive_info->filepath, filename, sizeof(cachelib->archive_info->filepath));
- if (archive)
- PTC_get_archive_info(archive, cachelib->archive_info);
+ if (archive) {
+ IDProperty *metadata = BKE_cache_library_get_input_metadata(cachelib, true);
+ PTC_get_archive_info(archive, cachelib->archive_info, metadata);
+ }
return archive;
}
diff --git a/source/blender/editors/io/io_cache_library.c b/source/blender/editors/io/io_cache_library.c
index def99d0a175..f7076ae0cae 100644
--- a/source/blender/editors/io/io_cache_library.c
+++ b/source/blender/editors/io/io_cache_library.c
@@ -368,6 +368,7 @@ static void cache_library_bake_start(void *customdata, short *stop, short *do_up
Scene *scene = data->scene;
char filename[FILE_MAX];
char app_name[MAX_NAME];
+ IDProperty *metadata;
data->stop = stop;
data->do_update = do_update;
@@ -379,7 +380,10 @@ static void cache_library_bake_start(void *customdata, short *stop, short *do_up
BKE_cache_archive_output_path(data->cachelib, filename, sizeof(filename));
BLI_snprintf(app_name, sizeof(app_name), "Blender %s", versionstr);
- data->archive = PTC_open_writer_archive(FPS, data->start_frame, filename, archive_res, app_name, data->cachelib->description, NULL);
+
+ metadata = BKE_cache_library_get_output_metadata(data->cachelib, false);
+
+ data->archive = PTC_open_writer_archive(FPS, data->start_frame, filename, archive_res, app_name, data->cachelib->description, NULL, metadata);
if (data->archive) {
@@ -629,6 +633,7 @@ static int cache_library_archive_slice_exec(bContext *C, wmOperator *op)
struct PTCWriterArchive *output_archive;
PTCArchiveResolution archive_res;
CacheArchiveInfo info;
+ IDProperty *metadata;
RNA_string_get(op->ptr, "input_filepath", input_filepath);
if (input_filepath[0] == '\0')
@@ -650,9 +655,18 @@ static int cache_library_archive_slice_exec(bContext *C, wmOperator *op)
}
archive_res = PTC_reader_archive_get_resolutions(input_archive);
- PTC_get_archive_info(input_archive, &info);
+ {
+ IDPropertyTemplate val;
+ val.i = 0;
+ metadata = IDP_New(IDP_GROUP, &val, "cache input metadata");
+ }
+ PTC_get_archive_info(input_archive, &info, metadata);
+
+ output_archive = PTC_open_writer_archive(FPS, start_frame, output_filename, archive_res, info.app_name, info.description, NULL, metadata);
+
+ IDP_FreeProperty(metadata);
+ MEM_freeN(metadata);
- output_archive = PTC_open_writer_archive(FPS, start_frame, output_filename, archive_res, info.app_name, info.description, NULL);
if (!output_archive) {
BKE_reportf(op->reports, RPT_ERROR, "Cannot write to cache file at '%s'", output_filepath);
return OPERATOR_CANCELLED;
diff --git a/source/blender/pointcache/PTC_api.cpp b/source/blender/pointcache/PTC_api.cpp
index 4aecf557b34..6f4f6da3e63 100644
--- a/source/blender/pointcache/PTC_api.cpp
+++ b/source/blender/pointcache/PTC_api.cpp
@@ -131,9 +131,9 @@ const char *PTC_get_default_archive_extension(void)
}
PTCWriterArchive *PTC_open_writer_archive(double fps, float start_frame, const char *path, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time)
+ const char *app_name, const char *description, const struct tm *time, struct IDProperty *metadata)
{
- return (PTCWriterArchive *)PTC::Factory::alembic->open_writer_archive(fps, start_frame, path, resolutions, app_name, description, time, NULL);
+ return (PTCWriterArchive *)PTC::Factory::alembic->open_writer_archive(fps, start_frame, path, resolutions, app_name, description, time, metadata, NULL);
}
void PTC_close_writer_archive(PTCWriterArchive *_archive)
@@ -251,10 +251,10 @@ void PTC_get_archive_info_stream(PTCReaderArchive *_archive, void (*stream)(void
archive->get_info_stream(stream, userdata);
}
-void PTC_get_archive_info(PTCReaderArchive *_archive, struct CacheArchiveInfo *info)
+void PTC_get_archive_info(PTCReaderArchive *_archive, struct CacheArchiveInfo *info, IDProperty *metadata)
{
PTC::ReaderArchive *archive = (PTC::ReaderArchive *)_archive;
- archive->get_info(info);
+ archive->get_info(info, metadata);
}
void PTC_get_archive_info_nodes(PTCReaderArchive *_archive, struct CacheArchiveInfo *info, bool calc_bytes_size)
diff --git a/source/blender/pointcache/PTC_api.h b/source/blender/pointcache/PTC_api.h
index e00739e58c9..1795d2b68c6 100644
--- a/source/blender/pointcache/PTC_api.h
+++ b/source/blender/pointcache/PTC_api.h
@@ -39,6 +39,7 @@ struct DupliCache;
struct ClothModifierData;
struct DerivedMesh;
struct Group;
+struct IDProperty;
struct ModifierData;
struct Object;
struct ParticleSystem;
@@ -62,7 +63,7 @@ void PTC_error_handler_modifier(struct ModifierData *md);
const char *PTC_get_default_archive_extension(void);
struct PTCWriterArchive *PTC_open_writer_archive(double fps, float start_frame, const char *path, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time);
+ const char *app_name, const char *description, const struct tm *time, struct IDProperty *metadata);
void PTC_close_writer_archive(struct PTCWriterArchive *archive);
void PTC_writer_archive_use_render(struct PTCWriterArchive *archive, bool enable);
@@ -87,7 +88,7 @@ PTCReadSampleResult PTC_read_sample(struct PTCReader *reader, float frame);
PTCReadSampleResult PTC_test_sample(struct PTCReader *reader, float frame);
void PTC_get_archive_info_stream(struct PTCReaderArchive *archive, void (*stream)(void *, const char *), void *userdata);
-void PTC_get_archive_info(struct PTCReaderArchive *_archive, struct CacheArchiveInfo *info);
+void PTC_get_archive_info(struct PTCReaderArchive *_archive, struct CacheArchiveInfo *info, struct IDProperty *metadata);
void PTC_get_archive_info_nodes(struct PTCReaderArchive *_archive, struct CacheArchiveInfo *info, bool calc_bytes_size);
void PTC_archive_slice(struct PTCReaderArchive *in, struct PTCWriterArchive *out, float start_frame, float end_frame);
diff --git a/source/blender/pointcache/alembic/abc_info.cpp b/source/blender/pointcache/alembic/abc_info.cpp
index 57dbf3fc9bc..35d30cb6d0c 100644
--- a/source/blender/pointcache/alembic/abc_info.cpp
+++ b/source/blender/pointcache/alembic/abc_info.cpp
@@ -66,13 +66,107 @@ extern "C" {
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "DNA_ID.h"
+
#include "BKE_cache_library.h"
+#include "BKE_idprop.h"
}
using namespace ::Alembic::AbcGeom;
namespace PTC {
+static void metadata_from_idprops(MetaData &md, IDProperty *prop);
+
+void abc_metadata_from_idprops_group(MetaData &md, IDProperty *prop)
+{
+ if (!prop)
+ return;
+
+ IDProperty *child;
+ for (child = (IDProperty *)prop->data.group.first; child; child = child->next)
+ metadata_from_idprops(md, child);
+}
+
+static void metadata_from_idprops(MetaData &md, IDProperty *prop)
+{
+ /* skip default metadata entries, these are set explicitly */
+ std::string key(prop->name);
+ if (key.compare(kApplicationNameKey)==0 || key.compare(kDateWrittenKey)==0 || key.compare(kUserDescriptionKey)==0)
+ return;
+
+ switch (prop->type) {
+#if 0 /* don't support recursion yet */
+ case IDP_GROUP: {
+ metadata_from_idprops_group(md, child);
+ break;
+ }
+
+ case IDP_ARRAY: {
+ if (prop->data.pointer) {
+ IDProperty **array = (IDProperty **)prop->data.pointer;
+ for (int a = 0; a < prop->len; a++)
+ metadata_from_idprops(md, array[a]);
+ }
+ break;
+ }
+#endif
+
+ /* only string properties are used */
+ case IDP_STRING: {
+ md.set(prop->name, IDP_String(prop));
+ break;
+ }
+ }
+}
+
+void abc_metadata_to_idprops_group(const MetaData &md, IDProperty *prop)
+{
+ if (!prop)
+ return;
+
+ for (MetaData::const_iterator it = md.begin(); it != md.end(); ++it) {
+ const std::string &key = it->first;
+ const std::string &value = it->second;
+
+ /* skip default metadata entries, these are stored in CacheArchiveInfo */
+ if (key.compare(kApplicationNameKey)==0 || key.compare(kDateWrittenKey)==0 || key.compare(kUserDescriptionKey)==0)
+ continue;
+
+ IDPropertyTemplate val;
+ val.string.str = value.c_str();
+ val.string.len = value.length();
+ IDP_ReplaceInGroup(prop, IDP_New(IDP_STRING, &val, key.c_str()));
+ }
+}
+
+MetaData abc_create_archive_info(const char *app_name, const char *description, const struct tm *t, IDProperty *props)
+{
+ MetaData md;
+
+ md.set(kApplicationNameKey, app_name);
+ md.set(kUserDescriptionKey, description);
+
+ if (!t) {
+ time_t curtime = time(NULL);
+ t = localtime(&curtime);
+ }
+
+ if (t) {
+ char buf[256];
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", t);
+ md.set(kDateWrittenKey, buf);
+ }
+
+ /* store custom properties as metadata */
+ if (props && props->type == IDP_GROUP)
+ abc_metadata_from_idprops_group(md, props);
+
+ return md;
+}
+
+/* ========================================================================= */
+
struct stringstream {
stringstream(void (*cb)(void *, const char *), void *userdata) :
cb(cb),
@@ -388,7 +482,7 @@ static void info_nodes_object(CacheArchiveInfo *info, IObject iObj, CacheArchive
parent->bytes_size += node->bytes_size;
}
-void abc_archive_info_nodes(IArchive &archive, CacheArchiveInfo *info, bool calc_nodes, bool calc_bytes_size)
+void abc_archive_info_nodes(IArchive &archive, CacheArchiveInfo *info, IDProperty *metadata, bool calc_nodes, bool calc_bytes_size)
{
// ss << "Alembic Archive Info for "
// << Alembic::AbcCoreAbstract::GetLibraryVersion()
@@ -412,6 +506,9 @@ void abc_archive_info_nodes(IArchive &archive, CacheArchiveInfo *info, bool calc
info->description[0] = '\0';
}
+ if (metadata)
+ abc_metadata_to_idprops_group(archive.getPtr()->getMetaData(), metadata);
+
if (calc_nodes)
info_nodes_object(info, archive.getTop(), NULL, calc_bytes_size);
}
diff --git a/source/blender/pointcache/alembic/abc_reader.cpp b/source/blender/pointcache/alembic/abc_reader.cpp
index 2db4220c096..17f574af7ac 100644
--- a/source/blender/pointcache/alembic/abc_reader.cpp
+++ b/source/blender/pointcache/alembic/abc_reader.cpp
@@ -127,16 +127,16 @@ void AbcReaderArchive::get_info_stream(void (*stream)(void *, const char *), voi
abc_archive_info_stream(m_abc_archive, stream, userdata);
}
-void AbcReaderArchive::get_info(CacheArchiveInfo *info)
+void AbcReaderArchive::get_info(CacheArchiveInfo *info, IDProperty *metadata)
{
if (m_abc_archive)
- abc_archive_info_nodes(m_abc_archive, info, false, false);
+ abc_archive_info_nodes(m_abc_archive, info, metadata, false, false);
}
void AbcReaderArchive::get_info_nodes(CacheArchiveInfo *info, bool calc_bytes_size)
{
if (m_abc_archive)
- abc_archive_info_nodes(m_abc_archive, info, true, calc_bytes_size);
+ abc_archive_info_nodes(m_abc_archive, info, NULL, true, calc_bytes_size);
}
ISampleSelector AbcReaderArchive::get_frame_sample_selector(float frame)
diff --git a/source/blender/pointcache/alembic/abc_reader.h b/source/blender/pointcache/alembic/abc_reader.h
index 63d9d786d8d..86cfdd91d51 100644
--- a/source/blender/pointcache/alembic/abc_reader.h
+++ b/source/blender/pointcache/alembic/abc_reader.h
@@ -59,7 +59,7 @@ public:
Abc::ISampleSelector get_frame_sample_selector(chrono_t time);
void get_info_stream(void (*stream)(void *, const char *), void *userdata);
- void get_info(CacheArchiveInfo *info);
+ void get_info(CacheArchiveInfo *info, IDProperty *metadata);
void get_info_nodes(CacheArchiveInfo *info, bool calc_bytes_size);
protected:
diff --git a/source/blender/pointcache/alembic/abc_writer.cpp b/source/blender/pointcache/alembic/abc_writer.cpp
index 79514831c2b..a294858f2e5 100644
--- a/source/blender/pointcache/alembic/abc_writer.cpp
+++ b/source/blender/pointcache/alembic/abc_writer.cpp
@@ -21,6 +21,7 @@
#include <Alembic/Abc/OObject.h>
#include <Alembic/Abc/ArchiveInfo.h>
+#include "alembic.h"
#include "abc_writer.h"
#include "util_error_handler.h"
@@ -44,33 +45,12 @@ static void ensure_directory(const char *filename)
BLI_dir_create_recursive(dir);
}
-static MetaData create_archive_info(const char *app_name, const char *description, const struct tm *t)
-{
- MetaData md;
-
- md.set(kApplicationNameKey, app_name);
- md.set(kUserDescriptionKey, description);
-
- if (!t) {
- time_t curtime = time(NULL);
- t = localtime(&curtime);
- }
-
- if (t) {
- char buf[256];
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", t);
- md.set(kDateWrittenKey, buf);
- }
-
- return md;
-}
-
AbcWriterArchive *AbcWriterArchive::open(double fps, float start_frame, const std::string &filename, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time, ErrorHandler *error_handler)
+ const char *app_name, const char *description, const struct tm *time, IDProperty *metadata, ErrorHandler *error_handler)
{
ensure_directory(filename.c_str());
- MetaData md = create_archive_info(app_name, description, time);
+ MetaData md = abc_create_archive_info(app_name, description, time, metadata);
OArchive abc_archive;
PTC_SAFE_CALL_BEGIN
diff --git a/source/blender/pointcache/alembic/abc_writer.h b/source/blender/pointcache/alembic/abc_writer.h
index 50b46164444..60a25ff1e0a 100644
--- a/source/blender/pointcache/alembic/abc_writer.h
+++ b/source/blender/pointcache/alembic/abc_writer.h
@@ -48,7 +48,7 @@ public:
virtual ~AbcWriterArchive();
static AbcWriterArchive *open(double fps, float start_frame, const std::string &filename, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time, ErrorHandler *error_handler);
+ const char *app_name, const char *description, const struct tm *time, IDProperty *metadata, ErrorHandler *error_handler);
bool use_render() const { return m_use_render; }
void use_render(bool enable) { m_use_render = enable; }
diff --git a/source/blender/pointcache/alembic/alembic.cpp b/source/blender/pointcache/alembic/alembic.cpp
index 5b986519356..669b3a33662 100644
--- a/source/blender/pointcache/alembic/alembic.cpp
+++ b/source/blender/pointcache/alembic/alembic.cpp
@@ -40,9 +40,9 @@ class AbcFactory : public Factory {
}
WriterArchive *open_writer_archive(double fps, float start_frame, const std::string &name, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time, ErrorHandler *error_handler)
+ const char *app_name, const char *description, const struct tm *time, struct IDProperty *metadata, ErrorHandler *error_handler)
{
- return AbcWriterArchive::open(fps, start_frame, name, resolutions, app_name, description, time, error_handler);
+ return AbcWriterArchive::open(fps, start_frame, name, resolutions, app_name, description, time, metadata, error_handler);
}
ReaderArchive *open_reader_archive(double fps, float start_frame, const std::string &name, ErrorHandler *error_handler)
diff --git a/source/blender/pointcache/alembic/alembic.h b/source/blender/pointcache/alembic/alembic.h
index 6f9a693031b..c73b095933f 100644
--- a/source/blender/pointcache/alembic/alembic.h
+++ b/source/blender/pointcache/alembic/alembic.h
@@ -24,11 +24,18 @@
#include <Alembic/Abc/IArchive.h>
struct CacheArchiveInfo;
+struct IDProperty;
namespace PTC {
+using namespace Alembic;
+
+void abc_metadata_from_idprops_group(Abc::MetaData &md, IDProperty *prop);
+void abc_metadata_to_idprops_group(const Abc::MetaData &md, IDProperty *prop);
+Abc::MetaData abc_create_archive_info(const char *app_name, const char *description, const struct tm *t, struct IDProperty *props);
+
void abc_archive_info_stream(Alembic::Abc::IArchive &archive, void (*stream)(void *, const char *), void *userdata);
-void abc_archive_info_nodes(Alembic::Abc::IArchive &archive, CacheArchiveInfo *info, bool calc_nodes, bool calc_bytes_size);
+void abc_archive_info_nodes(Alembic::Abc::IArchive &archive, CacheArchiveInfo *info, IDProperty *metadata, bool calc_nodes, bool calc_bytes_size);
void abc_archive_slice(Alembic::Abc::IArchive in, Alembic::Abc::OArchive out, Alembic::Abc::TimeSamplingPtr time_sampling, Alembic::Abc::chrono_t start, Alembic::Abc::chrono_t end);
diff --git a/source/blender/pointcache/intern/ptc_types.h b/source/blender/pointcache/intern/ptc_types.h
index 0c2be73a110..c9e63d7abb6 100644
--- a/source/blender/pointcache/intern/ptc_types.h
+++ b/source/blender/pointcache/intern/ptc_types.h
@@ -31,6 +31,7 @@ extern "C" {
}
struct CacheLibrary;
+struct IDProperty;
namespace PTC {
@@ -199,7 +200,7 @@ protected:
struct Factory {
virtual const std::string &get_default_extension() = 0;
virtual WriterArchive *open_writer_archive(double fps, float start_frame, const std::string &name, PTCArchiveResolution resolutions,
- const char *app_name, const char *description, const struct tm *time, ErrorHandler *error_handler) = 0;
+ const char *app_name, const char *description, const struct tm *time, struct IDProperty *metadata, ErrorHandler *error_handler) = 0;
virtual ReaderArchive *open_reader_archive(double fps, float start_frame, const std::string &name, ErrorHandler *error_handler) = 0;
virtual void slice(ReaderArchive *in, WriterArchive *out, float start_frame, float end_frame) = 0;
diff --git a/source/blender/pointcache/intern/reader.h b/source/blender/pointcache/intern/reader.h
index 635b1ed899e..39d0ab20197 100644
--- a/source/blender/pointcache/intern/reader.h
+++ b/source/blender/pointcache/intern/reader.h
@@ -26,6 +26,7 @@
#include "PTC_api.h"
struct ID;
+struct IDProperty;
struct CacheArchiveInfo;
namespace PTC {
@@ -39,7 +40,7 @@ public:
virtual bool get_frame_range(int &start_frame, int &end_frame) = 0;
virtual void get_info_stream(void (*stream)(void *, const char *), void *userdata) = 0;
- virtual void get_info(CacheArchiveInfo *info) = 0;
+ virtual void get_info(CacheArchiveInfo *info, IDProperty *metadata) = 0;
virtual void get_info_nodes(CacheArchiveInfo *info, bool calc_bytes_size) = 0;
};