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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2016-09-23 20:44:51 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2016-09-23 20:45:33 +0300
commitc3b754f9bdd379acee1a5d6042b8d46cde4b18ad (patch)
treedce35f4e8b6a6dcdca715f956560a187cec472ca /source/blender/alembic
parent4e3578f47082c3b28be4b0065fc97e4916046d8f (diff)
Alembic: only export face sets when required by the user.
Also remove deprecated face set code.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_mesh.cc24
-rw-r--r--source/blender/alembic/intern/abc_mesh.h4
2 files changed, 6 insertions, 22 deletions
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 5a6058771c2..00c86779960 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -309,7 +309,6 @@ AbcMeshWriter::AbcMeshWriter(Scene *scene,
{
m_is_animated = isAnimated();
m_subsurf_mod = NULL;
- m_has_per_face_materials = false;
m_is_subd = false;
/* If the object is static, use the default static time sampling. */
@@ -406,8 +405,8 @@ void AbcMeshWriter::writeMesh(DerivedMesh *dm)
get_vertices(dm, points);
get_topology(dm, poly_verts, loop_counts, smooth_normal);
- if (m_first_frame) {
- writeCommonData(dm, m_mesh_schema);
+ if (m_first_frame && m_settings.export_face_sets) {
+ writeFaceSets(dm, m_mesh_schema);
}
m_mesh_sample = OPolyMeshSchema::Sample(V3fArraySample(points),
@@ -475,9 +474,8 @@ void AbcMeshWriter::writeSubD(DerivedMesh *dm)
get_topology(dm, poly_verts, loop_counts, smooth_normal);
get_creases(dm, crease_indices, crease_lengths, crease_sharpness);
- if (m_first_frame) {
- /* create materials' face_sets */
- writeCommonData(dm, m_subdiv_schema);
+ if (m_first_frame && m_settings.export_face_sets) {
+ writeFaceSets(dm, m_subdiv_schema);
}
m_subdiv_sample = OSubDSchema::Sample(V3fArraySample(points),
@@ -514,7 +512,7 @@ void AbcMeshWriter::writeSubD(DerivedMesh *dm)
}
template <typename Schema>
-void AbcMeshWriter::writeCommonData(DerivedMesh *dm, Schema &schema)
+void AbcMeshWriter::writeFaceSets(DerivedMesh *dm, Schema &schema)
{
std::map< std::string, std::vector<int32_t> > geo_groups;
getGeoGroups(dm, geo_groups);
@@ -588,18 +586,6 @@ void AbcMeshWriter::writeArbGeoParams(DerivedMesh *dm)
write_custom_data(m_mesh_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPCOL);
}
}
-
- if (m_first_frame && m_has_per_face_materials) {
- std::vector<int32_t> material_indices;
-
- if (m_settings.export_face_sets) {
- get_material_indices(dm, material_indices);
-
- OFaceSetSchema::Sample samp;
- samp.setFaces(Int32ArraySample(material_indices));
- m_face_set.getSchema().set(samp);
- }
- }
}
void AbcMeshWriter::getVelocities(DerivedMesh *dm, std::vector<Imath::V3f> &vels)
diff --git a/source/blender/alembic/intern/abc_mesh.h b/source/blender/alembic/intern/abc_mesh.h
index 9dc222e5206..41abe78f75f 100644
--- a/source/blender/alembic/intern/abc_mesh.h
+++ b/source/blender/alembic/intern/abc_mesh.h
@@ -39,8 +39,6 @@ class AbcMeshWriter : public AbcObjectWriter {
Alembic::AbcGeom::OSubDSchema m_subdiv_schema;
Alembic::AbcGeom::OSubDSchema::Sample m_subdiv_sample;
- bool m_has_per_face_materials;
- Alembic::AbcGeom::OFaceSet m_face_set;
Alembic::Abc::OArrayProperty m_mat_indices;
bool m_is_animated;
@@ -87,7 +85,7 @@ private:
void getVelocities(DerivedMesh *dm, std::vector<Imath::V3f> &vels);
template <typename Schema>
- void writeCommonData(DerivedMesh *dm, Schema &schema);
+ void writeFaceSets(DerivedMesh *dm, Schema &schema);
};
/* ************************************************************************** */