[Bf-blender-cvs] [2bf519d211b] master: Cleanup: Correct location of node function declarations

Hans Goudey noreply at git.blender.org
Mon Jan 24 23:20:31 CET 2022


Commit: 2bf519d211b1c51353b827f994494badfdf2569f
Author: Hans Goudey
Date:   Mon Jan 24 16:18:30 2022 -0600
Branches: master
https://developer.blender.org/rB2bf519d211b1c51353b827f994494badfdf2569f

Cleanup: Correct location of node function declarations

Currently there are many function declarations in `BKE_node.h` that
don't actually have implementations in blenkernel. This commit moves
the declarations to `NOD_composite.h`, `NOD_texture.h`, and
`NOD_shader.h` instead. This helps to clarify the purpose of the
different modules.

Differential Revision: https://developer.blender.org/D13869

===================================================================

M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/intern/node_tree_update.cc
M	source/blender/blenkernel/intern/texture.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/blenloader/intern/versioning_cycles.c
M	source/blender/compositor/nodes/COM_CryptomatteNode.cc
M	source/blender/compositor/operations/COM_TextureOperation.cc
M	source/blender/editors/interface/interface_eyedropper_color.c
M	source/blender/editors/render/CMakeLists.txt
M	source/blender/editors/render/render_internal.cc
M	source/blender/editors/render/render_shading.cc
M	source/blender/editors/render/render_update.cc
M	source/blender/editors/sculpt_paint/CMakeLists.txt
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/makesrna/intern/rna_layer.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/nodes/NOD_composite.h
M	source/blender/nodes/NOD_shader.h
M	source/blender/nodes/NOD_texture.h
M	source/blender/render/intern/pipeline.c
M	source/blender/render/intern/texture_procedural.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 2f9034f6438..cd6d58f563a 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1179,30 +1179,6 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, i
 #define SH_NODE_VECTOR_ROTATE 708
 #define SH_NODE_CURVE_FLOAT 709
 
-/* API */
-
-struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree);
-void ntreeShaderEndExecTree(struct bNodeTreeExec *exec);
-/**
-   Find an output node of the shader tree.
- *
- * \note it will only return output which is NOT in the group, which isn't how
- * render engines works but it's how the GPU shader compilation works. This we
- * can change in the future and make it a generic function, but for now it stays
- * private here.
- */
-struct bNode *ntreeShaderOutputNode(struct bNodeTree *ntree, int target);
-/**
- * This one needs to work on a local tree.
- *
- * TODO: This is *not* part of `blenkernel`, it's defined under "source/blender/nodes/".
- * This declaration should be moved out of BKE.
- */
-void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
-                           struct GPUMaterial *mat,
-                           bool *has_surface_output,
-                           bool *has_volume_output);
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
@@ -1352,75 +1328,6 @@ void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
 #define CMP_DEFAULT_SMAA_CONTRAST_LIMIT 0.2f
 #define CMP_DEFAULT_SMAA_CORNER_ROUNDING 0.25f
 
-/* API */
-void ntreeCompositExecTree(struct Scene *scene,
-                           struct bNodeTree *ntree,
-                           struct RenderData *rd,
-                           int rendering,
-                           int do_previews,
-                           const struct ColorManagedViewSettings *view_settings,
-                           const struct ColorManagedDisplaySettings *display_settings,
-                           const char *view_name);
-
-/**
- * Called from render pipeline, to tag render input and output.
- * need to do all scenes, to prevent errors when you re-render 1 scene.
- */
-void ntreeCompositTagRender(struct Scene *scene);
-/**
- * Update the outputs of the render layer nodes.
- * Since the outputs depend on the render engine, this part is a bit complex:
- * - #ntreeCompositUpdateRLayers is called and loops over all render layer nodes.
- * - Each render layer node calls the update function of the
- *   render engine that's used for its scene.
- * - The render engine calls RE_engine_register_pass for each pass.
- * - #RE_engine_register_pass calls #node_cmp_rlayers_register_pass.
- *
- * TODO: This is *not* part of `blenkernel`, it's defined under "source/blender/nodes/".
- * This declaration should be moved out of BKE.
- */
-void ntreeCompositUpdateRLayers(struct bNodeTree *ntree);
-void ntreeCompositClearTags(struct bNodeTree *ntree);
-
-struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree,
-                                                     struct bNode *node,
-                                                     const char *name,
-                                                     struct ImageFormatData *im_format);
-int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node);
-void ntreeCompositOutputFileSetPath(struct bNode *node,
-                                    struct bNodeSocket *sock,
-                                    const char *name);
-void ntreeCompositOutputFileSetLayer(struct bNode *node,
-                                     struct bNodeSocket *sock,
-                                     const char *name);
-/* needed in do_versions */
-void ntreeCompositOutputFileUniquePath(struct ListBase *list,
-                                       struct bNodeSocket *sock,
-                                       const char defname[],
-                                       char delim);
-void ntreeCompositOutputFileUniqueLayer(struct ListBase *list,
-                                        struct bNodeSocket *sock,
-                                        const char defname[],
-                                        char delim);
-
-void ntreeCompositColorBalanceSyncFromLGG(bNodeTree *ntree, bNode *node);
-void ntreeCompositColorBalanceSyncFromCDL(bNodeTree *ntree, bNode *node);
-
-void ntreeCompositCryptomatteSyncFromAdd(const Scene *scene, bNode *node);
-void ntreeCompositCryptomatteSyncFromRemove(bNode *node);
-bNodeSocket *ntreeCompositCryptomatteAddSocket(bNodeTree *ntree, bNode *node);
-int ntreeCompositCryptomatteRemoveSocket(bNodeTree *ntree, bNode *node);
-void ntreeCompositCryptomatteLayerPrefix(const Scene *scene,
-                                         const bNode *node,
-                                         char *r_prefix,
-                                         size_t prefix_len);
-/**
- * Update the runtime layer names with the crypto-matte layer names of the references render layer
- * or image.
- */
-void ntreeCompositCryptomatteUpdateLayerNames(const Scene *scene, bNode *node);
-struct CryptomatteSession *ntreeCompositCryptomatteSession(const Scene *scene, bNode *node);
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
@@ -1457,24 +1364,6 @@ struct TexResult;
 #define TEX_NODE_PROC 500
 #define TEX_NODE_PROC_MAX 600
 
