2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2016 Kévin Dietrich.
19 * All rights reserved.
21 * ***** END GPL LICENSE BLOCK *****
25 #ifndef __ABC_CUSTOMDATA_H__
26 #define __ABC_CUSTOMDATA_H__
28 #include <Alembic/Abc/All.h>
29 #include <Alembic/AbcGeom/All.h>
37 using Alembic::Abc::ICompoundProperty;
38 using Alembic::Abc::OCompoundProperty;
41 std::vector<Imath::V2f> uvs;
42 std::vector<uint32_t> indices;
45 struct CDStreamConfig {
61 /* TODO(kevin): might need a better way to handle adding and/or updating
62 * custom datas such that it updates the custom data holder and its pointers
65 void *(*add_customdata_cb)(void *user_data, const char *name, int data_type);
69 Alembic::AbcGeom::index_t index;
70 Alembic::AbcGeom::index_t ceil_index;
80 , add_customdata_cb(NULL)
88 /* Get the UVs for the main UV property on a OSchema.
89 * Returns the name of the UV layer.
91 * For now the active layer is used, maybe needs a better way to choose this. */
92 const char *get_uv_sample(UVSample &sample, const CDStreamConfig &config, CustomData *data);
94 void write_custom_data(const OCompoundProperty &prop,
95 const CDStreamConfig &config,
99 void read_custom_data(const ICompoundProperty &prop,
100 const CDStreamConfig &config,
101 const Alembic::Abc::ISampleSelector &iss);
103 #endif /* __ABC_CUSTOMDATA_H__ */