Blender V4.3
COM_SceneTimeNode.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "COM_SceneTimeNode.h"
6
8
9namespace blender::compositor {
10
11SceneTimeNode::SceneTimeNode(bNode *editor_node) : Node(editor_node)
12{
13 /* pass */
14}
15
17 const CompositorContext &context) const
18{
19 SetValueOperation *SecondOperation = new SetValueOperation();
20 SetValueOperation *frameOperation = new SetValueOperation();
21
22 const int frameNumber = context.get_framenumber();
23 const Scene *scene = context.get_scene();
24 const double frameRate = double(scene->r.frs_sec) / double(scene->r.frs_sec_base);
25
26 SecondOperation->set_value(float(frameNumber / frameRate));
27 converter.add_operation(SecondOperation);
28
29 frameOperation->set_value(frameNumber);
30 converter.add_operation(frameOperation);
31
32 converter.map_output_socket(get_output_socket(0), SecondOperation->get_output_socket());
33 converter.map_output_socket(get_output_socket(1), frameOperation->get_output_socket());
34}
35
36} // namespace blender::compositor
typedef double(DMatrix)[4][4]
Overall context of the compositor.
void map_output_socket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
void add_operation(NodeOperation *operation)
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOutput * get_output_socket(unsigned int index=0) const
Definition COM_Node.cc:85
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation