Cleanup: Use const for node data in compositor

Push the const usage a bit further for compositor nodes, so that they
are more explicit about not modifying original nodes from the editor.

Differential Revision: https://developer.blender.org/D15822
This commit is contained in:
Hans Goudey 2022-08-31 11:49:35 -05:00
parent fae955fdb1
commit 91d9f46aec
112 changed files with 180 additions and 178 deletions

View File

@ -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_;
}

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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) {

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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. */

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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));

View File

@ -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");

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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));

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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_) {

View File

@ -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

View File

@ -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()) {

View File

@ -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;
};

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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};

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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]) {

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -86,7 +86,7 @@ class AlphaOverShaderNode : public ShaderNode {
float get_premultiply_factor()
{
return ((NodeTwoFloats *)bnode().storage)->x;
return ((const NodeTwoFloats *)bnode().storage)->x;
}
};

View File

@ -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);
}
};

View File

@ -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

View File

@ -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()

View File

@ -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. */

View File

@ -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()

View File

@ -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()

View File

@ -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])

View File

@ -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);
}
};

Some files were not shown because too many files have changed in this diff Show More