Page MenuHome

Cleanup: convert compositor nodes to c++
ClosedPublic

Authored by Aaron Carlisle (Blendify) on Aug 31 2021, 11:35 PM.

Details

Summary
  • Many cleanups of to use list base
  • Some variable changes

These change is needed to migrate to the new socket builder API

Diff Detail

Repository
rB Blender
Branch
cmp-nodes-cpp (branched from master)
Build Status
Buildable 17356
Build 17356: arc lint + arc unit

Event Timeline

Aaron Carlisle (Blendify) requested review of this revision.Aug 31 2021, 11:35 PM
Aaron Carlisle (Blendify) created this revision.
  • Attempt to fix tests
  • Attempt to fix linking errors on windows
  • Fix incorrect listbase implentations
  • Merge branch 'master' into cmp-nodes-cpp

A couple new clang-tidy warnings:

/home/jacques/blender-git/blender/source/blender/nodes/composite/nodes/node_composite_defocus.cc:26:10: warning: inclusion of deprecated C++ header 'limits.h'; consider using 'climits' instead [modernize-deprecated-headers]
#include <limits.h>
         ^~~~~~~~~~
         <climits>
[988/2164] Building CXX object source/blender/nodes/CMakeFiles/bf_nodes.dir/composite/nodes/node_composite_image.cc.o
/home/jacques/blender-git/blender/source/blender/nodes/composite/nodes/node_composite_image.cc:225:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
typedef struct RLayerUpdateData {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1009/2164] Building CXX object source/blender/nodes/CMakeFiles/bf_nodes.dir/composite/nodes/node_composite_outputFile.cc.o
/home/jacques/blender-git/blender/source/blender/nodes/composite/nodes/node_composite_outputFile.cc:26:10: warning: inclusion of deprecated C++ header 'string.h'; consider using 'cstring' instead [modernize-deprecated-headers]
#include <string.h>
         ^~~~~~~~~~
         <cstring>
[1035/2164] Building CXX object source/blender/nodes/CMakeFiles/bf_nodes.dir/composite/node_composite_util.cc.o
/home/jacques/blender-git/blender/source/blender/nodes/composite/node_composite_util.hh:53:6: warning: function 'cmp_node_poll_default' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
bool cmp_node_poll_default(struct bNodeType *ntype,
     ^
/home/jacques/blender-git/blender/source/blender/nodes/composite/node_composite_util.cc:26:6: note: the definition seen here
bool cmp_node_poll_default(bNodeType *UNUSED(ntype),
     ^
/home/jacques/blender-git/blender/source/blender/nodes/composite/node_composite_util.hh:53:6: note: differing parameters are named here: ('r_disabled_info'), in definition: ('r_disabled_hint')
bool cmp_node_poll_default(struct bNodeType *ntype,
     ^
[1036/2164] Building CXX object source/blender/nodes/CMakeFiles/bf_nodes.dir/composite/node_composite_tree.cc.o
/home/jacques/blender-git/blender/source/blender/nodes/composite/node_composite_tree.cc:24:10: warning: inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [modernize-deprecated-headers]
#include <stdio.h>
         ^~~~~~~~~
         <cstdio>

Note, for the use 'using' instead of 'typedef' warning just remove the typedef alltogether.

  • clabg-tidy: fix includes
  • Address clang tidy warnings
Manuel Castilla (manzanilla) requested changes to this revision.Sep 4 2021, 7:49 PM
  • You didn't fix one warning, rename r_disabled_info -> r_disabled_hint and remove the UNUSED of the last commit:
warning: function 'cmp_node_poll_default' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
bool cmp_node_poll_default(struct bNodeType *UNUSED(ntype),
     ^
/home/lolme/bf/blender/source/blender/nodes/composite/node_composite_util.cc:26:6: note: the definition seen here
bool cmp_node_poll_default(bNodeType *UNUSED(ntype),
     ^
/home/lolme/bf/blender/source/blender/nodes/composite/node_composite_util.hh:53:6: note: differing parameters are named here: ('r_disabled_info'), in definition: ('r_disabled_hint')
bool cmp_node_poll_default(struct bNodeType *UNUSED(ntype),
     ^
  • You need to enable clang-format, run make format.
source/blender/nodes/composite/nodes/node_composite_image.cc
155–156

declare it as eNodeSocketDatatype instead of converting it later

source/blender/nodes/composite/nodes/node_composite_splitViewer.cc
41

No need to rename it to data, iuser is more descriptive. There are other cases like this, I'd rather keep the original name.

This revision now requires changes to proceed.Sep 4 2021, 7:49 PM
  • Merge branch 'master' into cmp-nodes-cpp
  • Fixes after merge with master
  • Cleanup: Make format
  • Cleanup: Clang-tidy
  • Revert changes to node storage variable names
Aaron Carlisle (Blendify) marked 2 inline comments as done.Sep 27 2021, 9:29 PM
This revision is now accepted and ready to land.Sep 28 2021, 1:32 PM

It seems some tests are still failing... I'm not sure why yet.

I ran the tests on windows and nothing failed. Still better to check this on buildbot before committing.

  • Attempt to fix test
  • Merge branch 'master' into cmp-nodes-cpp