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:
Diffstat (limited to 'source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh26
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
index 80e3127f69f..f83b3b49bf5 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
@@ -8,8 +8,6 @@
#include "BLI_map.hh"
#include "BLI_math_vec_types.hh"
-#include "BLI_string_ref.hh"
-#include "BLI_vector.hh"
#include "DNA_node_types.h"
#include "obj_export_io.hh"
@@ -25,19 +23,22 @@ template<> struct DefaultHash<io::obj::eMTLSyntaxElement> {
} // namespace blender
namespace blender::io::obj {
-class OBJMesh;
/**
* Generic container for texture node properties.
*/
struct tex_map_XX {
tex_map_XX(StringRef to_socket_id) : dest_socket_id(to_socket_id){};
+ bool is_valid() const
+ {
+ return !image_path.empty();
+ }
- /** Target socket which this texture node connects to. */
+ /* Target socket which this texture node connects to. */
const std::string dest_socket_id;
float3 translation{0.0f};
float3 scale{1.0f};
- /* Only Flat and Smooth projections are supported. */
+ /* Only Flat and Sphere projections are supported. */
int projection_type = SHD_PROJ_FLAT;
std::string image_path;
std::string mtl_dir_path;
@@ -58,16 +59,15 @@ struct MTLMaterial {
texture_maps.add(eMTLSyntaxElement::map_Bump, tex_map_XX("Normal"));
}
- /**
- * Caller must ensure that the given lookup key exists in the Map.
- * \return Texture map corresponding to the given ID.
- */
+ const tex_map_XX &tex_map_of_type(const eMTLSyntaxElement key) const
+ {
+ BLI_assert(texture_maps.contains(key));
+ return texture_maps.lookup(key);
+ }
tex_map_XX &tex_map_of_type(const eMTLSyntaxElement key)
{
- {
- BLI_assert(texture_maps.contains_as(key));
- return texture_maps.lookup_as(key);
- }
+ BLI_assert(texture_maps.contains(key));
+ return texture_maps.lookup(key);
}
std::string name;