diff options
author | Campbell Barton <campbell@blender.org> | 2022-08-28 13:52:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-08-28 13:52:28 +0300 |
commit | 28750bcf7e8b73d9da015898a3c0f21ef5d761f2 (patch) | |
tree | 45c9c2b24632d811fd6a4eca84a0a9818b9fc47b /source/blender/nodes | |
parent | 7269ee4dbbc2d46eee864029772aa0e167cd267a (diff) |
Cleanup: replace NULL with nullptr for C++ files
Diffstat (limited to 'source/blender/nodes')
4 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc index 5a40ededa96..2481170835b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc @@ -249,7 +249,7 @@ static void node_geo_exec(GeoNodeExecParams params) Mesh &surface_object_data = *static_cast<Mesh *>(surface_ob_orig->data); if (BMEditMesh *em = surface_object_data.edit_mesh) { - surface_mesh_orig = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, NULL, &surface_object_data); + surface_mesh_orig = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, nullptr, &surface_object_data); free_suface_mesh_orig = true; } else { diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc index 02ac54f4b2b..d527f696692 100644 --- a/source/blender/nodes/shader/node_shader_tree.cc +++ b/source/blender/nodes/shader/node_shader_tree.cc @@ -617,7 +617,7 @@ static bool ntree_shader_implicit_closure_cast(bNodeTree *ntree) bool modified = false; LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) { if ((link->fromsock->type != SOCK_SHADER) && (link->tosock->type == SOCK_SHADER)) { - bNode *emission_node = nodeAddStaticNode(NULL, ntree, SH_NODE_EMISSION); + bNode *emission_node = nodeAddStaticNode(nullptr, ntree, SH_NODE_EMISSION); bNodeSocket *in_sock = ntree_shader_node_find_input(emission_node, "Color"); bNodeSocket *out_sock = ntree_shader_node_find_output(emission_node, "Emission"); nodeAddLink(ntree, link->fromnode, link->fromsock, emission_node, in_sock); @@ -645,7 +645,7 @@ static void ntree_weight_tree_merge_weight(bNodeTree *ntree, bNode **tonode, bNodeSocket **tosock) { - bNode *addnode = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + bNode *addnode = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); addnode->custom1 = NODE_MATH_ADD; addnode->tmp_flag = -2; /* Copy */ bNodeSocket *addsock_out = ntree_shader_node_output_get(addnode, 0); @@ -683,19 +683,19 @@ static bool ntree_weight_tree_tag_nodes(bNode *fromnode, bNode *tonode, void *us * with their respective weights. */ static void ntree_shader_weight_tree_invert(bNodeTree *ntree, bNode *output_node) { - bNodeLink *displace_link = NULL; + bNodeLink *displace_link = nullptr; bNodeSocket *displace_output = ntree_shader_node_find_input(output_node, "Displacement"); if (displace_output && displace_output->link) { /* Remove any displacement link to avoid tagging it later on. */ displace_link = displace_output->link; - displace_output->link = NULL; + displace_output->link = nullptr; } - bNodeLink *thickness_link = NULL; + bNodeLink *thickness_link = nullptr; bNodeSocket *thickness_output = ntree_shader_node_find_input(output_node, "Thickness"); if (thickness_output && thickness_output->link) { /* Remove any thickness link to avoid tagging it later on. */ thickness_link = thickness_output->link; - thickness_output->link = NULL; + thickness_output->link = nullptr; } /* Init tmp flag. */ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { @@ -717,7 +717,7 @@ static void ntree_shader_weight_tree_invert(bNodeTree *ntree, bNode *output_node case SH_NODE_OUTPUT_WORLD: case SH_NODE_OUTPUT_MATERIAL: { /* Start the tree with full weight. */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_VALUE); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_VALUE); nodes_copy[id]->tmp_flag = -2; /* Copy */ ((bNodeSocketValueFloat *)ntree_shader_node_output_get(nodes_copy[id], 0)->default_value) ->value = 1.0f; @@ -726,7 +726,7 @@ static void ntree_shader_weight_tree_invert(bNodeTree *ntree, bNode *output_node case SH_NODE_ADD_SHADER: { /* Simple passthrough node. Each original inputs will get the same weight. */ /* TODO(fclem): Better use some kind of reroute node? */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); nodes_copy[id]->custom1 = NODE_MATH_ADD; nodes_copy[id]->tmp_flag = -2; /* Copy */ ((bNodeSocketValueFloat *)ntree_shader_node_input_get(nodes_copy[id], 0)->default_value) @@ -739,17 +739,17 @@ static void ntree_shader_weight_tree_invert(bNodeTree *ntree, bNode *output_node bNodeSocket *fromsock, *tosock; int id_start = id; /* output = (factor * input_weight) */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); nodes_copy[id]->custom1 = NODE_MATH_MULTIPLY; nodes_copy[id]->tmp_flag = -2; /* Copy */ id++; /* output = ((1.0 - factor) * input_weight) <=> (input_weight - factor * input_weight) */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); nodes_copy[id]->custom1 = NODE_MATH_SUBTRACT; nodes_copy[id]->tmp_flag = -2; /* Copy */ id++; /* Node sanitizes the input mix factor by clamping it. */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); nodes_copy[id]->custom1 = NODE_MATH_ADD; nodes_copy[id]->custom2 = SHD_MATH_CLAMP; nodes_copy[id]->tmp_flag = -2; /* Copy */ @@ -765,7 +765,7 @@ static void ntree_shader_weight_tree_invert(bNodeTree *ntree, bNode *output_node id++; /* Reroute the weight input to the 3 processing nodes. Simplify linking later-on. */ /* TODO(fclem): Better use some kind of reroute node? */ - nodes_copy[id] = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); + nodes_copy[id] = nodeAddStaticNode(nullptr, ntree, SH_NODE_MATH); nodes_copy[id]->custom1 = NODE_MATH_ADD; nodes_copy[id]->tmp_flag = -2; /* Copy */ ((bNodeSocketValueFloat *)ntree_shader_node_input_get(nodes_copy[id], 0)->default_value) @@ -1040,7 +1040,7 @@ void ntreeGPUMaterialNodes(bNodeTree *localtree, GPUMaterial *mat) /* Tree is valid if it contains no undefined implicit socket type cast. */ bool valid_tree = ntree_shader_implicit_closure_cast(localtree); - if (valid_tree && output != NULL) { + if (valid_tree && output != nullptr) { ntree_shader_pruned_unused(localtree, output); ntree_shader_shader_to_rgba_branch(localtree, output); ntree_shader_weight_tree_invert(localtree, output); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc index 0a28b34902e..9727a6089a6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc @@ -38,8 +38,8 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat, /* Use special matrix to let the shader branch to using the render object's matrix. */ float dummy_matrix[4][4]; dummy_matrix[3][3] = 0.0f; - GPUNodeLink *inv_obmat = (ob != NULL) ? GPU_uniform(&ob->imat[0][0]) : - GPU_uniform(&dummy_matrix[0][0]); + GPUNodeLink *inv_obmat = (ob != nullptr) ? GPU_uniform(&ob->imat[0][0]) : + GPU_uniform(&dummy_matrix[0][0]); /* Optimization: don't request orco if not needed. */ float4 zero(0.0f); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc index de588f9005f..159bd238212 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc @@ -83,7 +83,7 @@ static const char *get_gpufn_name_from_to(short from, short to, bool is_directio } break; } - return NULL; + return nullptr; } static int gpu_shader_vect_transform(GPUMaterial *mat, |