Blender  V3.3
COM_SceneTimeNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. */
3 
4 #include "COM_SceneTimeNode.h"
5 
7 
8 namespace blender::compositor {
9 
10 SceneTimeNode::SceneTimeNode(bNode *editor_node) : Node(editor_node)
11 {
12  /* pass */
13 }
14 
16  const CompositorContext &context) const
17 {
18  SetValueOperation *SecondOperation = new SetValueOperation();
19  SetValueOperation *frameOperation = new SetValueOperation();
20 
21  const int frameNumber = context.get_framenumber();
22  const Scene *scene = context.get_scene();
23  const double frameRate = (((double)scene->r.frs_sec) / (double)scene->r.frs_sec_base);
24 
25  SecondOperation->set_value(float(frameNumber / frameRate));
26  converter.add_operation(SecondOperation);
27 
28  frameOperation->set_value(frameNumber);
29  converter.add_operation(frameOperation);
30 
31  converter.map_output_socket(get_output_socket(0), SecondOperation->get_output_socket());
32  converter.map_output_socket(get_output_socket(1), frameOperation->get_output_socket());
33 }
34 
35 } // 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:84
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
Scene scene
float frs_sec_base
struct RenderData r