diff options
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/alembic/exporter/abc_writer_mesh.cc | 2 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_customdata.cc | 4 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_reader_mesh.cc | 4 | ||||
-rw-r--r-- | source/blender/io/collada/GeometryExporter.cpp | 10 | ||||
-rw-r--r-- | source/blender/io/collada/MeshImporter.cpp | 7 | ||||
-rw-r--r-- | source/blender/io/common/intern/string_utils.cc | 2 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_reader_mesh.cc | 4 | ||||
-rw-r--r-- | source/blender/io/usd/tests/usd_tests_common.h | 2 |
8 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index bbb196dc383..07b185ffd64 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -359,7 +359,7 @@ void ABCGenericMeshWriter::write_arb_geo_params(struct Mesh *me) else { arb_geom_params = abc_poly_mesh_.getSchema().getArbGeomParams(); } - write_custom_data(arb_geom_params, m_custom_data_config, &me->ldata, CD_MLOOPCOL); + write_custom_data(arb_geom_params, m_custom_data_config, &me->ldata, CD_PROP_BYTE_COLOR); } bool ABCGenericMeshWriter::get_velocities(struct Mesh *mesh, std::vector<Imath::V3f> &vels) diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index c413fbf0ff9..45bf898f3f5 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -294,7 +294,7 @@ void write_custom_data(const OCompoundProperty &prop, write_uv(prop, config, cd_data, name); } - else if (cd_data_type == CD_MLOOPCOL) { + else if (cd_data_type == CD_PROP_BYTE_COLOR) { write_mcol(prop, config, cd_data, name); } } @@ -412,7 +412,7 @@ static void read_custom_data_mcols(const std::string &iobject_full_name, /* Read the vertex colors */ void *cd_data = config.add_customdata_cb( - config.mesh, prop_header.getName().c_str(), CD_MLOOPCOL); + config.mesh, prop_header.getName().c_str(), CD_PROP_BYTE_COLOR); MCol *cfaces = static_cast<MCol *>(cd_data); MPoly *mpolys = config.mpoly; MLoop *mloops = config.mloop; diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index fe2b0470432..2d2dcfb1f42 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -245,7 +245,7 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data) static void process_no_normals(CDStreamConfig &config) { /* Absence of normals in the Alembic mesh is interpreted as 'smooth'. */ - BKE_mesh_calc_normals(config.mesh); + BKE_mesh_normals_tag_dirty(config.mesh); } static void process_loop_normals(CDStreamConfig &config, const N3fArraySamplePtr loop_normals_ptr) @@ -382,7 +382,7 @@ static void *add_customdata_cb(Mesh *mesh, const char *name, int data_type) int numloops; /* unsupported custom data type -- don't do anything. */ - if (!ELEM(cd_data_type, CD_MLOOPUV, CD_MLOOPCOL)) { + if (!ELEM(cd_data_type, CD_MLOOPUV, CD_PROP_BYTE_COLOR)) { return nullptr; } diff --git a/source/blender/io/collada/GeometryExporter.cpp b/source/blender/io/collada/GeometryExporter.cpp index 3b21d423df5..3952a4ae334 100644 --- a/source/blender/io/collada/GeometryExporter.cpp +++ b/source/blender/io/collada/GeometryExporter.cpp @@ -378,12 +378,12 @@ void GeometryExporter::create_mesh_primitive_list(short material_index, } } - int totlayer_mcol = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL); + int totlayer_mcol = CustomData_number_of_layers(&me->ldata, CD_PROP_BYTE_COLOR); if (totlayer_mcol > 0) { int map_index = 0; for (int a = 0; a < totlayer_mcol; a++) { - char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPCOL, a); + char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_PROP_BYTE_COLOR, a); COLLADASW::Input input4(COLLADASW::InputSemantic::COLOR, makeUrl(makeVertexColorSourceId(geom_id, layer_name)), (has_uvs) ? 3 : 2, /* all color layers have same index order */ @@ -468,7 +468,7 @@ void GeometryExporter::createVertsSource(std::string geom_id, Mesh *me) void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me) { /* Find number of vertex color layers */ - int totlayer_mcol = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL); + int totlayer_mcol = CustomData_number_of_layers(&me->ldata, CD_PROP_BYTE_COLOR); if (totlayer_mcol == 0) { return; } @@ -477,11 +477,11 @@ void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me) for (int a = 0; a < totlayer_mcol; a++) { map_index++; - MLoopCol *mloopcol = (MLoopCol *)CustomData_get_layer_n(&me->ldata, CD_MLOOPCOL, a); + MLoopCol *mloopcol = (MLoopCol *)CustomData_get_layer_n(&me->ldata, CD_PROP_BYTE_COLOR, a); COLLADASW::FloatSourceF source(mSW); - char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPCOL, a); + char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_PROP_BYTE_COLOR, a); std::string layer_id = makeVertexColorSourceId(geom_id, layer_name); source.setId(layer_id); diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp index fc94e912417..6e109353be8 100644 --- a/source/blender/io/collada/MeshImporter.cpp +++ b/source/blender/io/collada/MeshImporter.cpp @@ -471,9 +471,9 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me) collada_mesh->getColors().getInputInfosArray()[i]; COLLADAFW::String colname = extract_vcolname(info->mName); CustomData_add_layer_named( - &me->ldata, CD_MLOOPCOL, CD_DEFAULT, nullptr, me->totloop, colname.c_str()); + &me->ldata, CD_PROP_BYTE_COLOR, CD_DEFAULT, nullptr, me->totloop, colname.c_str()); } - me->mloopcol = (MLoopCol *)CustomData_get_layer_n(&me->ldata, CD_MLOOPCOL, 0); + me->mloopcol = (MLoopCol *)CustomData_get_layer_n(&me->ldata, CD_PROP_BYTE_COLOR, 0); } } } @@ -724,7 +724,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me) COLLADAFW::IndexList &color_index_list = *mp->getColorIndices(vcolor_index); COLLADAFW::String colname = extract_vcolname(color_index_list.getName()); MLoopCol *mloopcol = (MLoopCol *)CustomData_get_layer_named( - &me->ldata, CD_MLOOPCOL, colname.c_str()); + &me->ldata, CD_PROP_BYTE_COLOR, colname.c_str()); if (mloopcol == nullptr) { fprintf(stderr, "Collada import: Mesh [%s] : Unknown reference to VCOLOR [#%s].\n", @@ -1057,7 +1057,6 @@ Object *MeshImporter::create_mesh_object( Mesh *new_mesh = uid_mesh_map[*geom_uid]; BKE_mesh_assign_object(m_bmain, ob, new_mesh); - BKE_mesh_calc_normals(new_mesh); /* Because BKE_mesh_assign_object would have already decreased it... */ id_us_plus(&old_mesh->id); diff --git a/source/blender/io/common/intern/string_utils.cc b/source/blender/io/common/intern/string_utils.cc index 01107b0866e..3a12250e14b 100644 --- a/source/blender/io/common/intern/string_utils.cc +++ b/source/blender/io/common/intern/string_utils.cc @@ -7,7 +7,7 @@ * their standard libraries are not quite there yet. * LLVM/libc++ only has a float parser since LLVM 14, * and gcc/libstdc++ since 11.1. So until at least these are - * the mininum spec, use an external library. */ + * the minimum spec, use an external library. */ #include "fast_float.h" #include <charconv> diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index 646d1ba1fde..328b4109616 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -149,7 +149,7 @@ static void *add_customdata_cb(Mesh *mesh, const char *name, const int data_type int numloops; /* unsupported custom data type -- don't do anything. */ - if (!ELEM(cd_data_type, CD_MLOOPUV, CD_MLOOPCOL)) { + if (!ELEM(cd_data_type, CD_MLOOPUV, CD_PROP_BYTE_COLOR)) { return nullptr; } @@ -457,7 +457,7 @@ void USDMeshReader::read_colors(Mesh *mesh, const double motionSampleTime) return; } - void *cd_ptr = add_customdata_cb(mesh, "displayColors", CD_MLOOPCOL); + void *cd_ptr = add_customdata_cb(mesh, "displayColors", CD_PROP_BYTE_COLOR); if (!cd_ptr) { std::cerr << "WARNING: Couldn't add displayColors custom data.\n"; diff --git a/source/blender/io/usd/tests/usd_tests_common.h b/source/blender/io/usd/tests/usd_tests_common.h index b298a253ddc..7f6ae558354 100644 --- a/source/blender/io/usd/tests/usd_tests_common.h +++ b/source/blender/io/usd/tests/usd_tests_common.h @@ -8,7 +8,7 @@ namespace blender::io::usd { /* Calls the function to load the USD plugins from the * USD data directory under the Blender bin directory - * that was supplied as the --test-release-dir flag to ctest. + * that was supplied as the --test-release-dir flag to `ctest`. * Thus function must be called before instantiating a USD * stage to avoid errors. The returned string is the path to * the USD data files directory from which the plugins were |