-/* API */
-void ntreeTexCheckCyclics(struct bNodeTree *ntree);
-
-struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree);
-void ntreeTexEndExecTree(struct bNodeTreeExec *exec);
-int ntreeTexExecTree(struct bNodeTree *ntree,
-                     struct TexResult *target,
-                     const float co[3],
-                     float dxt[3],
-                     float dyt[3],
-                     int osatex,
-                     short thread,
-                     const struct Tex *tex,
-                     short which_output,
-                     int cfra,
-                     int preview,
-                     struct MTex *mtex);
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc
index be9777281cb..0555707b64c 100644
--- a/source/blender/blenkernel/intern/node_tree_update.cc
+++ b/source/blender/blenkernel/intern/node_tree_update.cc
@@ -34,6 +34,7 @@
 
 #include "NOD_node_declaration.hh"
 #include "NOD_node_tree_ref.hh"
+#include "NOD_texture.h"
 
 #include "DEG_depsgraph_query.h"
 
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index ee9247e6e60..37d5d732a70 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -67,6 +67,8 @@
 #include "BKE_scene.h"
 #include "BKE_texture.h"
 
+#include "NOD_texture.h"
+
 #include "RE_texture.h"
 
 #include "BLO_read_write.h"
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 8a22fd07c24..c34b8f735e5 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -78,6 +78,7 @@
 #include "IMB_imbuf.h" /* for proxy / time-code versioning stuff. */
 
 #include "NOD_common.h"
+#include "NOD_composite.h"
 #include "NOD_texture.h"
 
 #include "BLO_readfile.h"
diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c
index f1a2e678b2e..1f18405cdf9 100644
--- a/source/blender/blenloader/intern/versioning_cycles.c
+++ b/source/blender/blenloader/intern/versioning_cycles.c
@@ -42,6 +42,8 @@
 #include "BKE_main.h"
 #include "BKE_node.h"
 
+#include "NOD_shader.h"
+
 #include "MEM_guardedalloc.h"
 
 #include "IMB_colormanagement.h"
diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cc b/source/blender/compositor/nodes/COM_CryptomatteNode.cc
index 605dc1dc84d..c360e519cf8 100644
--- a/source/blender/compositor/nodes/COM_CryptomatteNode.cc
+++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cc
@@ -16,9 +16,12 @@
  * Copyright 2018, Blender Foundation.
  */
 
-#include "COM_CryptomatteNode.h"
 #include "BKE_node.h"
+
+#include "NOD_composite.h"
+
 #include "COM_ConvertOperation.h"
+#include "COM_CryptomatteNode.h"
 #include "COM_MultilayerImageOperation.h"
 #include "COM_RenderLayersProg.h"
 #include "COM_SetAlphaMultiplyOperation.h"
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc
index f5d47478a8d..a4990993d73 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cc
+++ b/source/blender/compositor/operations/COM_TextureOperation.cc
@@ -22,6 +22,8 @@
 #include "BKE_image.h"
 #include "BKE_node.h"
 
+#include "NOD_texture.h"
+
 namespace blender::compositor {
 
 TextureBaseOperation::TextureBaseOperation()
diff --git a/source/blender/editors/interface/interface_eyedropper_color.c b/source/blender/editors/interface/interface_eyedropper_color.c
index 52730096b2f..05840175fab 100644
--- a/source/blender/editors/interface/interface_eyedropper_color.c
+++ b/source/blender/editors/interface/interface_eyedropper_color.c
@@ -42,6 +42,8 @@
 #include "BKE_node.h"
 #include "BKE_screen.h"
 
+#include "NOD_composite.h"
+
 #include "RNA_access.h"
 
 #include "UI_interface.h"
diff --git a/source/blender/editors/render/CMakeLists.txt b/source/blender/editors/render/CMakeLists.txt
index 31dca83a3ab..1f867c6f1f7 100644
--- a/source/blender/editors/render/CMakeLists.txt
+++ b/source/blender/editors/render/CMakeLists.txt
@@ -28,6 +28,7 @@ set(INC
   ../../imbuf
   ../../makesdna
   ../../makesrna
+  ../../nodes
   ../../render
   ../../sequencer
   ../../windowmanager
diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc
index 1d0de322271..a156b9234dc 100644
--- a/source/blender/editors/render/render_internal.cc
+++ b/source/blender/editors/render/render_internal.cc
@@ -56,6 +56,8 @@
 #include "BKE_scene.h"
 #include "B

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list