20 b.use_custom_socket_order();
22 b.add_output<
decl::Matrix>(
"Projection Matrix"_ustr).description(
"Camera projection matrix");
23 b.add_output<
decl::Float>(
"Focal Length"_ustr).description(
"Perspective camera focal length");
26 b.add_output<
decl::Float>(
"Clip Start"_ustr).description(
"Camera near clipping distance");
27 b.add_output<
decl::Float>(
"Clip End"_ustr).description(
"Camera far clipping distance");
29 .description(
"Distance to the focus point for depth of field");
31 .description(
"Whether the camera is using orthographic projection");
33 .description(
"Orthographic camera scale (similar to zoom)");
57 const float2 aspect_corrected_resolution =
float2(resolution) *
60 aspect_ratio = aspect_corrected_resolution.x / aspect_corrected_resolution.y;
62 camera_parameters.
sensor_fit, aspect_corrected_resolution.x, aspect_corrected_resolution.y));
70 scene, camera_parameters, aspect_ratio, effective_sensor_fit);
76 return float2(sensor_size, sensor_size / aspect_ratio);
78 return float2(sensor_size * aspect_ratio, sensor_size);
86 scene, camera_parameters, aspect_ratio, effective_sensor_fit);
127 params.
set_output(
"Projection Matrix"_ustr, projection_matrix);
133 params.
set_output(
"Focus Distance"_ustr, focus_distance);
147 if (!camera_object) {
237 ntype.
ui_description =
"Retrieve information from a camera object";
Camera data-block and utility functions.
#define NOD_REGISTER_NODE(REGISTER_FUNC)
virtual const Scene & get_scene() const =0
NodeOperation(Context &context, const bNode &node)
void add_warning(nodes::NodeWarningType type, std::string message)
Result & get_result(StringRef identifier)
void allocate_default_remaining_outputs()
Context & context() const
Result & get_input(StringRef identifier) const
bool should_compute() const
void set_single_value(const T &value)
void allocate_single_value()
const T & get_single_value() const
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
void set_default_remaining_outputs()
const Depsgraph * depsgraph() const
void set_output(const UString identifier, T &&value)
NodeOperation(Context &context, const bNode &node)
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
void node_register_type(bNodeType &ntype)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_declare(NodeDeclarationBuilder &b)
static float2 compute_sensor_size(const Scene &scene, const CameraParams &camera_parameters)
static float2 compute_lens_shift(const Scene &scene, const CameraParams &camera_parameters)
static void node_register()
static void compute_aspect_ratio_and_effective_sensor_fit(const Scene &scene, const CameraParams &camera_parameters, float &aspect_ratio, eCamera_SensorFit &effective_sensor_fit)
static CameraParams get_camera_parameters(const Scene &scene, const Object &camera_object)
static void node_geo_exec(GeoNodeExecParams params)
void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
void BKE_camera_params_compute_matrix(CameraParams *params)
float BKE_camera_object_dof_distance(const struct Object *ob)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
void BKE_camera_params_init(CameraParams *params)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
void geo_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare