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/importer/obj_import_mtl.hh')
-rw-r--r--source/blender/io/wavefront_obj/importer/obj_import_mtl.hh28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.hh b/source/blender/io/wavefront_obj/importer/obj_import_mtl.hh
index e48cf6e56da..4b7827b2035 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.hh
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.hh
@@ -45,20 +45,48 @@ class ShaderNodetreeWrap {
const float node_size_{300.f};
public:
+ /**
+ * Initializes a nodetree with a p-BSDF node's BSDF socket connected to shader output node's
+ * surface socket.
+ */
ShaderNodetreeWrap(Main *bmain, const MTLMaterial &mtl_mat, Material *mat);
~ShaderNodetreeWrap();
+ /**
+ * Release nodetree for materials to own it. nodetree has its unique deleter
+ * if destructor is not reached for some reason.
+ */
bNodeTree *get_nodetree();
private:
+ /**
+ * Add a new static node to the tree.
+ * No two nodes are linked here.
+ */
bNode *add_node_to_tree(const int node_type);
+ /**
+ * Return x-y coordinates for a node where y is determined by other nodes present in
+ * the same vertical column.
+ */
std::pair<float, float> set_node_locations(const int pos_x);
+ /**
+ * Link two nodes by the sockets of given IDs.
+ * Also releases the ownership of the "from" node for nodetree to free it.
+ * \param from_node_pos_x: 0 to 4 value as per nodetree arrangement.
+ */
void link_sockets(bNode *from_node,
StringRef from_node_id,
bNode *to_node,
StringRef to_node_id,
const int from_node_pos_x);
+ /**
+ * Set values of sockets in p-BSDF node of the nodetree.
+ */
void set_bsdf_socket_values();
+ /**
+ * Create image texture, vector and normal mapping nodes from MTL materials and link the
+ * nodes to p-BSDF node.
+ */
void add_image_textures(Main *bmain, Material *mat);
};