[Bf-blender-cvs] [9c6e3e103a7] soc-2020-io-performance: Use findNodeSocket since it accepts const bNode*
Ankit Meel
noreply at git.blender.org
Sun Jun 28 12:24:24 CEST 2020
Commit: 9c6e3e103a79749097ff64d051a9e2b28b8175e2
Author: Ankit Meel
Date: Sun Jun 28 15:53:37 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB9c6e3e103a79749097ff64d051a9e2b28b8175e2
Use findNodeSocket since it accepts const bNode*
{rB340130719f4d}
===================================================================
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
===================================================================
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
index c556b5baf4e..ca30e28061a 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
@@ -39,7 +39,7 @@ namespace io {
namespace obj {
/**
- * Find and initialiase the Principled-BSDF from the object's material.
+ * Find and initialise the Principled-BSDF from the object's material.
*/
void MTLWriter::init_bsdf_node(const char *object_name)
{
@@ -71,14 +71,7 @@ void MTLWriter::float_property_from_node(float *r_property,
if (!curr_node) {
return;
}
- bNodeSocket *socket = nullptr;
- /* TODO ankitm replace it with nodeFindSocket when D8142 is committed. */
- LISTBASE_FOREACH (bNodeSocket *, curr_socket, (ListBase *)&curr_node->inputs) {
- if (STREQ(curr_socket->identifier, identifier)) {
- socket = curr_socket;
- break;
- }
- }
+ bNodeSocket *socket = nodeFindSocket(curr_node, SOCK_IN, identifier);
if (socket) {
bNodeSocketValueFloat *socket_def_value = (bNodeSocketValueFloat *)socket->default_value;
*r_property = socket_def_value->value;
@@ -96,14 +89,7 @@ void MTLWriter::float3_property_from_node(float *r_property,
if (!curr_node) {
return;
}
- bNodeSocket *socket = nullptr;
- /* TODO ankitm replace it with nodeFindSocket when D8142 is committed. */
- LISTBASE_FOREACH (bNodeSocket *, curr_socket, (ListBase *)&curr_node->inputs) {
- if (STREQ(curr_socket->identifier, identifier)) {
- socket = curr_socket;
- break;
- }
- }
+ bNodeSocket *socket = nodeFindSocket(curr_node, SOCK_IN, identifier);
if (socket) {
bNodeSocketValueRGBA *socket_def_value = (bNodeSocketValueRGBA *)socket->default_value;
copy_v3_v3(r_property, socket_def_value->value);
More information about the Bf-blender-cvs
mailing list