Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:01:15 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:41:14 +0300
commit1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch)
tree68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/nodes/COM_CryptomatteNode.cc
parenta2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (diff)
Cleanup: convert camelCase naming to snake_case in Compositor
To convert old code to the current convention and use a single code style.
Diffstat (limited to 'source/blender/compositor/nodes/COM_CryptomatteNode.cc')
-rw-r--r--source/blender/compositor/nodes/COM_CryptomatteNode.cc86
1 files changed, 43 insertions, 43 deletions
diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cc b/source/blender/compositor/nodes/COM_CryptomatteNode.cc
index 21596d5aebb..f54088627e1 100644
--- a/source/blender/compositor/nodes/COM_CryptomatteNode.cc
+++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cc
@@ -30,41 +30,41 @@ namespace blender::compositor {
/** \name Cryptomatte Base
* \{ */
-void CryptomatteBaseNode::convertToOperations(NodeConverter &converter,
- const CompositorContext &context) const
+void CryptomatteBaseNode::convert_to_operations(NodeConverter &converter,
+ const CompositorContext &context) const
{
- NodeOutput *output_image_socket = this->getOutputSocket(0);
+ NodeOutput *output_image_socket = this->get_output_socket(0);
- bNode *node = this->getbNode();
+ bNode *node = this->get_bnode();
NodeCryptomatte *cryptomatte_settings = static_cast<NodeCryptomatte *>(node->storage);
CryptomatteOperation *cryptomatte_operation = create_cryptomatte_operation(
converter, context, *node, cryptomatte_settings);
- converter.addOperation(cryptomatte_operation);
+ converter.add_operation(cryptomatte_operation);
- NodeOutput *output_matte_socket = this->getOutputSocket(1);
+ NodeOutput *output_matte_socket = this->get_output_socket(1);
SeparateChannelOperation *extract_mask_operation = new SeparateChannelOperation;
- extract_mask_operation->setChannel(3);
- converter.addOperation(extract_mask_operation);
- converter.addLink(cryptomatte_operation->getOutputSocket(0),
- extract_mask_operation->getInputSocket(0));
- converter.mapOutputSocket(output_matte_socket, extract_mask_operation->getOutputSocket(0));
+ extract_mask_operation->set_channel(3);
+ converter.add_operation(extract_mask_operation);
+ converter.add_link(cryptomatte_operation->get_output_socket(0),
+ extract_mask_operation->get_input_socket(0));
+ converter.map_output_socket(output_matte_socket, extract_mask_operation->get_output_socket(0));
- NodeInput *input_image_socket = this->getInputSocket(0);
+ NodeInput *input_image_socket = this->get_input_socket(0);
SetAlphaMultiplyOperation *apply_mask_operation = new SetAlphaMultiplyOperation();
- converter.mapInputSocket(input_image_socket, apply_mask_operation->getInputSocket(0));
- converter.addOperation(apply_mask_operation);
- converter.addLink(extract_mask_operation->getOutputSocket(0),
- apply_mask_operation->getInputSocket(1));
- converter.mapOutputSocket(output_image_socket, apply_mask_operation->getOutputSocket(0));
+ converter.map_input_socket(input_image_socket, apply_mask_operation->get_input_socket(0));
+ converter.add_operation(apply_mask_operation);
+ converter.add_link(extract_mask_operation->get_output_socket(0),
+ apply_mask_operation->get_input_socket(1));
+ converter.map_output_socket(output_image_socket, apply_mask_operation->get_output_socket(0));
- NodeOutput *output_pick_socket = this->getOutputSocket(2);
+ NodeOutput *output_pick_socket = this->get_output_socket(2);
SetAlphaMultiplyOperation *extract_pick_operation = new SetAlphaMultiplyOperation();
- converter.addOperation(extract_pick_operation);
- converter.addInputValue(extract_pick_operation->getInputSocket(1), 1.0f);
- converter.addLink(cryptomatte_operation->getOutputSocket(0),
- extract_pick_operation->getInputSocket(0));
- converter.mapOutputSocket(output_pick_socket, extract_pick_operation->getOutputSocket(0));
+ converter.add_operation(extract_pick_operation);
+ converter.add_input_value(extract_pick_operation->get_input_socket(1), 1.0f);
+ converter.add_link(cryptomatte_operation->get_output_socket(0),
+ extract_pick_operation->get_input_socket(0));
+ converter.map_output_socket(output_pick_socket, extract_pick_operation->get_output_socket(0));
}
/** \} */
@@ -76,7 +76,7 @@ void CryptomatteBaseNode::convertToOperations(NodeConverter &converter,
static std::string prefix_from_node(const CompositorContext &context, const bNode &node)
{
char prefix[MAX_NAME];
- ntreeCompositCryptomatteLayerPrefix(context.getScene(), &node, prefix, sizeof(prefix));
+ ntreeCompositCryptomatteLayerPrefix(context.get_scene(), &node, prefix, sizeof(prefix));
return std::string(prefix, BLI_strnlen(prefix, sizeof(prefix)));
}
@@ -120,7 +120,7 @@ void CryptomatteNode::input_operations_from_render_source(
RenderLayer *render_layer = RE_GetRenderLayer(render_result, view_layer->name);
if (render_layer) {
LISTBASE_FOREACH (RenderPass *, render_pass, &render_layer->passes) {
- if (context.has_explicit_view() && !STREQ(render_pass->view, context.getViewName())) {
+ if (context.has_explicit_view() && !STREQ(render_pass->view, context.get_view_name())) {
continue;
}
@@ -128,10 +128,10 @@ void CryptomatteNode::input_operations_from_render_source(
if (blender::StringRef(combined_name).startswith(prefix)) {
RenderLayersProg *op = new RenderLayersProg(
render_pass->name, DataType::Color, render_pass->channels);
- op->setScene(scene);
- op->setLayerId(view_layer_id);
- op->setRenderData(context.getRenderData());
- op->setViewName(context.getViewName());
+ op->set_scene(scene);
+ op->set_layer_id(view_layer_id);
+ op->set_render_data(context.get_render_data());
+ op->set_view_name(context.get_view_name());
r_input_operations.append(op);
}
}
@@ -157,7 +157,7 @@ void CryptomatteNode::input_operations_from_image_source(
}
ImageUser *iuser = &cryptomatte_settings->iuser;
- BKE_image_user_frame_calc(image, iuser, context.getFramenumber());
+ BKE_image_user_frame_calc(image, iuser, context.get_framenumber());
ImBuf *ibuf = BKE_image_acquire_ibuf(image, iuser, nullptr);
if (image->rr) {
@@ -167,7 +167,7 @@ void CryptomatteNode::input_operations_from_image_source(
/* Heuristic to match image name with scene names, check if the view name exists in the
* image. */
view = BLI_findstringindex(
- &image->rr->views, context.getViewName(), offsetof(RenderView, name));
+ &image->rr->views, context.get_view_name(), offsetof(RenderView, name));
if (view == -1) {
view = 0;
}
@@ -189,10 +189,10 @@ void CryptomatteNode::input_operations_from_image_source(
if (blender::StringRef(combined_name).startswith(prefix)) {
MultilayerColorOperation *op = new MultilayerColorOperation(
render_layer, render_pass, view);
- op->setImage(image);
- op->setImageUser(iuser);
+ op->set_image(image);
+ op->set_image_user(iuser);
iuser->layer = layer_index;
- op->setFramenumber(context.getFramenumber());
+ op->set_framenumber(context.get_framenumber());
r_input_operations.append(op);
}
}
@@ -217,10 +217,10 @@ Vector<NodeOperation *> CryptomatteNode::create_input_operations(const Composito
if (input_operations.is_empty()) {
SetColorOperation *op = new SetColorOperation();
- op->setChannel1(0.0f);
- op->setChannel2(1.0f);
- op->setChannel3(0.0f);
- op->setChannel4(0.0f);
+ op->set_channel1(0.0f);
+ op->set_channel2(1.0f);
+ op->set_channel3(0.0f);
+ op->set_channel4(0.0f);
input_operations.append(op);
}
return input_operations;
@@ -234,11 +234,11 @@ CryptomatteOperation *CryptomatteNode::create_cryptomatte_operation(
Vector<NodeOperation *> input_operations = create_input_operations(context, node);
CryptomatteOperation *operation = new CryptomatteOperation(input_operations.size());
LISTBASE_FOREACH (CryptomatteEntry *, cryptomatte_entry, &cryptomatte_settings->entries) {
- operation->addObjectIndex(cryptomatte_entry->encoded_hash);
+ operation->add_object_index(cryptomatte_entry->encoded_hash);
}
for (int i = 0; i < input_operations.size(); ++i) {
- converter.addOperation(input_operations[i]);
- converter.addLink(input_operations[i]->getOutputSocket(), operation->getInputSocket(i));
+ converter.add_operation(input_operations[i]);
+ converter.add_link(input_operations[i]->get_output_socket(), operation->get_input_socket(i));
}
return operation;
}
@@ -259,12 +259,12 @@ CryptomatteOperation *CryptomatteLegacyNode::create_cryptomatte_operation(
CryptomatteOperation *operation = new CryptomatteOperation(num_inputs);
if (cryptomatte_settings) {
LISTBASE_FOREACH (CryptomatteEntry *, cryptomatte_entry, &cryptomatte_settings->entries) {
- operation->addObjectIndex(cryptomatte_entry->encoded_hash);
+ operation->add_object_index(cryptomatte_entry->encoded_hash);
}
}
for (int i = 0; i < num_inputs; i++) {
- converter.mapInputSocket(this->getInputSocket(i + 1), operation->getInputSocket(i));
+ converter.map_input_socket(this->get_input_socket(i + 1), operation->get_input_socket(i));
}
return operation;