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
2016-08-06 06:20:37 +02:00
|
|
|
/*
|
|
|
|
|
* 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 2
|
|
|
|
|
* 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, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 11:23:17 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup balembic
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-17 11:47:13 +01:00
|
|
|
#include "abc_reader_nurbs.h"
|
2020-05-08 09:52:22 +02:00
|
|
|
#include "abc_axis_conversion.h"
|
2020-02-17 11:47:13 +01:00
|
|
|
#include "abc_reader_transform.h"
|
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
2016-08-06 06:20:37 +02:00
|
|
|
#include "abc_util.h"
|
|
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_curve_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_listbase.h"
|
|
|
|
|
#include "BLI_string.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_curve.h"
|
|
|
|
|
#include "BKE_object.h"
|
|
|
|
|
|
|
|
|
|
using Alembic::AbcGeom::FloatArraySamplePtr;
|
|
|
|
|
using Alembic::AbcGeom::kWrapExisting;
|
|
|
|
|
using Alembic::AbcGeom::MetaData;
|
|
|
|
|
using Alembic::AbcGeom::P3fArraySamplePtr;
|
|
|
|
|
|
|
|
|
|
using Alembic::AbcGeom::ICompoundProperty;
|
|
|
|
|
using Alembic::AbcGeom::INuPatch;
|
|
|
|
|
using Alembic::AbcGeom::INuPatchSchema;
|
|
|
|
|
using Alembic::AbcGeom::IObject;
|
|
|
|
|
|
2020-09-08 16:57:58 +02:00
|
|
|
namespace blender::io::alembic {
|
2020-06-19 14:31:04 +02:00
|
|
|
|
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
2016-08-06 06:20:37 +02:00
|
|
|
AbcNurbsReader::AbcNurbsReader(const IObject &object, ImportSettings &settings)
|
|
|
|
|
: AbcObjectReader(object, settings)
|
|
|
|
|
{
|
|
|
|
|
getNurbsPatches(m_iobject);
|
2016-08-17 22:20:15 +02:00
|
|
|
get_min_max_time(m_iobject, m_schemas[0].first, m_min_time, m_max_time);
|
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
2016-08-06 06:20:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool AbcNurbsReader::valid() const
|
|
|
|
|
{
|
|
|
|
|
if (m_schemas.empty()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-15 18:50:24 +01:00
|
|
|
std::vector<std::pair<INuPatchSchema, IObject>>::const_iterator it;
|
2019-09-08 03:31:49 +10:00
|
|
|
for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
|
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
2016-08-06 06:20:37 +02:00
|
|
|
const INuPatchSchema &schema = it->first;
|
|
|
|
|
|
|
|
|
|
if (!schema.valid()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool set_knots(const FloatArraySamplePtr &knots, float *&nu_knots)
|
|
|
|
|
{
|
2020-05-18 11:09:48 +02:00
|
|
|
if (!knots || knots->size() < 2) {
|
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
2016-08-06 06:20:37 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Skip first and last knots, as they are used for padding. */
|
|
|
|
|
const size_t num_knots = knots->size() - 2;
|
|
|
|
|
nu_knots = static_cast<float *>(MEM_callocN(num_knots * sizeof(float), "abc_setsplineknotsu"));
|
|
|
|
|
|
2019-09-08 00:12:26 +10:00
|
|
|
for (size_t i = 0; i < num_knots; i++) {
|
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
2016-08-06 06:20:37 +02:00
|
|
|
nu_knots[i] = (*knots)[i + 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-26 16:56:50 +02:00
|
|
|
void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
|
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
2016-08-06 06:20:37 +02:00
|
|
|
{
|
|
|
|
|
Curve *cu = static_cast<Curve *>(BKE_curve_add(bmain, "abc_curve", OB_SURF));
|
|
|
|
|
cu->actvert = CU_ACT_NONE;
|
|
|
|
|
|
|
|
|
|
std::vector<std::pair<INuPatchSchema, IObject>>::iterator it;
|
|
|
|
|
|
2019-09-08 03:31:49 +10:00
|
|
|
for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
|
2018-06-07 18:34:05 +02:00
|
|
|
Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb"));
|
|
|
|
|
nu->flag = CU_SMOOTH;
|
|
|
|
|
nu->type = CU_NURBS;
|
2019-03-15 08:53:22 +11:00
|
|
|
nu->resolu = cu->resolu;
|
2018-06-07 18:34:05 +02:00
|
|
|
nu->resolv = cu->resolv;
|
|
|
|
|
|
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
2016-08-06 06:20:37 +02:00
|
|
|
const INuPatchSchema &schema = it->first;
|
2018-06-07 18:34:05 +02:00
|
|
|
INuPatchSchema::Sample smp;
|
2019-04-17 06:17:24 +02:00
|
|
|
try {
|
2018-06-07 18:34:05 +02:00
|
|
|
smp = schema.getValue(sample_sel);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2018-06-07 18:34:05 +02:00
|
|
|
catch (Alembic::Util::Exception &ex) {
|
|
|
|
|
printf("Alembic: error reading nurbs sample for '%s/%s' at time %f: %s\n",
|
2019-03-15 08:53:22 +11:00
|
|
|
m_iobject.getFullName().c_str(),
|
|
|
|
|
schema.getName().c_str(),
|
|
|
|
|
sample_sel.getRequestedTime(),
|
|
|
|
|
ex.what());
|
2019-04-17 06:17:24 +02:00
|
|
|
return;
|
|
|
|
|
}
|
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
2016-08-06 06:20:37 +02:00
|
|
|
|
|
|
|
|
nu->orderu = smp.getUOrder() - 1;
|
|
|
|
|
nu->orderv = smp.getVOrder() - 1;
|
|
|
|
|
nu->pntsu = smp.getNumU();
|
|
|
|
|
nu->pntsv = smp.getNumV();
|
|
|
|
|
|
|
|
|
|
/* Read positions and weights. */
|
|
|
|
|
|
|
|
|
|
const P3fArraySamplePtr positions = smp.getPositions();
|
|
|
|
|
const FloatArraySamplePtr weights = smp.getPositionWeights();
|
|
|
|
|
|
|
|
|
|
const size_t num_points = positions->size();
|
|
|
|
|
|
|
|
|
|
nu->bp = static_cast<BPoint *>(MEM_callocN(num_points * sizeof(BPoint), "abc_setsplinetype"));
|
|
|
|
|
|
|
|
|
|
BPoint *bp = nu->bp;
|
|
|
|
|
float posw_in = 1.0f;
|
|
|
|
|
|
2019-09-08 00:12:26 +10:00
|
|
|
for (int i = 0; i < num_points; i++, bp++) {
|
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
2016-08-06 06:20:37 +02:00
|
|
|
const Imath::V3f &pos_in = (*positions)[i];
|
|
|
|
|
|
|
|
|
|
if (weights) {
|
|
|
|
|
posw_in = (*weights)[i];
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-03 15:54:59 +01:00
|
|
|
copy_zup_from_yup(bp->vec, pos_in.getValue());
|
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
2016-08-06 06:20:37 +02:00
|
|
|
bp->vec[3] = posw_in;
|
|
|
|
|
bp->f1 = SELECT;
|
|
|
|
|
bp->radius = 1.0f;
|
|
|
|
|
bp->weight = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read knots. */
|
|
|
|
|
|
|
|
|
|
if (!set_knots(smp.getUKnot(), nu->knotsu)) {
|
|
|
|
|
BKE_nurb_knot_calc_u(nu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!set_knots(smp.getVKnot(), nu->knotsv)) {
|
|
|
|
|
BKE_nurb_knot_calc_v(nu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read flags. */
|
|
|
|
|
|
|
|
|
|
ICompoundProperty user_props = schema.getUserProperties();
|
|
|
|
|
|
|
|
|
|
if (has_property(user_props, "enpoint_u")) {
|
|
|
|
|
nu->flagu |= CU_NURB_ENDPOINT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (has_property(user_props, "enpoint_v")) {
|
|
|
|
|
nu->flagv |= CU_NURB_ENDPOINT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (has_property(user_props, "cyclic_u")) {
|
|
|
|
|
nu->flagu |= CU_NURB_CYCLIC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (has_property(user_props, "cyclic_v")) {
|
|
|
|
|
nu->flagv |= CU_NURB_CYCLIC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLI_addtail(BKE_curve_nurbs_get(cu), nu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLI_strncpy(cu->id.name + 2, m_data_name.c_str(), m_data_name.size() + 1);
|
|
|
|
|
|
|
|
|
|
m_object = BKE_object_add_only_object(bmain, OB_SURF, m_object_name.c_str());
|
|
|
|
|
m_object->data = cu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AbcNurbsReader::getNurbsPatches(const IObject &obj)
|
|
|
|
|
{
|
|
|
|
|
if (!obj.valid()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int num_children = obj.getNumChildren();
|
|
|
|
|
|
|
|
|
|
if (num_children == 0) {
|
|
|
|
|
INuPatch abc_nurb(obj, kWrapExisting);
|
|
|
|
|
INuPatchSchema schem = abc_nurb.getSchema();
|
2020-11-06 14:06:52 +01:00
|
|
|
m_schemas.emplace_back(schem, obj);
|
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
2016-08-06 06:20:37 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-08 00:12:26 +10:00
|
|
|
for (int i = 0; i < num_children; i++) {
|
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
2016-08-06 06:20:37 +02:00
|
|
|
bool ok = true;
|
|
|
|
|
IObject child(obj, obj.getChildHeader(i).getName());
|
|
|
|
|
|
|
|
|
|
if (!m_name.empty() && child.valid() && !begins_with(child.getFullName(), m_name)) {
|
|
|
|
|
ok = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!child.valid()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MetaData &md = child.getMetaData();
|
|
|
|
|
|
|
|
|
|
if (INuPatch::matches(md) && ok) {
|
|
|
|
|
INuPatch abc_nurb(child, kWrapExisting);
|
|
|
|
|
INuPatchSchema schem = abc_nurb.getSchema();
|
2020-11-06 14:06:52 +01:00
|
|
|
m_schemas.emplace_back(schem, child);
|
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
2016-08-06 06:20:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getNurbsPatches(child);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-19 14:31:04 +02:00
|
|
|
|
2020-09-08 16:57:58 +02:00
|
|
|
} // namespace blender::io::alembic
|