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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-09-26 18:19:03 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-26 18:19:03 +0300
commit8cff9c20fff954cb0aa725c15c064c3aecf322b5 (patch)
tree99bd6e859bcfbe56f555bfe2d1e4eae374fdf1c3 /source/blender/alembic
parent628ef78e8a9db7ba37cfc1bbb6b2d4ac0dbecab3 (diff)
parentb23ffded0866b5b24cb50fca669efde4ec1e3ffd (diff)
Merge branch 'master' into blender2.8
WARNING! Full build is broken, alembic has not been merged in correctly and has some references to particle stuff. Don't have time to tackle this now (and probably would be better if someone knowing what he's doing does it anyway). Conflicts: release/scripts/startup/bl_ui/properties_particle.py source/blender/blenkernel/intern/library_remap.c source/blender/blenkernel/intern/smoke.c source/blender/editors/physics/particle_object.c source/blender/editors/physics/physics_intern.h source/blender/editors/physics/physics_ops.c source/blender/editors/space_outliner/outliner_intern.h source/blender/editors/space_view3d/drawvolume.c source/blender/makesrna/intern/rna_smoke.c
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc2
-rw-r--r--source/blender/alembic/intern/abc_mesh.cc42
-rw-r--r--source/blender/alembic/intern/abc_mesh.h4
3 files changed, 11 insertions, 37 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index db41d5e837c..5e66d6c2dc7 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -86,10 +86,10 @@ ExportSettings::ExportSettings()
, export_child_hairs(true)
, export_ogawa(true)
, pack_uv(false)
- , do_convert_axis(false)
, triangulate(false)
, quad_method(0)
, ngon_method(0)
+ , do_convert_axis(false)
{}
static bool object_is_smoke_sim(Object *ob)
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 5977a072ccd..22a4c0ff7f8 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -146,19 +146,6 @@ static void get_topology(DerivedMesh *dm,
}
}
-static void get_material_indices(DerivedMesh *dm, std::vector<int32_t> &indices)
-{
- indices.clear();
- indices.reserve(dm->getNumTessFaces(dm));
-
- MPoly *mpolys = dm->getPolyArray(dm);
-
- for (int i = 1, e = dm->getNumPolys(dm); i < e; ++i) {
- MPoly *mpoly = &mpolys[i];
- indices.push_back(mpoly->mat_nr);
- }
-}
-
static void get_creases(DerivedMesh *dm,
std::vector<int32_t> &indices,
std::vector<int32_t> &lengths,
@@ -309,7 +296,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 +392,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 +461,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 +499,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 +573,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)
@@ -873,7 +846,10 @@ static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
const P3fArraySamplePtr &positions = mesh_data.positions;
const N3fArraySamplePtr &normals = mesh_data.vertex_normals;
- if (config.weight != 0.0f && mesh_data.ceil_positions) {
+ if ( config.weight != 0.0f
+ && mesh_data.ceil_positions != NULL
+ && mesh_data.ceil_positions->size() == positions->size())
+ {
read_mverts_interp(mverts, positions, mesh_data.ceil_positions, config.weight);
return;
}
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);
};
/* ************************************************************************** */