Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/alembic/intern/abc_reader_mesh.cc
| Show First 20 Lines • Show All 613 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str()); | Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str()); | ||||
| m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str()); | m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str()); | ||||
| m_object->data = mesh; | m_object->data = mesh; | ||||
| Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, "", 0.0f, nullptr); | Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, "", 0.0f, nullptr); | ||||
| if (read_mesh != mesh) { | if (read_mesh != mesh) { | ||||
| /* XXX FIXME: after 2.80; mesh->flag isn't copied by #BKE_mesh_nomain_to_mesh(). */ | BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object); | ||||
| /* read_mesh can be freed by BKE_mesh_nomain_to_mesh(), so get the flag before that happens. */ | |||||
| uint16_t autosmooth = (read_mesh->flag & ME_AUTOSMOOTH); | |||||
| BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_EVERYTHING, true); | |||||
| mesh->flag |= autosmooth; | |||||
| } | } | ||||
| if (m_settings->validate_meshes) { | if (m_settings->validate_meshes) { | ||||
| BKE_mesh_validate(mesh, false, false); | BKE_mesh_validate(mesh, false, false); | ||||
| } | } | ||||
| readFaceSetsSample(bmain, mesh, sample_sel); | readFaceSetsSample(bmain, mesh, sample_sel); | ||||
| ▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str()); | Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str()); | ||||
| m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str()); | m_object = BKE_object_add_only_object(bmain, OB_MESH, m_object_name.c_str()); | ||||
| m_object->data = mesh; | m_object->data = mesh; | ||||
| Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, "", 0.0f, nullptr); | Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, "", 0.0f, nullptr); | ||||
| if (read_mesh != mesh) { | if (read_mesh != mesh) { | ||||
| BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_EVERYTHING, true); | BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object); | ||||
| } | } | ||||
| ISubDSchema::Sample sample; | ISubDSchema::Sample sample; | ||||
| try { | try { | ||||
| sample = m_schema.getValue(sample_sel); | sample = m_schema.getValue(sample_sel); | ||||
| } | } | ||||
| catch (Alembic::Util::Exception &ex) { | catch (Alembic::Util::Exception &ex) { | ||||
| printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n", | printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n", | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||