[Bf-blender-cvs] [94dac497b2b] soc-2020-io-performance: Get branch into compling state again.
Howard Trickey
noreply at git.blender.org
Tue Feb 23 17:04:47 CET 2021
Commit: 94dac497b2b43f19ebb5b47deb82dcbd65a3c46b
Author: Howard Trickey
Date: Tue Feb 23 11:03:29 2021 -0500
Branches: soc-2020-io-performance
https://developer.blender.org/rB94dac497b2b43f19ebb5b47deb82dcbd65a3c46b
Get branch into compling state again.
There are some changes in Materials in the exporter that make compiling
the importer fail. I fixed one and several others are just ifdef'd out
for now so that the branch compiles. TODO to fix the rest.
===================================================================
M source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
M source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
M source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
===================================================================
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
index f5417718ab9..74950f8f34e 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
@@ -549,6 +549,8 @@ void MTLParser::parse_and_store(Map<string, std::unique_ptr<MTLMaterial>> &r_mtl
/* Parse image textures. */
else if (line_key.find("map_") != StringRef::not_found) {
+ /* TODO howardt: fix this */
+#if 0
if (!current_mtlmaterial->texture_maps.contains_as(string(line_key))) {
/* No supported texture map found. */
std::cerr << "Texture map type not supported:'" << line_key << "'" << std::endl;
@@ -594,6 +596,7 @@ void MTLParser::parse_and_store(Map<string, std::unique_ptr<MTLMaterial>> &r_mtl
/* Skip all unsupported options and arguments. */
tex_map.image_path = string(skip_unsupported_options(rest_line));
tex_map.mtl_dir_path = mtl_dir_path_;
+#endif
}
}
}
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
index 9b564d977e9..87f217041d2 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
@@ -382,9 +382,12 @@ void MeshFromGeometry::create_materials(
const MTLMaterial &curr_mat = *materials.lookup_as(material_name);
ShaderNodetreeWrap mat_wrap{bmain, curr_mat};
+/* TODO howardt: fix this. */
+#if 0
mat->use_nodes = true;
mat->nodetree = mat_wrap.get_nodetree();
ntreeUpdateTree(bmain, mat->nodetree);
+#endif
}
}
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
index c988974a1ae..eaa65b3f000 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
@@ -30,6 +30,8 @@
#include "NOD_shader.h"
+/* TODO: move eMTLSyntaxElement out of following file into a more neutral place */
+#include "obj_export_io.hh"
#include "obj_import_mtl.hh"
#include "parser_string_utils.hh"
@@ -318,7 +320,7 @@ void ShaderNodetreeWrap::set_bsdf_socket_values()
set_property_of_socket(SOCK_RGBA, "Base Color", {base_color, 3}, bsdf_.get());
set_property_of_socket(SOCK_RGBA, "Emission", {emission_color, 3}, bsdf_.get());
- if (mtl_mat_.texture_maps.contains_as("Emission")) {
+ if (mtl_mat_.texture_maps.contains_as(eMTLSyntaxElement::map_Ke)) {
set_property_of_socket(SOCK_FLOAT, "Emission Strength", {1.0f}, bsdf_.get());
}
set_property_of_socket(SOCK_FLOAT, "Specular", {specular}, bsdf_.get());
@@ -334,7 +336,7 @@ void ShaderNodetreeWrap::set_bsdf_socket_values()
*/
void ShaderNodetreeWrap::add_image_textures(Main *bmain)
{
- for (const Map<const std::string, tex_map_XX>::Item texture_map :
+ for (const Map<const eMTLSyntaxElement, tex_map_XX>::Item texture_map :
mtl_mat_.texture_maps.items()) {
if (texture_map.value.image_path.empty()) {
/* No Image texture node of this map type can be added to this material. */
@@ -346,7 +348,7 @@ void ShaderNodetreeWrap::add_image_textures(Main *bmain)
unique_node_ptr texture_coordinate(add_node_to_tree(SH_NODE_TEX_COORD));
unique_node_ptr normal_map = nullptr;
- if (texture_map.key == "map_Bump") {
+ if (texture_map.key == eMTLSyntaxElement::map_Bump) {
normal_map.reset(add_node_to_tree(SH_NODE_NORMAL_MAP));
const float bump = std::max(0.0f, mtl_mat_.map_Bump_strength);
set_property_of_socket(SOCK_FLOAT, "Strength", {bump}, normal_map.get());
More information about the Bf-blender-cvs
mailing list