diff options
Diffstat (limited to 'source')
112 files changed, 180 insertions, 178 deletions
diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h index ae910c28342..364f9439366 100644 --- a/source/blender/compositor/intern/COM_Node.h +++ b/source/blender/compositor/intern/COM_Node.h @@ -31,7 +31,7 @@ class Node { /** * \brief stores the reference to the SDNA bNode struct */ - bNode *editor_node_; + const bNode *editor_node_; /** * \brief Is this node part of the active group @@ -61,7 +61,7 @@ class Node { /** * \brief get the reference to the SDNA bNode struct */ - bNode *get_bnode() const + const bNode *get_bnode() const { return editor_node_; } diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.cc b/source/blender/compositor/nodes/COM_AlphaOverNode.cc index 5b0f7a1d0e6..8f9f6f07395 100644 --- a/source/blender/compositor/nodes/COM_AlphaOverNode.cc +++ b/source/blender/compositor/nodes/COM_AlphaOverNode.cc @@ -14,10 +14,10 @@ void AlphaOverNode::convert_to_operations(NodeConverter &converter, { NodeInput *color1Socket = this->get_input_socket(1); NodeInput *color2Socket = this->get_input_socket(2); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); MixBaseOperation *convert_prog; - NodeTwoFloats *ntf = (NodeTwoFloats *)editor_node->storage; + const NodeTwoFloats *ntf = (const NodeTwoFloats *)editor_node->storage; if (ntf->x != 0.0f) { AlphaOverMixedOperation *mix_operation = new AlphaOverMixedOperation(); mix_operation->setX(ntf->x); diff --git a/source/blender/compositor/nodes/COM_AntiAliasingNode.cc b/source/blender/compositor/nodes/COM_AntiAliasingNode.cc index e201720c53b..eb71b70d0bb 100644 --- a/source/blender/compositor/nodes/COM_AntiAliasingNode.cc +++ b/source/blender/compositor/nodes/COM_AntiAliasingNode.cc @@ -9,8 +9,8 @@ namespace blender::compositor { void AntiAliasingNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = this->get_bnode(); - NodeAntiAliasingData *data = (NodeAntiAliasingData *)node->storage; + const bNode *node = this->get_bnode(); + const NodeAntiAliasingData *data = (const NodeAntiAliasingData *)node->storage; /* Edge Detection (First Pass) */ SMAAEdgeDetectionOperation *operation1 = nullptr; diff --git a/source/blender/compositor/nodes/COM_BlurNode.cc b/source/blender/compositor/nodes/COM_BlurNode.cc index a8148d7abd7..9377cfa783c 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cc +++ b/source/blender/compositor/nodes/COM_BlurNode.cc @@ -22,8 +22,8 @@ BlurNode::BlurNode(bNode *editor_node) : Node(editor_node) void BlurNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); - NodeBlurData *data = (NodeBlurData *)editor_node->storage; + const bNode *editor_node = this->get_bnode(); + const NodeBlurData *data = (const NodeBlurData *)editor_node->storage; NodeInput *input_size_socket = this->get_input_socket(1); bool connected_size_socket = input_size_socket->is_linked(); diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cc b/source/blender/compositor/nodes/COM_BokehBlurNode.cc index 31258ddb56a..ebdc82b0d19 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cc +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cc @@ -15,7 +15,7 @@ BokehBlurNode::BokehBlurNode(bNode *editor_node) : Node(editor_node) void BokehBlurNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *b_node = this->get_bnode(); + const bNode *b_node = this->get_bnode(); NodeInput *input_size_socket = this->get_input_socket(2); diff --git a/source/blender/compositor/nodes/COM_BokehImageNode.cc b/source/blender/compositor/nodes/COM_BokehImageNode.cc index 6bc56aa5184..f25ac47fef9 100644 --- a/source/blender/compositor/nodes/COM_BokehImageNode.cc +++ b/source/blender/compositor/nodes/COM_BokehImageNode.cc @@ -15,7 +15,7 @@ void BokehImageNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { BokehImageOperation *operation = new BokehImageOperation(); - operation->set_data((NodeBokehImage *)this->get_bnode()->storage); + operation->set_data((const NodeBokehImage *)this->get_bnode()->storage); converter.add_operation(operation); converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.cc b/source/blender/compositor/nodes/COM_BoxMaskNode.cc index 41717804dba..c1a1b72d063 100644 --- a/source/blender/compositor/nodes/COM_BoxMaskNode.cc +++ b/source/blender/compositor/nodes/COM_BoxMaskNode.cc @@ -22,7 +22,7 @@ void BoxMaskNode::convert_to_operations(NodeConverter &converter, BoxMaskOperation *operation; operation = new BoxMaskOperation(); - operation->set_data((NodeBoxMask *)this->get_bnode()->storage); + operation->set_data((const NodeBoxMask *)this->get_bnode()->storage); operation->set_mask_type(this->get_bnode()->custom1); converter.add_operation(operation); diff --git a/source/blender/compositor/nodes/COM_BrightnessNode.cc b/source/blender/compositor/nodes/COM_BrightnessNode.cc index 88efd541fe9..a7877ca9378 100644 --- a/source/blender/compositor/nodes/COM_BrightnessNode.cc +++ b/source/blender/compositor/nodes/COM_BrightnessNode.cc @@ -14,7 +14,7 @@ BrightnessNode::BrightnessNode(bNode *editor_node) : Node(editor_node) void BrightnessNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); BrightnessOperation *operation = new BrightnessOperation(); operation->set_use_premultiply((bnode->custom1 & 1) != 0); converter.add_operation(operation); diff --git a/source/blender/compositor/nodes/COM_ChannelMatteNode.cc b/source/blender/compositor/nodes/COM_ChannelMatteNode.cc index 7592b5120e6..6a0a28cd171 100644 --- a/source/blender/compositor/nodes/COM_ChannelMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ChannelMatteNode.cc @@ -16,7 +16,7 @@ ChannelMatteNode::ChannelMatteNode(bNode *editor_node) : Node(editor_node) void ChannelMatteNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); NodeInput *input_socket_image = this->get_input_socket(0); NodeOutput *output_socket_image = this->get_output_socket(0); diff --git a/source/blender/compositor/nodes/COM_ChromaMatteNode.cc b/source/blender/compositor/nodes/COM_ChromaMatteNode.cc index cbc5a06ce11..35bf6210da5 100644 --- a/source/blender/compositor/nodes/COM_ChromaMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ChromaMatteNode.cc @@ -16,7 +16,7 @@ ChromaMatteNode::ChromaMatteNode(bNode *editor_node) : Node(editor_node) void ChromaMatteNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editorsnode = get_bnode(); + const bNode *editorsnode = get_bnode(); NodeInput *input_socket_image = this->get_input_socket(0); NodeInput *input_socket_key = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.cc b/source/blender/compositor/nodes/COM_ColorBalanceNode.cc index cb009ecc634..f3f5aa4e49b 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.cc +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.cc @@ -15,7 +15,7 @@ ColorBalanceNode::ColorBalanceNode(bNode *editor_node) : Node(editor_node) void ColorBalanceNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); NodeColorBalance *n = (NodeColorBalance *)node->storage; NodeInput *input_socket = this->get_input_socket(0); diff --git a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc index 2497f1d57bc..3e021296fee 100644 --- a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc +++ b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc @@ -14,7 +14,7 @@ ColorCorrectionNode::ColorCorrectionNode(bNode *editor_node) : Node(editor_node) void ColorCorrectionNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editor_node = get_bnode(); + const bNode *editor_node = get_bnode(); ColorCorrectionOperation *operation = new ColorCorrectionOperation(); operation->set_data((NodeColorCorrection *)editor_node->storage); diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.cc b/source/blender/compositor/nodes/COM_ColorCurveNode.cc index ba81d375846..5275bfcab84 100644 --- a/source/blender/compositor/nodes/COM_ColorCurveNode.cc +++ b/source/blender/compositor/nodes/COM_ColorCurveNode.cc @@ -16,7 +16,7 @@ void ColorCurveNode::convert_to_operations(NodeConverter &converter, { if (this->get_input_socket(2)->is_linked() || this->get_input_socket(3)->is_linked()) { ColorCurveOperation *operation = new ColorCurveOperation(); - operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + operation->set_curve_mapping((const CurveMapping *)this->get_bnode()->storage); converter.add_operation(operation); converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); @@ -33,7 +33,7 @@ void ColorCurveNode::convert_to_operations(NodeConverter &converter, operation->set_black_level(col); this->get_input_socket(3)->get_editor_value_color(col); operation->set_white_level(col); - operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + operation->set_curve_mapping((const CurveMapping *)this->get_bnode()->storage); converter.add_operation(operation); converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); diff --git a/source/blender/compositor/nodes/COM_ColorMatteNode.cc b/source/blender/compositor/nodes/COM_ColorMatteNode.cc index f8fccd53a91..163ca4c7573 100644 --- a/source/blender/compositor/nodes/COM_ColorMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ColorMatteNode.cc @@ -16,7 +16,7 @@ ColorMatteNode::ColorMatteNode(bNode *editor_node) : Node(editor_node) void ColorMatteNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editorsnode = get_bnode(); + const bNode *editorsnode = get_bnode(); NodeInput *input_socket_image = this->get_input_socket(0); NodeInput *input_socket_key = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_ColorRampNode.cc b/source/blender/compositor/nodes/COM_ColorRampNode.cc index fd91678800a..c2569a27fe6 100644 --- a/source/blender/compositor/nodes/COM_ColorRampNode.cc +++ b/source/blender/compositor/nodes/COM_ColorRampNode.cc @@ -18,7 +18,7 @@ void ColorRampNode::convert_to_operations(NodeConverter &converter, NodeInput *input_socket = this->get_input_socket(0); NodeOutput *output_socket = this->get_output_socket(0); NodeOutput *output_socket_alpha = this->get_output_socket(1); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); ColorRampOperation *operation = new ColorRampOperation(); operation->set_color_band((ColorBand *)editor_node->storage); diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.cc b/source/blender/compositor/nodes/COM_ColorSpillNode.cc index 118879ebdcc..448c3db6c46 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.cc +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.cc @@ -14,7 +14,7 @@ ColorSpillNode::ColorSpillNode(bNode *editor_node) : Node(editor_node) void ColorSpillNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editorsnode = get_bnode(); + const bNode *editorsnode = get_bnode(); NodeInput *input_socket_image = this->get_input_socket(0); NodeInput *input_socket_fac = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_CombineColorNode.cc b/source/blender/compositor/nodes/COM_CombineColorNode.cc index ca2c59478fd..36ff24cb9c3 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNode.cc +++ b/source/blender/compositor/nodes/COM_CombineColorNode.cc @@ -40,7 +40,7 @@ void CombineColorNode::convert_to_operations(NodeConverter &converter, converter.map_input_socket(input_bsocket, operation->get_input_socket(2)); converter.map_input_socket(input_asocket, operation->get_input_socket(3)); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); NodeCMPCombSepColor *storage = (NodeCMPCombSepColor *)editor_node->storage; NodeOperation *color_conv = nullptr; diff --git a/source/blender/compositor/nodes/COM_CombineColorNodeLegacy.cc b/source/blender/compositor/nodes/COM_CombineColorNodeLegacy.cc index d5ba379bfc2..8ab84715179 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNodeLegacy.cc +++ b/source/blender/compositor/nodes/COM_CombineColorNodeLegacy.cc @@ -65,7 +65,7 @@ NodeOperation *CombineHSVANode::get_color_converter(const CompositorContext & /* NodeOperation *CombineYCCANode::get_color_converter(const CompositorContext & /*context*/) const { ConvertYCCToRGBOperation *operation = new ConvertYCCToRGBOperation(); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); operation->set_mode(editor_node->custom1); return operation; } diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cc b/source/blender/compositor/nodes/COM_CompositorNode.cc index d9009e313dd..444dcbd5c6c 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.cc +++ b/source/blender/compositor/nodes/COM_CompositorNode.cc @@ -14,7 +14,7 @@ CompositorNode::CompositorNode(bNode *editor_node) : Node(editor_node) void CompositorNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); bool is_active = (editor_node->flag & NODE_DO_OUTPUT_RECALC) || context.is_rendering(); bool ignore_alpha = (editor_node->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc index 690be1c4551..98fae0a47bf 100644 --- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc +++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc @@ -10,7 +10,7 @@ void ConvertAlphaNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { NodeOperation *operation = nullptr; - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); /* value hardcoded in rna_nodetree.c */ if (node->custom1 == 1) { diff --git a/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc b/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc index 219b3acbd04..938ee80f4bd 100644 --- a/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc +++ b/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc @@ -27,7 +27,7 @@ ConvertColorSpaceNode::ConvertColorSpaceNode(bNode *editorNode) : Node(editorNod void ConvertColorSpaceNode::convert_to_operations(NodeConverter &converter, const CompositorContext &UNUSED(context)) const { - bNode *b_node = get_bnode(); + const bNode *b_node = get_bnode(); NodeInput *inputSocketImage = this->get_input_socket(0); NodeOutput *outputSocketImage = this->get_output_socket(0); @@ -50,7 +50,7 @@ void ConvertColorSpaceNode::convert_to_operations(NodeConverter &converter, bool ConvertColorSpaceNode::performs_conversion(NodeConvertColorSpace &settings) const { - bNode *b_node = get_bnode(); + const bNode *b_node = get_bnode(); if (IMB_colormanagement_space_name_is_data(settings.from_color_space)) { CLOG_INFO(&LOG, diff --git a/source/blender/compositor/nodes/COM_CropNode.cc b/source/blender/compositor/nodes/COM_CropNode.cc index fd07b028a01..849fb80a8a8 100644 --- a/source/blender/compositor/nodes/COM_CropNode.cc +++ b/source/blender/compositor/nodes/COM_CropNode.cc @@ -14,7 +14,7 @@ CropNode::CropNode(bNode *editor_node) : Node(editor_node) void CropNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = get_bnode(); + const bNode *node = get_bnode(); NodeTwoXYs *crop_settings = (NodeTwoXYs *)node->storage; bool relative = (bool)node->custom2; bool crop_image = (bool)node->custom1; diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cc b/source/blender/compositor/nodes/COM_CryptomatteNode.cc index b1cae5bfc24..42d699af01b 100644 --- a/source/blender/compositor/nodes/COM_CryptomatteNode.cc +++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cc @@ -23,8 +23,9 @@ void CryptomatteBaseNode::convert_to_operations(NodeConverter &converter, { NodeOutput *output_image_socket = this->get_output_socket(0); - bNode *node = this->get_bnode(); - NodeCryptomatte *cryptomatte_settings = static_cast<NodeCryptomatte *>(node->storage); + const bNode *node = this->get_bnode(); + const NodeCryptomatte *cryptomatte_settings = static_cast<const NodeCryptomatte *>( + node->storage); CryptomatteOperation *cryptomatte_operation = create_cryptomatte_operation( converter, context, *node, cryptomatte_settings); diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cc b/source/blender/compositor/nodes/COM_DefocusNode.cc index 26bb79a5846..40ccf0fad15 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.cc +++ b/source/blender/compositor/nodes/COM_DefocusNode.cc @@ -19,8 +19,8 @@ DefocusNode::DefocusNode(bNode *editor_node) : Node(editor_node) void DefocusNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *node = this->get_bnode(); - NodeDefocus *data = (NodeDefocus *)node->storage; + const bNode *node = this->get_bnode(); + const NodeDefocus *data = (const NodeDefocus *)node->storage; Scene *scene = node->id ? (Scene *)node->id : context.get_scene(); Object *camob = scene ? scene->camera : nullptr; diff --git a/source/blender/compositor/nodes/COM_DenoiseNode.cc b/source/blender/compositor/nodes/COM_DenoiseNode.cc index 301cb123359..81f45da475d 100644 --- a/source/blender/compositor/nodes/COM_DenoiseNode.cc +++ b/source/blender/compositor/nodes/COM_DenoiseNode.cc @@ -19,8 +19,8 @@ void DenoiseNode::convert_to_operations(NodeConverter &converter, return; } - bNode *node = this->get_bnode(); - NodeDenoise *denoise = (NodeDenoise *)node->storage; + const bNode *node = this->get_bnode(); + const NodeDenoise *denoise = (const NodeDenoise *)node->storage; DenoiseOperation *operation = new DenoiseOperation(); converter.add_operation(operation); diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.cc b/source/blender/compositor/nodes/COM_DespeckleNode.cc index cbdff384eda..c2601435f34 100644 --- a/source/blender/compositor/nodes/COM_DespeckleNode.cc +++ b/source/blender/compositor/nodes/COM_DespeckleNode.cc @@ -14,7 +14,7 @@ DespeckleNode::DespeckleNode(bNode *editor_node) : Node(editor_node) void DespeckleNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); NodeInput *input_socket = this->get_input_socket(0); NodeInput *input_image_socket = this->get_input_socket(1); NodeOutput *output_socket = this->get_output_socket(0); diff --git a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc index 7c5d1f69fb1..7ec90cb33d8 100644 --- a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc @@ -19,7 +19,7 @@ void DifferenceMatteNode::convert_to_operations(NodeConverter &converter, NodeInput *input_socket2 = this->get_input_socket(1); NodeOutput *output_socket_image = this->get_output_socket(0); NodeOutput *output_socket_matte = this->get_output_socket(1); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); DifferenceMatteOperation *operation_set = new DifferenceMatteOperation(); operation_set->set_settings((NodeChroma *)editor_node->storage); diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cc b/source/blender/compositor/nodes/COM_DilateErodeNode.cc index ee3ad8f4639..f1fc730776d 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cc +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cc @@ -27,8 +27,7 @@ DilateErodeNode::DilateErodeNode(bNode *editor_node) : Node(editor_node) void DilateErodeNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); if (editor_node->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation(); operation->set_distance(editor_node->custom2); diff --git a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc index b9477cc6783..52df671674b 100644 --- a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc +++ b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc @@ -14,7 +14,7 @@ DirectionalBlurNode::DirectionalBlurNode(bNode *editor_node) : Node(editor_node) void DirectionalBlurNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - NodeDBlurData *data = (NodeDBlurData *)this->get_bnode()->storage; + const NodeDBlurData *data = (const NodeDBlurData *)this->get_bnode()->storage; DirectionalBlurOperation *operation = new DirectionalBlurOperation(); operation->set_quality(context.get_quality()); operation->set_data(data); diff --git a/source/blender/compositor/nodes/COM_DistanceMatteNode.cc b/source/blender/compositor/nodes/COM_DistanceMatteNode.cc index ea0327d3d46..249fc48ab67 100644 --- a/source/blender/compositor/nodes/COM_DistanceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_DistanceMatteNode.cc @@ -16,8 +16,8 @@ DistanceMatteNode::DistanceMatteNode(bNode *editor_node) : Node(editor_node) void DistanceMatteNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editorsnode = get_bnode(); - NodeChroma *storage = (NodeChroma *)editorsnode->storage; + const bNode *editorsnode = this->get_bnode(); + const NodeChroma *storage = (const NodeChroma *)editorsnode->storage; NodeInput *input_socket_image = this->get_input_socket(0); NodeInput *input_socket_key = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc index eb4510a104c..7bd14d7a8d4 100644 --- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc +++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc @@ -15,7 +15,7 @@ void DoubleEdgeMaskNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { DoubleEdgeMaskOperation *operation; - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); operation = new DoubleEdgeMaskOperation(); operation->set_adjecent_only(bnode->custom1); diff --git a/source/blender/compositor/nodes/COM_GlareNode.cc b/source/blender/compositor/nodes/COM_GlareNode.cc index 0d7be486b9b..eec05482655 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.cc +++ b/source/blender/compositor/nodes/COM_GlareNode.cc @@ -20,8 +20,8 @@ GlareNode::GlareNode(bNode *editor_node) : Node(editor_node) void GlareNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = this->get_bnode(); - NodeGlare *glare = (NodeGlare *)node->storage; + const bNode *node = this->get_bnode(); +const NodeGlare *glare = (const NodeGlare *)node->storage; GlareBaseOperation *glareoperation = nullptr; switch (glare->type) { diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc index 8ae415b9c28..163cddb6f46 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc +++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc @@ -21,7 +21,7 @@ void HueSaturationValueCorrectNode::convert_to_operations( NodeInput *value_socket = this->get_input_socket(0); NodeInput *color_socket = this->get_input_socket(1); NodeOutput *output_socket = this->get_output_socket(0); - bNode *editorsnode = get_bnode(); + const bNode *editorsnode = get_bnode(); CurveMapping *storage = (CurveMapping *)editorsnode->storage; ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.cc b/source/blender/compositor/nodes/COM_IDMaskNode.cc index f9c284b916c..a1e08bee0cb 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.cc +++ b/source/blender/compositor/nodes/COM_IDMaskNode.cc @@ -14,7 +14,7 @@ IDMaskNode::IDMaskNode(bNode *editor_node) : Node(editor_node) void IDMaskNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); IDMaskOperation *operation; operation = new IDMaskOperation(); diff --git a/source/blender/compositor/nodes/COM_ImageNode.cc b/source/blender/compositor/nodes/COM_ImageNode.cc index 35031888d5c..a7cc6bf39df 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cc +++ b/source/blender/compositor/nodes/COM_ImageNode.cc @@ -55,7 +55,7 @@ void ImageNode::convert_to_operations(NodeConverter &converter, { /** Image output */ NodeOutput *output_image = this->get_output_socket(0); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); Image *image = (Image *)editor_node->id; ImageUser *imageuser = (ImageUser *)editor_node->storage; int framenumber = context.get_framenumber(); diff --git a/source/blender/compositor/nodes/COM_InpaintNode.cc b/source/blender/compositor/nodes/COM_InpaintNode.cc index 1b899163e4d..dd80380387f 100644 --- a/source/blender/compositor/nodes/COM_InpaintNode.cc +++ b/source/blender/compositor/nodes/COM_InpaintNode.cc @@ -15,7 +15,7 @@ void InpaintNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); /* if (editor_node->custom1 == CMP_NODE_INPAINT_SIMPLE) { */ if (true) { diff --git a/source/blender/compositor/nodes/COM_InvertNode.cc b/source/blender/compositor/nodes/COM_InvertNode.cc index 002136e5c2a..ce5c4f48f9e 100644 --- a/source/blender/compositor/nodes/COM_InvertNode.cc +++ b/source/blender/compositor/nodes/COM_InvertNode.cc @@ -16,7 +16,7 @@ void InvertNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { InvertOperation *operation = new InvertOperation(); - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); operation->set_color(node->custom1 & CMP_CHAN_RGB); operation->set_alpha(node->custom1 & CMP_CHAN_A); converter.add_operation(operation); diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cc b/source/blender/compositor/nodes/COM_KeyingNode.cc index 10e6b5597f2..a9138f026f7 100644 --- a/source/blender/compositor/nodes/COM_KeyingNode.cc +++ b/source/blender/compositor/nodes/COM_KeyingNode.cc @@ -205,8 +205,8 @@ NodeOperationOutput *KeyingNode::setup_clip(NodeConverter &converter, void KeyingNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); - NodeKeyingData *keying_data = (NodeKeyingData *)editor_node->storage; + const bNode *editor_node = this->get_bnode(); + const NodeKeyingData *keying_data = (const NodeKeyingData *)editor_node->storage; NodeInput *input_image = this->get_input_socket(0); NodeInput *input_screen = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.cc b/source/blender/compositor/nodes/COM_KeyingScreenNode.cc index 1e159e11966..7470d49bc1b 100644 --- a/source/blender/compositor/nodes/COM_KeyingScreenNode.cc +++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.cc @@ -14,7 +14,7 @@ KeyingScreenNode::KeyingScreenNode(bNode *editor_node) : Node(editor_node) void KeyingScreenNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); MovieClip *clip = (MovieClip *)editor_node->id; NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *)editor_node->storage; diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cc b/source/blender/compositor/nodes/COM_LensDistortionNode.cc index 3fe1125382e..5ed97c614ed 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cc +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cc @@ -15,7 +15,7 @@ LensDistortionNode::LensDistortionNode(bNode *editor_node) : Node(editor_node) void LensDistortionNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); NodeLensDist *data = (NodeLensDist *)editor_node->storage; if (data->proj) { ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation(); diff --git a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc index 00ae679581c..06e8eb58c4d 100644 --- a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc @@ -15,7 +15,7 @@ LuminanceMatteNode::LuminanceMatteNode(bNode *editor_node) : Node(editor_node) void LuminanceMatteNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *editorsnode = get_bnode(); + const bNode *editorsnode = get_bnode(); NodeInput *input_socket = this->get_input_socket(0); NodeOutput *output_socket_image = this->get_output_socket(0); NodeOutput *output_socket_matte = this->get_output_socket(1); diff --git a/source/blender/compositor/nodes/COM_MapUVNode.cc b/source/blender/compositor/nodes/COM_MapUVNode.cc index 54a24a94ad1..ed9bff657f3 100644 --- a/source/blender/compositor/nodes/COM_MapUVNode.cc +++ b/source/blender/compositor/nodes/COM_MapUVNode.cc @@ -14,7 +14,7 @@ MapUVNode::MapUVNode(bNode *editor_node) : Node(editor_node) void MapUVNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); MapUVOperation *operation = new MapUVOperation(); operation->set_alpha((float)node->custom1); diff --git a/source/blender/compositor/nodes/COM_MapValueNode.cc b/source/blender/compositor/nodes/COM_MapValueNode.cc index be7289e61b1..8b3c3cc3ec6 100644 --- a/source/blender/compositor/nodes/COM_MapValueNode.cc +++ b/source/blender/compositor/nodes/COM_MapValueNode.cc @@ -15,7 +15,7 @@ MapValueNode::MapValueNode(bNode *editor_node) : Node(editor_node) void MapValueNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - TexMapping *storage = (TexMapping *)this->get_bnode()->storage; + const TexMapping *storage = (const TexMapping *)this->get_bnode()->storage; NodeInput *color_socket = this->get_input_socket(0); NodeOutput *value_socket = this->get_output_socket(0); diff --git a/source/blender/compositor/nodes/COM_MaskNode.cc b/source/blender/compositor/nodes/COM_MaskNode.cc index 01f98416a9e..f92e307328d 100644 --- a/source/blender/compositor/nodes/COM_MaskNode.cc +++ b/source/blender/compositor/nodes/COM_MaskNode.cc @@ -19,8 +19,8 @@ void MaskNode::convert_to_operations(NodeConverter &converter, NodeOutput *output_mask = this->get_output_socket(0); - bNode *editor_node = this->get_bnode(); - NodeMask *data = (NodeMask *)editor_node->storage; + const bNode *editor_node = this->get_bnode(); + const NodeMask *data = (const NodeMask *)editor_node->storage; Mask *mask = (Mask *)editor_node->id; /* Always connect the output image. */ diff --git a/source/blender/compositor/nodes/COM_MixNode.cc b/source/blender/compositor/nodes/COM_MixNode.cc index a44dfc6caa6..e9179d7063c 100644 --- a/source/blender/compositor/nodes/COM_MixNode.cc +++ b/source/blender/compositor/nodes/COM_MixNode.cc @@ -21,7 +21,7 @@ void MixNode::convert_to_operations(NodeConverter &converter, NodeInput *color1Socket = this->get_input_socket(1); NodeInput *color2Socket = this->get_input_socket(2); NodeOutput *output_socket = this->get_output_socket(0); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); bool use_alpha_premultiply = (this->get_bnode()->custom2 & 1) != 0; bool use_clamp = (this->get_bnode()->custom2 & 2) != 0; diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.cc b/source/blender/compositor/nodes/COM_MovieClipNode.cc index d3f522fd8cd..e870cd7e0da 100644 --- a/source/blender/compositor/nodes/COM_MovieClipNode.cc +++ b/source/blender/compositor/nodes/COM_MovieClipNode.cc @@ -29,7 +29,7 @@ void MovieClipNode::convert_to_operations(NodeConverter &converter, NodeOutput *scale_movie_clip = this->get_output_socket(4); NodeOutput *angle_movie_clip = this->get_output_socket(5); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); MovieClip *movie_clip = (MovieClip *)editor_node->id; MovieClipUser *movie_clip_user = (MovieClipUser *)editor_node->storage; bool cache_frame = !context.is_rendering(); diff --git a/source/blender/compositor/nodes/COM_MovieDistortionNode.cc b/source/blender/compositor/nodes/COM_MovieDistortionNode.cc index 41ecfc24a8a..7c6e19c03dd 100644 --- a/source/blender/compositor/nodes/COM_MovieDistortionNode.cc +++ b/source/blender/compositor/nodes/COM_MovieDistortionNode.cc @@ -15,7 +15,7 @@ MovieDistortionNode::MovieDistortionNode(bNode *editor_node) : Node(editor_node) void MovieDistortionNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); MovieClip *clip = (MovieClip *)bnode->id; NodeInput *input_socket = this->get_input_socket(0); diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cc b/source/blender/compositor/nodes/COM_OutputFileNode.cc index a62d21bb657..c83bcf42efd 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cc +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cc @@ -50,7 +50,7 @@ void OutputFileNode::add_preview_to_first_linked_input(NodeConverter &converter) void OutputFileNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - NodeImageMultiFile *storage = (NodeImageMultiFile *)this->get_bnode()->storage; + const NodeImageMultiFile *storage = (const NodeImageMultiFile *)this->get_bnode()->storage; const bool is_multiview = (context.get_render_data()->scemode & R_MULTIVIEW) != 0; add_preview_to_first_linked_input(converter); @@ -99,8 +99,8 @@ void OutputFileNode::convert_to_operations(NodeConverter &converter, if (input->is_linked()) { NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->get_bnode_socket()->storage; - ImageFormatData *format = (sockdata->use_node_format ? &storage->format : - &sockdata->format); + const ImageFormatData *format = (sockdata->use_node_format ? &storage->format : + &sockdata->format); char path[FILE_MAX]; /* combine file path for the input */ diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc index a2037812677..308fd81a12d 100644 --- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc +++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc @@ -15,7 +15,7 @@ PlaneTrackDeformNode::PlaneTrackDeformNode(bNode *editor_node) : Node(editor_nod void PlaneTrackDeformNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); MovieClip *clip = (MovieClip *)editor_node->id; NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *)editor_node->storage; diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cc b/source/blender/compositor/nodes/COM_ScaleNode.cc index 6eea61b1568..4813e49cd11 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.cc +++ b/source/blender/compositor/nodes/COM_ScaleNode.cc @@ -17,7 +17,7 @@ ScaleNode::ScaleNode(bNode *editor_node) : Node(editor_node) void ScaleNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); NodeInput *input_socket = this->get_input_socket(0); NodeInput *input_xsocket = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_SeparateColorNode.cc b/source/blender/compositor/nodes/COM_SeparateColorNode.cc index a956c02ed42..28ebbb35e9a 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNode.cc +++ b/source/blender/compositor/nodes/COM_SeparateColorNode.cc @@ -20,8 +20,8 @@ void SeparateColorNode::convert_to_operations(NodeConverter &converter, NodeOutput *output_bsocket = this->get_output_socket(2); NodeOutput *output_asocket = this->get_output_socket(3); - bNode *editor_node = this->get_bnode(); - NodeCMPCombSepColor *storage = (NodeCMPCombSepColor *)editor_node->storage; + const bNode *editor_node = this->get_bnode(); + const NodeCMPCombSepColor *storage = (const NodeCMPCombSepColor *)editor_node->storage; NodeOperation *color_conv = nullptr; switch (storage->mode) { diff --git a/source/blender/compositor/nodes/COM_SeparateColorNodeLegacy.cc b/source/blender/compositor/nodes/COM_SeparateColorNodeLegacy.cc index c3728bc152f..11d8ca31d35 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNodeLegacy.cc +++ b/source/blender/compositor/nodes/COM_SeparateColorNodeLegacy.cc @@ -97,7 +97,7 @@ NodeOperation *SeparateHSVANode::get_color_converter(const CompositorContext & / NodeOperation *SeparateYCCANode::get_color_converter(const CompositorContext & /*context*/) const { ConvertRGBToYCCOperation *operation = new ConvertRGBToYCCOperation(); - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); operation->set_mode(editor_node->custom1); return operation; } diff --git a/source/blender/compositor/nodes/COM_SplitViewerNode.cc b/source/blender/compositor/nodes/COM_SplitViewerNode.cc index d02bc6e773d..0f21bd6e50d 100644 --- a/source/blender/compositor/nodes/COM_SplitViewerNode.cc +++ b/source/blender/compositor/nodes/COM_SplitViewerNode.cc @@ -16,7 +16,7 @@ SplitViewerNode::SplitViewerNode(bNode *editor_node) : Node(editor_node) void SplitViewerNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); bool do_output = (editor_node->flag & NODE_DO_OUTPUT_RECALC || context.is_rendering()) && (editor_node->flag & NODE_DO_OUTPUT); diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc index bcb1cf2accc..360e9e0bce3 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc @@ -18,7 +18,7 @@ Stabilize2dNode::Stabilize2dNode(bNode *editor_node) : Node(editor_node) void Stabilize2dNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); NodeInput *image_input = this->get_input_socket(0); MovieClip *clip = (MovieClip *)editor_node->id; bool invert = (editor_node->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0; diff --git a/source/blender/compositor/nodes/COM_SunBeamsNode.cc b/source/blender/compositor/nodes/COM_SunBeamsNode.cc index 197098f2ff4..ff154d9014e 100644 --- a/source/blender/compositor/nodes/COM_SunBeamsNode.cc +++ b/source/blender/compositor/nodes/COM_SunBeamsNode.cc @@ -16,7 +16,7 @@ void SunBeamsNode::convert_to_operations(NodeConverter &converter, { NodeInput *input_socket = this->get_input_socket(0); NodeOutput *output_socket = this->get_output_socket(0); - NodeSunBeams *data = (NodeSunBeams *)get_bnode()->storage; + const NodeSunBeams *data = (const NodeSunBeams *)get_bnode()->storage; SunBeamsOperation *operation = new SunBeamsOperation(); operation->set_data(*data); diff --git a/source/blender/compositor/nodes/COM_SwitchViewNode.cc b/source/blender/compositor/nodes/COM_SwitchViewNode.cc index ed9e311f1b4..9507b35b4ca 100644 --- a/source/blender/compositor/nodes/COM_SwitchViewNode.cc +++ b/source/blender/compositor/nodes/COM_SwitchViewNode.cc @@ -15,7 +15,7 @@ void SwitchViewNode::convert_to_operations(NodeConverter &converter, { NodeOperationOutput *result; const char *view_name = context.get_view_name(); - bNode *bnode = this->get_bnode(); + const bNode *bnode = this->get_bnode(); /* get the internal index of the socket with a matching name */ int nr = BLI_findstringindex(&bnode->inputs, view_name, offsetof(bNodeSocket, name)); diff --git a/source/blender/compositor/nodes/COM_TextureNode.cc b/source/blender/compositor/nodes/COM_TextureNode.cc index be5f7b90e11..44d4a41fcec 100644 --- a/source/blender/compositor/nodes/COM_TextureNode.cc +++ b/source/blender/compositor/nodes/COM_TextureNode.cc @@ -14,7 +14,7 @@ TextureNode::TextureNode(bNode *editor_node) : Node(editor_node) void TextureNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); Tex *texture = (Tex *)editor_node->id; TextureOperation *operation = new TextureOperation(); bool scene_color_manage = !STREQ(context.get_scene()->display_settings.display_device, "None"); diff --git a/source/blender/compositor/nodes/COM_TimeNode.cc b/source/blender/compositor/nodes/COM_TimeNode.cc index b3dbd74b795..4f4f6f7bf8a 100644 --- a/source/blender/compositor/nodes/COM_TimeNode.cc +++ b/source/blender/compositor/nodes/COM_TimeNode.cc @@ -18,7 +18,7 @@ void TimeNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { SetValueOperation *operation = new SetValueOperation(); - bNode *node = this->get_bnode(); + const bNode *node = this->get_bnode(); /* stack order output: fac */ float fac = 0.0f; diff --git a/source/blender/compositor/nodes/COM_TonemapNode.cc b/source/blender/compositor/nodes/COM_TonemapNode.cc index d20b9698163..f08798db19c 100644 --- a/source/blender/compositor/nodes/COM_TonemapNode.cc +++ b/source/blender/compositor/nodes/COM_TonemapNode.cc @@ -14,7 +14,7 @@ TonemapNode::TonemapNode(bNode *editor_node) : Node(editor_node) void TonemapNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { - NodeTonemap *data = (NodeTonemap *)this->get_bnode()->storage; + const NodeTonemap *data = (const NodeTonemap *)this->get_bnode()->storage; TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation(); diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.cc b/source/blender/compositor/nodes/COM_TrackPositionNode.cc index 1143ce81c80..da12f72b451 100644 --- a/source/blender/compositor/nodes/COM_TrackPositionNode.cc +++ b/source/blender/compositor/nodes/COM_TrackPositionNode.cc @@ -40,7 +40,7 @@ static TrackPositionOperation *create_motion_operation(NodeConverter &converter, void TrackPositionNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); MovieClip *clip = (MovieClip *)editor_node->id; NodeTrackPosData *trackpos_data = (NodeTrackPosData *)editor_node->storage; diff --git a/source/blender/compositor/nodes/COM_TranslateNode.cc b/source/blender/compositor/nodes/COM_TranslateNode.cc index 50c5b4c0d2c..8c53d773ad2 100644 --- a/source/blender/compositor/nodes/COM_TranslateNode.cc +++ b/source/blender/compositor/nodes/COM_TranslateNode.cc @@ -17,8 +17,8 @@ TranslateNode::TranslateNode(bNode *editor_node) : Node(editor_node) void TranslateNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *bnode = this->get_bnode(); - NodeTranslateData *data = (NodeTranslateData *)bnode->storage; + const bNode *bnode = this->get_bnode(); + const NodeTranslateData *data = (const NodeTranslateData *)bnode->storage; NodeInput *input_socket = this->get_input_socket(0); NodeInput *input_xsocket = this->get_input_socket(1); diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.cc b/source/blender/compositor/nodes/COM_VectorBlurNode.cc index f8a2a90ca81..90b8d5a2012 100644 --- a/source/blender/compositor/nodes/COM_VectorBlurNode.cc +++ b/source/blender/compositor/nodes/COM_VectorBlurNode.cc @@ -14,8 +14,8 @@ VectorBlurNode::VectorBlurNode(bNode *editor_node) : Node(editor_node) void VectorBlurNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *node = this->get_bnode(); - NodeBlurData *vector_blur_settings = (NodeBlurData *)node->storage; + const bNode *node = this->get_bnode(); + const NodeBlurData *vector_blur_settings = (const NodeBlurData *)node->storage; VectorBlurOperation *operation = new VectorBlurOperation(); operation->set_vector_blur_settings(vector_blur_settings); diff --git a/source/blender/compositor/nodes/COM_VectorCurveNode.cc b/source/blender/compositor/nodes/COM_VectorCurveNode.cc index c0871ab21e1..d42d2831bc9 100644 --- a/source/blender/compositor/nodes/COM_VectorCurveNode.cc +++ b/source/blender/compositor/nodes/COM_VectorCurveNode.cc @@ -15,7 +15,7 @@ void VectorCurveNode::convert_to_operations(NodeConverter &converter, const CompositorContext & /*context*/) const { VectorCurveOperation *operation = new VectorCurveOperation(); - operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + operation->set_curve_mapping((const CurveMapping *)this->get_bnode()->storage); converter.add_operation(operation); converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cc b/source/blender/compositor/nodes/COM_ViewerNode.cc index ebef331c62f..47056bcd8c4 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.cc +++ b/source/blender/compositor/nodes/COM_ViewerNode.cc @@ -15,7 +15,7 @@ ViewerNode::ViewerNode(bNode *editor_node) : Node(editor_node) void ViewerNode::convert_to_operations(NodeConverter &converter, const CompositorContext &context) const { - bNode *editor_node = this->get_bnode(); + const bNode *editor_node = this->get_bnode(); bool do_output = (editor_node->flag & NODE_DO_OUTPUT_RECALC || context.is_rendering()) && (editor_node->flag & NODE_DO_OUTPUT); bool ignore_alpha = (editor_node->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h index 751f1ad8d8e..28506ba36b5 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.h +++ b/source/blender/compositor/operations/COM_BokehImageOperation.h @@ -39,7 +39,7 @@ class BokehImageOperation : public MultiThreadedOperation { /** * \brief Settings of the bokeh image */ - NodeBokehImage *data_; + const NodeBokehImage *data_; /** * \brief precalculate center of the image @@ -119,7 +119,7 @@ class BokehImageOperation : public MultiThreadedOperation { * \brief set the node data * \param data: */ - void set_data(NodeBokehImage *data) + void set_data(const NodeBokehImage *data) { data_ = data; } diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.h b/source/blender/compositor/operations/COM_BoxMaskOperation.h index 9f18d110f3c..7e976cab6b6 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.h +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.h @@ -22,7 +22,7 @@ class BoxMaskOperation : public MultiThreadedOperation { float aspect_ratio_; int mask_type_; - NodeBoxMask *data_; + const NodeBoxMask *data_; public: BoxMaskOperation(); @@ -42,7 +42,7 @@ class BoxMaskOperation : public MultiThreadedOperation { */ void deinit_execution() override; - void set_data(NodeBoxMask *data) + void set_data(const NodeBoxMask *data) { data_ = data; } diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cc b/source/blender/compositor/operations/COM_CurveBaseOperation.cc index e92a2f08ed4..e7cbf0d28d5 100644 --- a/source/blender/compositor/operations/COM_CurveBaseOperation.cc +++ b/source/blender/compositor/operations/COM_CurveBaseOperation.cc @@ -33,7 +33,7 @@ void CurveBaseOperation::deinit_execution() } } -void CurveBaseOperation::set_curve_mapping(CurveMapping *mapping) +void CurveBaseOperation::set_curve_mapping(const CurveMapping *mapping) { /* duplicate the curve to avoid glitches while drawing, see bug T32374. */ if (curve_mapping_) { diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.h b/source/blender/compositor/operations/COM_CurveBaseOperation.h index d30c64e3282..4a745c34f24 100644 --- a/source/blender/compositor/operations/COM_CurveBaseOperation.h +++ b/source/blender/compositor/operations/COM_CurveBaseOperation.h @@ -26,7 +26,7 @@ class CurveBaseOperation : public MultiThreadedOperation { void init_execution() override; void deinit_execution() override; - void set_curve_mapping(CurveMapping *mapping); + void set_curve_mapping(const CurveMapping *mapping); }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cc b/source/blender/compositor/operations/COM_DenoiseOperation.cc index 1a199ba2eab..3f32eced0f8 100644 --- a/source/blender/compositor/operations/COM_DenoiseOperation.cc +++ b/source/blender/compositor/operations/COM_DenoiseOperation.cc @@ -163,7 +163,7 @@ void DenoiseOperation::deinit_execution() SingleThreadedOperation::deinit_execution(); } -static bool are_guiding_passes_noise_free(NodeDenoise *settings) +static bool are_guiding_passes_noise_free(const NodeDenoise *settings) { switch (settings->prefilter) { case CMP_NODE_DENOISE_PREFILTER_NONE: @@ -201,7 +201,7 @@ void DenoiseOperation::generate_denoise(MemoryBuffer *output, MemoryBuffer *input_color, MemoryBuffer *input_normal, MemoryBuffer *input_albedo, - NodeDenoise *settings) + const NodeDenoise *settings) { BLI_assert(input_color->get_buffer()); if (!input_color->get_buffer()) { diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.h b/source/blender/compositor/operations/COM_DenoiseOperation.h index 2b170bb9bb7..709b8843b93 100644 --- a/source/blender/compositor/operations/COM_DenoiseOperation.h +++ b/source/blender/compositor/operations/COM_DenoiseOperation.h @@ -37,7 +37,7 @@ class DenoiseOperation : public DenoiseBaseOperation { /** * \brief settings of the denoise node. */ - NodeDenoise *settings_; + const NodeDenoise *settings_; public: DenoiseOperation(); @@ -51,7 +51,7 @@ class DenoiseOperation : public DenoiseBaseOperation { */ void deinit_execution() override; - void set_denoise_settings(NodeDenoise *settings) + void set_denoise_settings(const NodeDenoise *settings) { settings_ = settings; } @@ -66,7 +66,7 @@ class DenoiseOperation : public DenoiseBaseOperation { MemoryBuffer *input_color, MemoryBuffer *input_normal, MemoryBuffer *input_albedo, - NodeDenoise *settings); + const NodeDenoise *settings); MemoryBuffer *create_memory_buffer(rcti *rect) override; }; diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h index e209bac2305..4e0b072dec9 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h @@ -11,7 +11,7 @@ namespace blender::compositor { class DirectionalBlurOperation : public MultiThreadedOperation, public QualityStepHelper { private: SocketReader *input_program_; - NodeDBlurData *data_; + const NodeDBlurData *data_; float center_x_pix_, center_y_pix_; float tx_, ty_; @@ -39,7 +39,7 @@ class DirectionalBlurOperation : public MultiThreadedOperation, public QualitySt ReadBufferOperation *read_operation, rcti *output) override; - void set_data(NodeDBlurData *data) + void set_data(const NodeDBlurData *data) { data_ = data; } diff --git a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h index 2cb21be43ad..7b1a38618fd 100644 --- a/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h +++ b/source/blender/compositor/operations/COM_DistanceRGBMatteOperation.h @@ -13,7 +13,7 @@ namespace blender::compositor { */ class DistanceRGBMatteOperation : public MultiThreadedOperation { protected: - NodeChroma *settings_; + const NodeChroma *settings_; SocketReader *input_image_program_; SocketReader *input_key_program_; @@ -33,7 +33,7 @@ class DistanceRGBMatteOperation : public MultiThreadedOperation { void init_execution() override; void deinit_execution() override; - void set_settings(NodeChroma *node_chroma) + void set_settings(const NodeChroma *node_chroma) { settings_ = node_chroma; } diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.h b/source/blender/compositor/operations/COM_GlareBaseOperation.h index 4750086a119..0a2c5507a76 100644 --- a/source/blender/compositor/operations/COM_GlareBaseOperation.h +++ b/source/blender/compositor/operations/COM_GlareBaseOperation.h @@ -32,7 +32,7 @@ class GlareBaseOperation : public SingleThreadedOperation { /** * \brief settings of the glare node. */ - NodeGlare *settings_; + const NodeGlare *settings_; bool is_output_rendered_; @@ -47,7 +47,7 @@ class GlareBaseOperation : public SingleThreadedOperation { */ void deinit_execution() override; - void set_glare_settings(NodeGlare *settings) + void set_glare_settings(const NodeGlare *settings) { settings_ = settings; } @@ -64,7 +64,9 @@ class GlareBaseOperation : public SingleThreadedOperation { protected: GlareBaseOperation(); - virtual void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) = 0; + virtual void generate_glare(float *data, + MemoryBuffer *input_tile, + const NodeGlare *settings) = 0; MemoryBuffer *create_memory_buffer(rcti *rect) override; }; diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc index 8b52123b2f0..ade3f11a8b3 100644 --- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc +++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc @@ -391,7 +391,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2) void GlareFogGlowOperation::generate_glare(float *data, MemoryBuffer *input_tile, - NodeGlare *settings) + const NodeGlare *settings) { int x, y; float scale, u, v, r, w, d; diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.h b/source/blender/compositor/operations/COM_GlareFogGlowOperation.h index 5e19f2ab2aa..2a74aeef048 100644 --- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.h +++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.h @@ -16,7 +16,7 @@ class GlareFogGlowOperation : public GlareBaseOperation { } protected: - void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) override; + void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings) override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.cc b/source/blender/compositor/operations/COM_GlareGhostOperation.cc index e863f74d98a..13b7af2329e 100644 --- a/source/blender/compositor/operations/COM_GlareGhostOperation.cc +++ b/source/blender/compositor/operations/COM_GlareGhostOperation.cc @@ -20,7 +20,7 @@ static float smooth_mask(float x, float y) void GlareGhostOperation::generate_glare(float *data, MemoryBuffer *input_tile, - NodeGlare *settings) + const NodeGlare *settings) { const int qt = 1 << settings->quality; const float s1 = 4.0f / (float)qt, s2 = 2.0f * s1; diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.h b/source/blender/compositor/operations/COM_GlareGhostOperation.h index 644c2975676..db79358034a 100644 --- a/source/blender/compositor/operations/COM_GlareGhostOperation.h +++ b/source/blender/compositor/operations/COM_GlareGhostOperation.h @@ -16,7 +16,7 @@ class GlareGhostOperation : public GlareBaseOperation { } protected: - void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) override; + void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings) override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc index a656eb3c706..69182b56bee 100644 --- a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc +++ b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.cc @@ -7,7 +7,7 @@ namespace blender::compositor { void GlareSimpleStarOperation::generate_glare(float *data, MemoryBuffer *input_tile, - NodeGlare *settings) + const NodeGlare *settings) { int i, x, y, ym, yp, xm, xp; float c[4] = {0, 0, 0, 0}, tc[4] = {0, 0, 0, 0}; diff --git a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h index 3c2d2fe2d0f..470af780eb2 100644 --- a/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h +++ b/source/blender/compositor/operations/COM_GlareSimpleStarOperation.h @@ -16,7 +16,7 @@ class GlareSimpleStarOperation : public GlareBaseOperation { } protected: - void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) override; + void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings) override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc index 233eb8caf38..e4f06eb0e50 100644 --- a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc +++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc @@ -7,7 +7,7 @@ namespace blender::compositor { void GlareStreaksOperation::generate_glare(float *data, MemoryBuffer *input_tile, - NodeGlare *settings) + const NodeGlare *settings) { int x, y, n; unsigned int nump = 0; diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.h b/source/blender/compositor/operations/COM_GlareStreaksOperation.h index 09ef30c339d..56afe3d8462 100644 --- a/source/blender/compositor/operations/COM_GlareStreaksOperation.h +++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.h @@ -16,7 +16,7 @@ class GlareStreaksOperation : public GlareBaseOperation { } protected: - void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) override; + void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings) override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h index 90870e3cca9..7930e32eda7 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h @@ -18,7 +18,7 @@ class GlareThresholdOperation : public MultiThreadedOperation { /** * \brief settings of the glare node. */ - NodeGlare *settings_; + const NodeGlare *settings_; public: GlareThresholdOperation(); @@ -38,7 +38,7 @@ class GlareThresholdOperation : public MultiThreadedOperation { */ void deinit_execution() override; - void set_glare_settings(NodeGlare *settings) + void set_glare_settings(const NodeGlare *settings) { settings_ = settings; } diff --git a/source/blender/compositor/operations/COM_MapValueOperation.cc b/source/blender/compositor/operations/COM_MapValueOperation.cc index 1353e0391a3..f55d394baa8 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.cc +++ b/source/blender/compositor/operations/COM_MapValueOperation.cc @@ -25,7 +25,7 @@ void MapValueOperation::execute_pixel_sampled(float output[4], { float src[4]; input_operation_->read_sampled(src, x, y, sampler); - TexMapping *texmap = settings_; + const TexMapping *texmap = settings_; float value = (src[0] + texmap->loc[0]) * texmap->size[0]; if (texmap->flag & TEXMAP_CLIP_MIN) { if (value < texmap->min[0]) { @@ -52,7 +52,7 @@ void MapValueOperation::update_memory_buffer_partial(MemoryBuffer *output, { for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) { const float input = *it.in(0); - TexMapping *texmap = settings_; + const TexMapping *texmap = settings_; float value = (input + texmap->loc[0]) * texmap->size[0]; if (texmap->flag & TEXMAP_CLIP_MIN) { if (value < texmap->min[0]) { diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h index 4c384e52c95..5c1f425c5bd 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.h +++ b/source/blender/compositor/operations/COM_MapValueOperation.h @@ -18,7 +18,7 @@ class MapValueOperation : public MultiThreadedOperation { * Cached reference to the input_program */ SocketReader *input_operation_; - TexMapping *settings_; + const TexMapping *settings_; public: /** @@ -44,7 +44,7 @@ class MapValueOperation : public MultiThreadedOperation { /** * \brief set the TexMapping settings */ - void set_settings(TexMapping *settings) + void set_settings(const TexMapping *settings) { settings_ = settings; } diff --git a/source/blender/compositor/operations/COM_TonemapOperation.cc b/source/blender/compositor/operations/COM_TonemapOperation.cc index fa40cd36f4c..714625e483d 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.cc +++ b/source/blender/compositor/operations/COM_TonemapOperation.cc @@ -46,7 +46,7 @@ void TonemapOperation::execute_pixel(float output[4], int x, int y, void *data) void PhotoreceptorTonemapOperation::execute_pixel(float output[4], int x, int y, void *data) { AvgLogLum *avg = (AvgLogLum *)data; - NodeTonemap *ntm = data_; + const NodeTonemap *ntm = data_; const float f = expf(-data_->f); const float m = (ntm->m > 0.0f) ? ntm->m : (0.3f + 0.7f * powf(avg->auto_key, 1.4f)); @@ -233,7 +233,7 @@ void PhotoreceptorTonemapOperation::update_memory_buffer_partial(MemoryBuffer *o Span<MemoryBuffer *> inputs) { AvgLogLum *avg = cached_instance_; - NodeTonemap *ntm = data_; + const NodeTonemap *ntm = data_; const float f = expf(-data_->f); const float m = (ntm->m > 0.0f) ? ntm->m : (0.3f + 0.7f * powf(avg->auto_key, 1.4f)); const float ic = 1.0f - ntm->c; diff --git a/source/blender/compositor/operations/COM_TonemapOperation.h b/source/blender/compositor/operations/COM_TonemapOperation.h index 7868aa140dc..8071470b3f4 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.h +++ b/source/blender/compositor/operations/COM_TonemapOperation.h @@ -34,7 +34,7 @@ class TonemapOperation : public MultiThreadedOperation { /** * \brief settings of the Tonemap */ - NodeTonemap *data_; + const NodeTonemap *data_; /** * \brief temporarily cache of the execution storage @@ -62,7 +62,7 @@ class TonemapOperation : public MultiThreadedOperation { */ void deinit_execution() override; - void set_data(NodeTonemap *data) + void set_data(const NodeTonemap *data) { data_ = data; } diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.h b/source/blender/compositor/operations/COM_VectorBlurOperation.h index 9c83c0645c2..0c4d215b6d3 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.h +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.h @@ -25,7 +25,7 @@ class VectorBlurOperation : public NodeOperation, public QualityStepHelper { /** * \brief settings of the glare node. */ - NodeBlurData *settings_; + const NodeBlurData *settings_; float *cached_instance_; @@ -49,7 +49,7 @@ class VectorBlurOperation : public NodeOperation, public QualityStepHelper { void *initialize_tile_data(rcti *rect) override; - void set_vector_blur_settings(NodeBlurData *settings) + void set_vector_blur_settings(const NodeBlurData *settings) { settings_ = settings; } diff --git a/source/blender/compositor/realtime_compositor/COM_shader_node.hh b/source/blender/compositor/realtime_compositor/COM_shader_node.hh index 453226ec452..50337935d03 100644 --- a/source/blender/compositor/realtime_compositor/COM_shader_node.hh +++ b/source/blender/compositor/realtime_compositor/COM_shader_node.hh @@ -73,7 +73,7 @@ class ShaderNode { const DNode &node() const; /* Returns a reference to the node this operations represents. */ - bNode &bnode() const; + const bNode &bnode() const; private: /* Populate the inputs of the node. The input link is set to nullptr and is expected to be diff --git a/source/blender/compositor/realtime_compositor/intern/shader_node.cc b/source/blender/compositor/realtime_compositor/intern/shader_node.cc index 9310de3cbf4..96dd50790c3 100644 --- a/source/blender/compositor/realtime_compositor/intern/shader_node.cc +++ b/source/blender/compositor/realtime_compositor/intern/shader_node.cc @@ -57,9 +57,9 @@ const DNode &ShaderNode::node() const return node_; } -bNode &ShaderNode::bnode() const +const bNode &ShaderNode::bnode() const { - return const_cast<bNode &>(*node_); + return *node_; } static eGPUType gpu_type_from_socket_type(eNodeSocketDatatype type) diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 51438d7909f..b203a21e6c2 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -162,7 +162,7 @@ GPUNodeLink *GPU_differentiate_float_function(const char *function_name); bool GPU_link(GPUMaterial *mat, const char *name, ...); bool GPU_stack_link(GPUMaterial *mat, - struct bNode *node, + const struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out, diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index 377cbc53893..db8d55ec196 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -179,7 +179,7 @@ static const char *gpu_uniform_set_function_from_type(eNodeSocketDatatype type) * This is called for the input/output sockets that are not connected. */ static GPUNodeLink *gpu_uniformbuffer_link(GPUMaterial *mat, - bNode *node, + const bNode *node, GPUNodeStack *stack, const int index, const eNodeSocketInOut in_out) @@ -214,7 +214,7 @@ static GPUNodeLink *gpu_uniformbuffer_link(GPUMaterial *mat, } static void gpu_node_input_socket( - GPUMaterial *material, bNode *bnode, GPUNode *node, GPUNodeStack *sock, const int index) + GPUMaterial *material, const bNode *bnode, GPUNode *node, GPUNodeStack *sock, const int index) { if (sock->link) { gpu_node_input_link(node, sock->link, sock->type); @@ -652,7 +652,7 @@ bool GPU_link(GPUMaterial *mat, const char *name, ...) } static bool gpu_stack_link_v(GPUMaterial *material, - bNode *bnode, + const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out, @@ -724,7 +724,7 @@ static bool gpu_stack_link_v(GPUMaterial *material, } bool GPU_stack_link(GPUMaterial *material, - bNode *bnode, + const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out, diff --git a/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc b/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc index 64c59eb24e3..282d3365fa5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc +++ b/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc @@ -86,7 +86,7 @@ class AlphaOverShaderNode : public ShaderNode { float get_premultiply_factor() { - return ((NodeTwoFloats *)bnode().storage)->x; + return ((const NodeTwoFloats *)bnode().storage)->x; } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc index 5aa810b61bb..571415e75d8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc @@ -103,9 +103,9 @@ class BilateralBlurOperation : public NodeOperation { return get_node_bilateral_blur_data().sigma_color; } - NodeBilateralBlurData &get_node_bilateral_blur_data() + const NodeBilateralBlurData &get_node_bilateral_blur_data() { - return *static_cast<NodeBilateralBlurData *>(bnode().storage); + return *static_cast<const NodeBilateralBlurData *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc b/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc index 13c3b793148..42dd17230b1 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc @@ -86,9 +86,9 @@ class BokehImageOperation : public NodeOperation { return Domain(int2(512)); } - NodeBokehImage &get_node_bokeh_image() + const NodeBokehImage &get_node_bokeh_image() { - return *static_cast<NodeBokehImage *>(bnode().storage); + return *static_cast<const NodeBokehImage *>(bnode().storage); } /* The exterior angle is the angle between each two consecutive vertices of the regular polygon diff --git a/source/blender/nodes/composite/nodes/node_composite_boxmask.cc b/source/blender/nodes/composite/nodes/node_composite_boxmask.cc index 9c7bb6432cb..2b27b382b03 100644 --- a/source/blender/nodes/composite/nodes/node_composite_boxmask.cc +++ b/source/blender/nodes/composite/nodes/node_composite_boxmask.cc @@ -123,9 +123,9 @@ class BoxMaskOperation : public NodeOperation { } } - NodeBoxMask &get_node_box_mask() + const NodeBoxMask &get_node_box_mask() { - return *static_cast<NodeBoxMask *>(bnode().storage); + return *static_cast<const NodeBoxMask *>(bnode().storage); } float2 get_location() diff --git a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc index 018632f776c..a588a17d6c1 100644 --- a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc @@ -130,9 +130,9 @@ class ChannelMatteShaderNode : public ShaderNode { return bnode().custom2 - 1; } - NodeChroma *get_node_chroma() + const NodeChroma *get_node_chroma() { - return static_cast<NodeChroma *>(bnode().storage); + return static_cast<const NodeChroma *>(bnode().storage); } /* Get the index of the channel used to compute the limit value. */ diff --git a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc index cb3648c5680..2ea83340c2b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc @@ -86,9 +86,9 @@ class ChromaMatteShaderNode : public ShaderNode { GPU_uniform(&falloff)); } - NodeChroma *get_node_chroma() + const NodeChroma *get_node_chroma() { - return static_cast<NodeChroma *>(bnode().storage); + return static_cast<const NodeChroma *>(bnode().storage); } float get_acceptance() diff --git a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc index 5e3aaf512e6..ec572c54fd7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc @@ -83,9 +83,9 @@ class ColorMatteShaderNode : public ShaderNode { GPU_uniform(&value_epsilon)); } - NodeChroma *get_node_chroma() + const NodeChroma *get_node_chroma() { - return static_cast<NodeChroma *>(bnode().storage); + return static_cast<const NodeChroma *>(bnode().storage); } float get_hue_epsilon() diff --git a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc index 9744c01a256..1ddf0df8ea7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc +++ b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc @@ -131,9 +131,9 @@ class ColorSpillShaderNode : public ShaderNode { return (CMPNodeColorSpillLimitAlgorithm)bnode().custom2; } - NodeColorspill *get_node_color_spill() + const NodeColorspill *get_node_color_spill() { - return static_cast<NodeColorspill *>(bnode().storage); + return static_cast<const NodeColorspill *>(bnode().storage); } void get_spill_scale(float spill_scale[3]) diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc index 95675169c76..e6e2a310eb4 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc @@ -191,9 +191,9 @@ class ColorBalanceShaderNode : public ShaderNode { return (CMPNodeColorBalanceMethod)bnode().custom1; } - NodeColorBalance *get_node_color_balance() + const NodeColorBalance *get_node_color_balance() { - return static_cast<NodeColorBalance *>(bnode().storage); + return static_cast<const NodeColorBalance *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc index 36e6672ce1c..f6bc3d1fdf2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc +++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc @@ -334,9 +334,9 @@ class ColorCorrectionShaderNode : public ShaderNode { } } - NodeColorCorrection *get_node_color_correction() + const NodeColorCorrection *get_node_color_correction() { - return static_cast<NodeColorCorrection *>(bnode().storage); + return static_cast<const NodeColorCorrection *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.cc b/source/blender/nodes/composite/nodes/node_composite_crop.cc index d7331732fc7..466c842812c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_crop.cc +++ b/source/blender/nodes/composite/nodes/node_composite_crop.cc @@ -163,9 +163,9 @@ class CropOperation : public NodeOperation { return bnode().custom2; } - NodeTwoXYs &get_node_two_xys() + const NodeTwoXYs &get_node_two_xys() { - return *static_cast<NodeTwoXYs *>(bnode().storage); + return *static_cast<const NodeTwoXYs *>(bnode().storage); } /* Returns true if the operation does nothing and the input can be passed through. */ diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.cc b/source/blender/nodes/composite/nodes/node_composite_curves.cc index c5d303c576a..bf45e219730 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.cc +++ b/source/blender/nodes/composite/nodes/node_composite_curves.cc @@ -47,15 +47,15 @@ class TimeCurveOperation : public NodeOperation { Result &result = get_result("Fac"); result.allocate_single_value(); - CurveMapping *curve_mapping = get_curve_mapping(); + CurveMapping *curve_mapping = const_cast<CurveMapping *>(get_curve_mapping()); BKE_curvemapping_init(curve_mapping); const float time = BKE_curvemapping_evaluateF(curve_mapping, 0, compute_normalized_time()); result.set_float_value(clamp_f(time, 0.0f, 1.0f)); } - CurveMapping *get_curve_mapping() + const CurveMapping *get_curve_mapping() { - return static_cast<CurveMapping *>(bnode().storage); + return static_cast<const CurveMapping *>(bnode().storage); } int get_start_time() @@ -143,7 +143,7 @@ class VectorCurvesShaderNode : public ShaderNode { GPUNodeStack *inputs = get_inputs_array(); GPUNodeStack *outputs = get_outputs_array(); - CurveMapping *curve_mapping = get_curve_mapping(); + CurveMapping *curve_mapping = const_cast<CurveMapping *>(get_curve_mapping()); BKE_curvemapping_init(curve_mapping); float *band_values; @@ -173,9 +173,9 @@ class VectorCurvesShaderNode : public ShaderNode { GPU_uniform(end_slopes)); } - CurveMapping *get_curve_mapping() + const CurveMapping *get_curve_mapping() { - return static_cast<CurveMapping *>(bnode().storage); + return static_cast<const CurveMapping *>(bnode().storage); } }; @@ -239,7 +239,7 @@ class RGBCurvesShaderNode : public ShaderNode { GPUNodeStack *inputs = get_inputs_array(); GPUNodeStack *outputs = get_outputs_array(); - CurveMapping *curve_mapping = get_curve_mapping(); + CurveMapping *curve_mapping = const_cast<CurveMapping *>(get_curve_mapping()); BKE_curvemapping_init(curve_mapping); float *band_values; @@ -311,9 +311,9 @@ class RGBCurvesShaderNode : public ShaderNode { GPU_uniform(end_slopes)); } - CurveMapping *get_curve_mapping() + const CurveMapping *get_curve_mapping() { - return static_cast<CurveMapping *>(bnode().storage); + return static_cast<const CurveMapping *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc b/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc index e129dcaa6ef..3c830f1deec 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc @@ -71,9 +71,9 @@ class DifferenceMatteShaderNode : public ShaderNode { GPU_uniform(&falloff)); } - NodeChroma *get_node_chroma() + const NodeChroma *get_node_chroma() { - return static_cast<NodeChroma *>(bnode().storage); + return static_cast<const NodeChroma *>(bnode().storage); } float get_tolerance() diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc b/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc index 028dd6bfbf0..b662924acec 100644 --- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc @@ -181,9 +181,9 @@ class DirectionalBlurOperation : public NodeOperation { return true; } - NodeDBlurData &get_node_directional_blur_data() + const NodeDBlurData &get_node_directional_blur_data() { - return *static_cast<NodeDBlurData *>(bnode().storage); + return *static_cast<const NodeDBlurData *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc b/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc index 9d910b3f409..be73412e027 100644 --- a/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc @@ -90,9 +90,9 @@ class DistanceMatteShaderNode : public ShaderNode { GPU_uniform(&falloff)); } - NodeChroma *get_node_chroma() + const NodeChroma *get_node_chroma() { - return static_cast<NodeChroma *>(bnode().storage); + return static_cast<const NodeChroma *>(bnode().storage); } CMPNodeDistanceMatteColorSpace get_color_space() diff --git a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc index 54dfa00eadd..d9d8a888f24 100644 --- a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc +++ b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc @@ -121,9 +121,9 @@ class EllipseMaskOperation : public NodeOperation { } } - NodeEllipseMask &get_node_ellipse_mask() + const NodeEllipseMask &get_node_ellipse_mask() { - return *static_cast<NodeEllipseMask *>(bnode().storage); + return *static_cast<const NodeEllipseMask *>(bnode().storage); } float2 get_location() diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc b/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc index a84420231aa..6333860a19b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc +++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc @@ -59,7 +59,7 @@ class HueCorrectShaderNode : public ShaderNode { GPUNodeStack *inputs = get_inputs_array(); GPUNodeStack *outputs = get_outputs_array(); - CurveMapping *curve_mapping = get_curve_mapping(); + CurveMapping *curve_mapping = const_cast<CurveMapping *>(get_curve_mapping()); BKE_curvemapping_init(curve_mapping); float *band_values; @@ -84,9 +84,9 @@ class HueCorrectShaderNode : public ShaderNode { GPU_uniform(range_dividers)); } - CurveMapping *get_curve_mapping() + const CurveMapping *get_curve_mapping() { - return static_cast<CurveMapping *>(bnode().storage); + return static_cast<const CurveMapping *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_map_value.cc b/source/blender/nodes/composite/nodes/node_composite_map_value.cc index ec9b2d56636..2b0aebbede8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_map_value.cc +++ b/source/blender/nodes/composite/nodes/node_composite_map_value.cc @@ -87,9 +87,9 @@ class MapValueShaderNode : public ShaderNode { GPU_uniform(texture_mapping->max)); } - TexMapping *get_texture_mapping() + const TexMapping *get_texture_mapping() { - return static_cast<TexMapping *>(bnode().storage); + return static_cast<const TexMapping *>(bnode().storage); } bool get_use_min() diff --git a/source/blender/nodes/composite/nodes/node_composite_rgb.cc b/source/blender/nodes/composite/nodes/node_composite_rgb.cc index 6f3a00af7e3..f107961f301 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rgb.cc +++ b/source/blender/nodes/composite/nodes/node_composite_rgb.cc @@ -33,8 +33,8 @@ class RGBOperation : public NodeOperation { Result &result = get_result("RGBA"); result.allocate_single_value(); - const bNodeSocket *socket = static_cast<bNodeSocket *>(bnode().outputs.first); - float4 color = float4(static_cast<bNodeSocketValueRGBA *>(socket->default_value)->value); + const bNodeSocket *socket = static_cast<const bNodeSocket *>(bnode().outputs.first); + float4 color = float4(static_cast<const bNodeSocketValueRGBA *>(socket->default_value)->value); result.set_color_value(color); } diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.cc b/source/blender/nodes/composite/nodes/node_composite_setalpha.cc index 9930125aa70..383b4bcd0ca 100644 --- a/source/blender/nodes/composite/nodes/node_composite_setalpha.cc +++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.cc @@ -62,9 +62,9 @@ class SetAlphaShaderNode : public ShaderNode { GPU_stack_link(material, &bnode(), "node_composite_set_alpha_replace", inputs, outputs); } - NodeSetAlpha *get_node_set_alpha() + const NodeSetAlpha *get_node_set_alpha() { - return static_cast<NodeSetAlpha *>(bnode().storage); + return static_cast<const NodeSetAlpha *>(bnode().storage); } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.cc b/source/blender/nodes/composite/nodes/node_composite_translate.cc index fbd53b8310f..dcb67b9be90 100644 --- a/source/blender/nodes/composite/nodes/node_composite_translate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_translate.cc @@ -76,9 +76,9 @@ class TranslateOperation : public NodeOperation { result.get_realization_options().repeat_y = get_repeat_y(); } - NodeTranslateData &get_node_translate() + const NodeTranslateData &get_node_translate() { - return *static_cast<NodeTranslateData *>(bnode().storage); + return *static_cast<const NodeTranslateData *>(bnode().storage); } bool get_use_relative() |