Skip to content

Commit a34f403

Browse files
gregoire-dlcbentejac
authored andcommitted
[mesh] Material: Fix getAllTextures() signature
The previous signature break `exportUSD` software
1 parent 44de306 commit a34f403

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/aliceVision/mesh/Material.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ const StaticVector<std::string>& Material::getTextures(TextureType type) const
9393
}
9494
}
9595

96-
void Material::getAllTexturePaths(std::vector<std::string>& texturePaths) const
96+
std::vector<std::string> Material::getAllTextures() const
9797
{
98+
std::vector<std::string> texturePaths;
9899
texturePaths.resize(_bumpTextures.size() + _diffuseTextures.size() + _displacementTextures.size() + _normalTextures.size());
99100

100101
auto last = std::copy(_bumpTextures.begin(), _bumpTextures.end(), texturePaths.begin());
101102
last = std::copy(_diffuseTextures.begin(), _diffuseTextures.end(), last);
102103
last = std::copy(_displacementTextures.begin(), _displacementTextures.end(), last);
103104
std::copy(_normalTextures.begin(), _normalTextures.end(), last);
105+
106+
return texturePaths;
104107
}
105108

106109
bool Material::hasTextures(TextureType type) const

src/aliceVision/mesh/Material.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Material
5555
const StaticVector<std::string>& getTextures(TextureType type) const;
5656

5757
/// Get all texture paths used in the material
58-
void getAllTexturePaths(std::vector<std::string>& texturePaths) const;
58+
std::vector<std::string> getAllTextures() const;
5959

6060
/// Check if material has textures of a given type
6161
bool hasTextures(TextureType type) const;

src/software/convert/main_convertMesh.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ int aliceVision_main(int argc, char** argv)
135135
outType == mesh::EFileType::GLTF ||
136136
outType == mesh::EFileType::GLB)
137137
{
138-
std::vector<std::string> texturePaths;
139-
texturing.material.getAllTexturePaths(texturePaths);
140-
141-
for (const auto& texturePath : texturePaths)
138+
for (const auto& texturePath : texturing.material.getAllTextures())
142139
{
143140
ALICEVISION_LOG_DEBUG("Copying texture file: " << texturePath);
144141

0 commit comments

Comments
 (0)