Blender V4.3
rna_camera.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10
11#include "DNA_camera_types.h"
12
13#include "BLI_math_rotation.h"
14
15#include "BLT_translation.hh"
16
17#include "RNA_access.hh"
18#include "RNA_define.hh"
19
20#include "rna_internal.hh"
21
22#include "WM_api.hh"
23#include "WM_types.hh"
24
25#ifdef RNA_RUNTIME
26
27# include <fmt/format.h>
28
29# include "BKE_camera.h"
30# include "BKE_object.hh"
31
32# include "DEG_depsgraph.hh"
33# include "DEG_depsgraph_build.hh"
34
35# include "SEQ_relations.hh"
36
37static float rna_Camera_angle_get(PointerRNA *ptr)
38{
39 const Camera *cam = (const Camera *)ptr->owner_id;
40 float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
41 return focallength_to_fov(cam->lens, sensor);
42}
43
44static void rna_Camera_angle_set(PointerRNA *ptr, float value)
45{
46 Camera *cam = (Camera *)ptr->owner_id;
47 float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
48 cam->lens = fov_to_focallength(value, sensor);
49}
50
51static float rna_Camera_angle_x_get(PointerRNA *ptr)
52{
53 const Camera *cam = (const Camera *)ptr->owner_id;
54 return focallength_to_fov(cam->lens, cam->sensor_x);
55}
56
57static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
58{
59 Camera *cam = (Camera *)ptr->owner_id;
60 cam->lens = fov_to_focallength(value, cam->sensor_x);
61}
62
63static float rna_Camera_angle_y_get(PointerRNA *ptr)
64{
65 const Camera *cam = (const Camera *)ptr->owner_id;
66 return focallength_to_fov(cam->lens, cam->sensor_y);
67}
68
69static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
70{
71 Camera *cam = (Camera *)ptr->owner_id;
72 cam->lens = fov_to_focallength(value, cam->sensor_y);
73}
74
75static void rna_Camera_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
76{
77 Camera *camera = (Camera *)ptr->owner_id;
78
79 DEG_id_tag_update(&camera->id, 0);
80}
81
82static void rna_Camera_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
83{
84 Camera *camera = (Camera *)ptr->owner_id;
86 DEG_id_tag_update(&camera->id, 0);
87}
88
89static CameraBGImage *rna_Camera_background_images_new(Camera *cam)
90{
92
94
95 return bgpic;
96}
97
98static void rna_Camera_background_images_remove(Camera *cam,
99 ReportList *reports,
100 PointerRNA *bgpic_ptr)
101{
102 CameraBGImage *bgpic = static_cast<CameraBGImage *>(bgpic_ptr->data);
103 if (BLI_findindex(&cam->bg_images, bgpic) == -1) {
104 BKE_report(reports, RPT_ERROR, "Background image cannot be removed");
105 }
106
108 RNA_POINTER_INVALIDATE(bgpic_ptr);
109
111}
112
113static void rna_Camera_background_images_clear(Camera *cam)
114{
116
118}
119
120static std::optional<std::string> rna_Camera_background_image_path(const PointerRNA *ptr)
121{
122 const CameraBGImage *bgpic = static_cast<const CameraBGImage *>(ptr->data);
123 const Camera *camera = (const Camera *)ptr->owner_id;
124
125 const int bgpic_index = BLI_findindex(&camera->bg_images, bgpic);
126
127 if (bgpic_index >= 0) {
128 return fmt::format("background_images[{}]", bgpic_index);
129 }
130
131 return std::nullopt;
132}
133
135 const PointerRNA *ptr)
136{
137 const char *user = static_cast<const char *>(ptr->data);
138 const Camera *camera = (const Camera *)ptr->owner_id;
139
140 int bgpic_index = BLI_findindex(&camera->bg_images, user - offsetof(CameraBGImage, iuser));
141 if (bgpic_index >= 0) {
142 return fmt::format("background_images[{}].image_user", bgpic_index);
143 }
144
145 bgpic_index = BLI_findindex(&camera->bg_images, user - offsetof(CameraBGImage, cuser));
146 if (bgpic_index >= 0) {
147 return fmt::format("background_images[{}].clip_user", bgpic_index);
148 }
149
150 return std::nullopt;
151}
152
153static bool rna_Camera_background_images_override_apply(
154 Main *bmain, RNAPropertyOverrideApplyContext &rnaapply_ctx)
155{
156 PointerRNA *ptr_dst = &rnaapply_ctx.ptr_dst;
157 PointerRNA *ptr_src = &rnaapply_ctx.ptr_src;
158 PropertyRNA *prop_dst = rnaapply_ctx.prop_dst;
160
162 "Unsupported RNA override operation on background images collection");
163
164 Camera *cam_dst = (Camera *)ptr_dst->owner_id;
165 const Camera *cam_src = (const Camera *)ptr_src->owner_id;
166
167 /* Remember that insertion operations are defined and stored in correct order, which means that
168 * even if we insert several items in a row, we always insert first one, then second one, etc.
169 * So we should always find 'anchor' constraint in both _src *and* _dst. */
170 CameraBGImage *bgpic_anchor = static_cast<CameraBGImage *>(
171 BLI_findlink(&cam_dst->bg_images, opop->subitem_reference_index));
172
173 /* If `bgpic_anchor` is nullptr, `bgpic_src` will be inserted in first position. */
174 const CameraBGImage *bgpic_src = static_cast<const CameraBGImage *>(
175 BLI_findlink(&cam_src->bg_images, opop->subitem_local_index));
176
177 if (bgpic_src == nullptr) {
178 BLI_assert(bgpic_src != nullptr);
179 return false;
180 }
181
182 CameraBGImage *bgpic_dst = BKE_camera_background_image_copy(bgpic_src, 0);
183
184 /* This handles nullptr anchor as expected by adding at head of list. */
185 BLI_insertlinkafter(&cam_dst->bg_images, bgpic_anchor, bgpic_dst);
186
187 RNA_property_update_main(bmain, nullptr, ptr_dst, prop_dst);
188 return true;
189}
190
191static void rna_Camera_dof_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
192{
195}
196
197std::optional<std::string> rna_CameraDOFSettings_path(const PointerRNA *ptr)
198{
199 /* if there is ID-data, resolve the path using the index instead of by name,
200 * since the name used is the name of the texture assigned, but the texture
201 * may be used multiple times in the same stack
202 */
203 if (ptr->owner_id) {
204 if (GS(ptr->owner_id->name) == ID_CA) {
205 return "dof";
206 }
207 }
208
209 return "";
210}
211
212static void rna_CameraDOFSettings_aperture_blades_set(PointerRNA *ptr, const int value)
213{
214 CameraDOFSettings *dofsettings = (CameraDOFSettings *)ptr->data;
215
216 if (ELEM(value, 1, 2)) {
217 if (dofsettings->aperture_blades == 0) {
218 dofsettings->aperture_blades = 3;
219 }
220 else {
221 dofsettings->aperture_blades = 0;
222 }
223 }
224 else {
225 dofsettings->aperture_blades = value;
226 }
227}
228
229#else
230
232{
233 StructRNA *srna;
234 PropertyRNA *prop;
235
236 static const EnumPropertyItem bgpic_source_items[] = {
237 {CAM_BGIMG_SOURCE_IMAGE, "IMAGE", 0, "Image", ""},
238 {CAM_BGIMG_SOURCE_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""},
239 {0, nullptr, 0, nullptr, nullptr},
240 };
241
242 static const EnumPropertyItem bgpic_camera_frame_items[] = {
243 {0, "STRETCH", 0, "Stretch", ""},
244 {CAM_BGIMG_FLAG_CAMERA_ASPECT, "FIT", 0, "Fit", ""},
246 {0, nullptr, 0, nullptr, nullptr},
247 };
248
249 static const EnumPropertyItem bgpic_display_depth_items[] = {
250 {0, "BACK", 0, "Back", ""},
251 {CAM_BGIMG_FLAG_FOREGROUND, "FRONT", 0, "Front", ""},
252 {0, nullptr, 0, nullptr, nullptr},
253 };
254
255 srna = RNA_def_struct(brna, "CameraBackgroundImage", nullptr);
256 RNA_def_struct_sdna(srna, "CameraBGImage");
258 srna, "Background Image", "Image and settings for display in the 3D View background");
259 RNA_def_struct_path_func(srna, "rna_Camera_background_image_path");
260
261 prop = RNA_def_boolean(srna,
262 "is_override_data",
263 false,
264 "Override Background Image",
265 "In a local override camera, whether this background image comes from "
266 "the linked reference camera, or is local to the override");
269 prop, nullptr, "flag", CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL);
270
272
273 prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
274 RNA_def_property_enum_sdna(prop, nullptr, "source");
275 RNA_def_property_enum_items(prop, bgpic_source_items);
276 RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
278
279 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
280 RNA_def_property_pointer_sdna(prop, nullptr, "ima");
281 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
285
286 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
287 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
288 RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
292
293 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
295 RNA_def_property_struct_type(prop, "ImageUser");
296 RNA_def_property_pointer_sdna(prop, nullptr, "iuser");
298 prop,
299 "Image User",
300 "Parameters defining which layer, pass and frame of the image is displayed");
302
303 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
305 RNA_def_property_struct_type(prop, "MovieClipUser");
306 RNA_def_property_pointer_sdna(prop, nullptr, "cuser");
308 prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
310
311 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ);
312 RNA_def_property_float_sdna(prop, nullptr, "offset");
313 RNA_def_property_ui_text(prop, "Offset", "");
316
317 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
318 RNA_def_property_float_sdna(prop, nullptr, "scale");
319 RNA_def_property_ui_text(prop, "Scale", "Scale the background image");
323
324 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE);
325 RNA_def_property_float_sdna(prop, nullptr, "rotation");
327 prop, "Rotation", "Rotation for the background image (ortho view only)");
329
330 prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
332 RNA_def_property_ui_text(prop, "Flip Horizontally", "Flip the background image horizontally");
334
335 prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
337 RNA_def_property_ui_text(prop, "Flip Vertically", "Flip the background image vertically");
339
340 prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
341 RNA_def_property_float_sdna(prop, nullptr, "alpha");
343 prop, "Opacity", "Image opacity to blend the image against the background color");
344 RNA_def_property_range(prop, 0.0, 1.0);
346
347 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
350 RNA_def_property_ui_text(prop, "Show Expanded", "Show the details in the user interface");
351 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
352
353 prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
355 RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
357
358 prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
360 RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
362
363 prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE);
366 prop, "Show On Foreground", "Show this image in front of objects in viewport");
368
369 /* expose 1 flag as a enum of 2 items */
370 prop = RNA_def_property(srna, "display_depth", PROP_ENUM, PROP_NONE);
371 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
372 RNA_def_property_enum_items(prop, bgpic_display_depth_items);
373 RNA_def_property_ui_text(prop, "Depth", "Display under or over everything");
376
377 /* expose 2 flags as a enum of 3 items */
378 prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
379 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
380 RNA_def_property_enum_items(prop, bgpic_camera_frame_items);
381 RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame");
383
385}
386
388{
389 StructRNA *srna;
390 FunctionRNA *func;
391 PropertyRNA *parm;
392
393 RNA_def_property_srna(cprop, "CameraBackgroundImages");
394 srna = RNA_def_struct(brna, "CameraBackgroundImages", nullptr);
395 RNA_def_struct_sdna(srna, "Camera");
396 RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
397
398 func = RNA_def_function(srna, "new", "rna_Camera_background_images_new");
399 RNA_def_function_ui_description(func, "Add new background image");
400 parm = RNA_def_pointer(
401 func, "image", "CameraBackgroundImage", "", "Image displayed as viewport background");
402 RNA_def_function_return(func, parm);
403
404 func = RNA_def_function(srna, "remove", "rna_Camera_background_images_remove");
405 RNA_def_function_ui_description(func, "Remove background image");
407 parm = RNA_def_pointer(
408 func, "image", "CameraBackgroundImage", "", "Image displayed as viewport background");
411
412 func = RNA_def_function(srna, "clear", "rna_Camera_background_images_clear");
413 RNA_def_function_ui_description(func, "Remove all background images");
414}
415
417{
418 StructRNA *srna;
419 PropertyRNA *prop;
420
421 static const EnumPropertyItem convergence_mode_items[] = {
422 {CAM_S3D_OFFAXIS, "OFFAXIS", 0, "Off-Axis", "Off-axis frustums converging in a plane"},
423 {CAM_S3D_PARALLEL, "PARALLEL", 0, "Parallel", "Parallel cameras with no convergence"},
425 "TOE",
426 0,
427 "Toe-in",
428 "Rotated cameras, looking at the same point at the convergence distance"},
429 {0, nullptr, 0, nullptr, nullptr},
430 };
431
432 static const EnumPropertyItem pivot_items[] = {
433 {CAM_S3D_PIVOT_LEFT, "LEFT", 0, "Left", ""},
434 {CAM_S3D_PIVOT_RIGHT, "RIGHT", 0, "Right", ""},
435 {CAM_S3D_PIVOT_CENTER, "CENTER", 0, "Center", ""},
436 {0, nullptr, 0, nullptr, nullptr},
437 };
438
439 srna = RNA_def_struct(brna, "CameraStereoData", nullptr);
440 RNA_def_struct_sdna(srna, "CameraStereoSettings");
441 RNA_def_struct_nested(brna, srna, "Camera");
442 RNA_def_struct_ui_text(srna, "Stereo", "Stereoscopy settings for a Camera data-block");
443
445
446 prop = RNA_def_property(srna, "convergence_mode", PROP_ENUM, PROP_NONE);
447 RNA_def_property_enum_items(prop, convergence_mode_items);
448 RNA_def_property_ui_text(prop, "Mode", "");
449 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
450
451 prop = RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
452 RNA_def_property_enum_items(prop, pivot_items);
453 RNA_def_property_ui_text(prop, "Pivot", "");
454 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
455
456 prop = RNA_def_property(srna, "interocular_distance", PROP_FLOAT, PROP_DISTANCE);
457 RNA_def_property_range(prop, 0.0f, FLT_MAX);
458 RNA_def_property_ui_range(prop, 0.0f, 1e4f, 1, 3);
460 prop,
461 "Interocular Distance",
462 "Set the distance between the eyes - the stereo plane distance / 30 should be fine");
463 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
464
465 prop = RNA_def_property(srna, "convergence_distance", PROP_FLOAT, PROP_DISTANCE);
466 RNA_def_property_range(prop, 0.00001f, FLT_MAX);
467 RNA_def_property_ui_range(prop, 0.00001f, 15.0f, 1, 3);
469 "Convergence Plane Distance",
470 "The converge point for the stereo cameras "
471 "(often the distance between a projector and the projection screen)");
472 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
473
474 prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
475 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_S3D_SPHERICAL);
477 "Spherical Stereo",
478 "Render every pixel rotating the camera around the "
479 "middle of the interocular distance");
480 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
481
482 prop = RNA_def_property(srna, "use_pole_merge", PROP_BOOLEAN, PROP_NONE);
485 prop, "Use Pole Merge", "Fade interocular distance to 0 after the given cutoff angle");
486 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
487
488 prop = RNA_def_property(srna, "pole_merge_angle_from", PROP_FLOAT, PROP_ANGLE);
489 RNA_def_property_range(prop, 0.0f, M_PI_2);
491 prop, "Pole Merge Start Angle", "Angle at which interocular distance starts to fade to 0");
492 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
493
494 prop = RNA_def_property(srna, "pole_merge_angle_to", PROP_FLOAT, PROP_ANGLE);
495 RNA_def_property_range(prop, 0.0f, M_PI_2);
497 prop, "Pole Merge End Angle", "Angle at which interocular distance is 0");
498 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
499
501}
502
504{
505 StructRNA *srna;
506 PropertyRNA *prop;
507
508 srna = RNA_def_struct(brna, "CameraDOFSettings", nullptr);
509 RNA_def_struct_sdna(srna, "CameraDOFSettings");
510 RNA_def_struct_path_func(srna, "rna_CameraDOFSettings_path");
511 RNA_def_struct_ui_text(srna, "Depth of Field", "Depth of Field settings");
512
514
515 prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
516 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_DOF_ENABLED);
517 RNA_def_property_ui_text(prop, "Depth of Field", "Use Depth of Field");
518 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
519
520 prop = RNA_def_property(srna, "focus_object", PROP_POINTER, PROP_NONE);
521 RNA_def_property_struct_type(prop, "Object");
522 RNA_def_property_pointer_sdna(prop, nullptr, "focus_object");
526 prop, "Focus Object", "Use this object to define the depth of field focal point");
527 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dependency_update");
528
529 prop = RNA_def_property(srna, "focus_subtarget", PROP_STRING, PROP_NONE);
530 RNA_def_property_string_sdna(prop, nullptr, "focus_subtarget");
532 prop, "Focus Bone", "Use this armature bone to define the depth of field focal point");
533 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dependency_update");
534
535 prop = RNA_def_property(srna, "focus_distance", PROP_FLOAT, PROP_DISTANCE);
536 // RNA_def_property_pointer_sdna(prop, nullptr, "focus_distance");
537 RNA_def_property_range(prop, 0.0f, FLT_MAX);
538 RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 4);
540 prop, "Focus Distance", "Distance to the focus point for depth of field");
541 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
542
543 prop = RNA_def_property(srna, "aperture_fstop", PROP_FLOAT, PROP_NONE);
545 prop,
546 "F-Stop",
547 "F-Stop ratio (lower numbers give more defocus, higher numbers give a sharper image)");
548 RNA_def_property_range(prop, 0.0f, FLT_MAX);
549 RNA_def_property_ui_range(prop, 0.1f, 128.0f, 10, 1);
550 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
551
552 prop = RNA_def_property(srna, "aperture_blades", PROP_INT, PROP_NONE);
554 prop, "Blades", "Number of blades in aperture for polygonal bokeh (at least 3)");
555 RNA_def_property_range(prop, 0, 16);
556 RNA_def_property_int_funcs(prop, nullptr, "rna_CameraDOFSettings_aperture_blades_set", nullptr);
557 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
558
559 prop = RNA_def_property(srna, "aperture_rotation", PROP_FLOAT, PROP_ANGLE);
560 RNA_def_property_ui_text(prop, "Rotation", "Rotation of blades in aperture");
562 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
563
564 prop = RNA_def_property(srna, "aperture_ratio", PROP_FLOAT, PROP_NONE);
565 RNA_def_property_ui_text(prop, "Ratio", "Distortion to simulate anamorphic lens bokeh");
566 RNA_def_property_range(prop, 0.01f, FLT_MAX);
567 RNA_def_property_ui_range(prop, 0.01f, 2.0f, 0.1, 3);
568 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update");
569
571}
572
574{
575 StructRNA *srna;
576 PropertyRNA *prop;
577 static const EnumPropertyItem prop_type_items[] = {
578 {CAM_PERSP, "PERSP", 0, "Perspective", ""},
579 {CAM_ORTHO, "ORTHO", 0, "Orthographic", ""},
580 {CAM_PANO, "PANO", 0, "Panoramic", ""},
581 {0, nullptr, 0, nullptr, nullptr},
582 };
583 static const EnumPropertyItem prop_lens_unit_items[] = {
584 {0, "MILLIMETERS", 0, "Millimeters", "Specify focal length of the lens in millimeters"},
586 "FOV",
587 0,
588 "Field of View",
589 "Specify the lens as the field of view's angle"},
590 {0, nullptr, 0, nullptr, nullptr},
591 };
592 static const EnumPropertyItem sensor_fit_items[] = {
594 "AUTO",
595 0,
596 "Auto",
597 "Fit to the sensor width or height depending on image resolution"},
598 {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"},
599 {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"},
600 {0, nullptr, 0, nullptr, nullptr},
601 };
602
603 static const EnumPropertyItem panorama_type_items[] = {
605 "EQUIRECTANGULAR",
606 0,
607 "Equirectangular",
608 "Spherical camera for environment maps, also known as Lat Long panorama"},
610 "EQUIANGULAR_CUBEMAP_FACE",
611 0,
612 "Equiangular Cubemap Face",
613 "Single face of an equiangular cubemap"},
615 "MIRRORBALL",
616 0,
617 "Mirror Ball",
618 "Mirror ball mapping for environment maps"},
620 "FISHEYE_EQUIDISTANT",
621 0,
622 "Fisheye Equidistant",
623 "Ideal for fulldomes, ignore the sensor dimensions"},
625 "FISHEYE_EQUISOLID",
626 0,
627 "Fisheye Equisolid",
628 "Similar to most fisheye modern lens, takes sensor dimensions into consideration"},
630 "FISHEYE_LENS_POLYNOMIAL",
631 0,
632 "Fisheye Lens Polynomial",
633 "Defines the lens projection as polynomial to allow real world camera lenses to be "
634 "mimicked"},
636 "CENTRAL_CYLINDRICAL",
637 0,
638 "Central Cylindrical",
639 "Projection onto a virtual cylinder from its center, similar as a rotating panoramic "
640 "camera"},
641 {0, nullptr, 0, nullptr, nullptr},
642 };
643
644 srna = RNA_def_struct(brna, "Camera", "ID");
645 RNA_def_struct_ui_text(srna, "Camera", "Camera data-block for storing camera settings");
646 RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA);
647
649
650 /* Enums */
651 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
652 RNA_def_property_enum_items(prop, prop_type_items);
653 RNA_def_property_ui_text(prop, "Type", "Camera types");
654 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
655
656 prop = RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
657 RNA_def_property_enum_sdna(prop, nullptr, "sensor_fit");
658 RNA_def_property_enum_items(prop, sensor_fit_items);
660 prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor");
661 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
662
663 /* Number values */
664
665 prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
666 RNA_def_property_float_sdna(prop, nullptr, "passepartalpha");
668 prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
670
671 prop = RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
672 RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847));
674 RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view");
675 RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", nullptr);
676 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
677
678 prop = RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
679 RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847));
681 RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view");
682 RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", nullptr);
683 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
684
685 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
686 RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847));
688 RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view");
689 RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", nullptr);
690 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
691
692 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
693 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
694 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
695 RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
696 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
697
698 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
699 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
700 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
701 RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
702 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
703
704 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_DISTANCE_CAMERA);
705 RNA_def_property_float_sdna(prop, nullptr, "lens");
706 RNA_def_property_range(prop, 1.0f, FLT_MAX);
707 RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 100, 4);
709 prop, "Focal Length", "Perspective Camera focal length value in millimeters");
710 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
711
712 prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_DISTANCE_CAMERA);
713 RNA_def_property_float_sdna(prop, nullptr, "sensor_x");
714 RNA_def_property_range(prop, 1.0f, FLT_MAX);
715 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 100, 4);
717 prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
718 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
719
720 prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_DISTANCE_CAMERA);
721 RNA_def_property_float_sdna(prop, nullptr, "sensor_y");
722 RNA_def_property_range(prop, 1.0f, FLT_MAX);
723 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 100, 4);
725 prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
726 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
727
728 prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
729 RNA_def_property_float_sdna(prop, nullptr, "ortho_scale");
730 RNA_def_property_range(prop, FLT_MIN, FLT_MAX);
731 RNA_def_property_ui_range(prop, 0.001f, 10000.0f, 10, 3);
733 prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
734 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
735
736 prop = RNA_def_property(srna, "display_size", PROP_FLOAT, PROP_DISTANCE);
737 RNA_def_property_float_sdna(prop, nullptr, "drawsize");
738 RNA_def_property_range(prop, 0.01f, 1000.0f);
739 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
741 prop, "Display Size", "Apparent size of the Camera object in the 3D View");
742 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
743
744 prop = RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
745 RNA_def_property_float_sdna(prop, nullptr, "shiftx");
746 RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
747 RNA_def_property_ui_text(prop, "Shift X", "Camera horizontal shift");
748 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
749
750 prop = RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
751 RNA_def_property_float_sdna(prop, nullptr, "shifty");
752 RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
753 RNA_def_property_ui_text(prop, "Shift Y", "Camera vertical shift");
754 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
755
756 /* Stereo Settings */
757 prop = RNA_def_property(srna, "stereo", PROP_POINTER, PROP_NONE);
759 RNA_def_property_pointer_sdna(prop, nullptr, "stereo");
760 RNA_def_property_struct_type(prop, "CameraStereoData");
761 RNA_def_property_ui_text(prop, "Stereo", "");
762
763 /* flag */
764 prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
765 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_SHOWLIMITS);
767 prop, "Show Limits", "Display the clipping range and focus point on the camera");
768 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
769
770 prop = RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
771 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_SHOWMIST);
773 prop, "Show Mist", "Display a line from the Camera to indicate the mist area");
774 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
775
776 prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
779 prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view");
781
782 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
785 prop, "Show Safe Areas", "Show TV title safe and action safe areas in Camera view");
787
788 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
791 "Show Center-Cut Safe Areas",
792 "Show safe areas to fit content in a different aspect ratio");
794
795 prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
796 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_SHOWNAME);
797 RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view");
799
800 prop = RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
801 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_SHOWSENSOR);
803 prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view");
805
806 prop = RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
807 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CAM_SHOW_BG_IMAGE);
809 prop, "Display Background Images", "Display reference images behind objects in the 3D View");
811
812 prop = RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
813 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
814 RNA_def_property_enum_items(prop, prop_lens_unit_items);
815 RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
816
817 /* dtx */
818 prop = RNA_def_property(srna, "show_composition_center", PROP_BOOLEAN, PROP_NONE);
819 RNA_def_property_boolean_sdna(prop, nullptr, "dtx", CAM_DTX_CENTER);
821 prop, "Center", "Display center composition guide inside the camera view");
823
824 prop = RNA_def_property(srna, "show_composition_center_diagonal", PROP_BOOLEAN, PROP_NONE);
827 prop, "Center Diagonal", "Display diagonal center composition guide inside the camera view");
829
830 prop = RNA_def_property(srna, "show_composition_thirds", PROP_BOOLEAN, PROP_NONE);
831 RNA_def_property_boolean_sdna(prop, nullptr, "dtx", CAM_DTX_THIRDS);
833 prop, "Thirds", "Display rule of thirds composition guide inside the camera view");
835
836 prop = RNA_def_property(srna, "show_composition_golden", PROP_BOOLEAN, PROP_NONE);
837 RNA_def_property_boolean_sdna(prop, nullptr, "dtx", CAM_DTX_GOLDEN);
839 prop, "Golden Ratio", "Display golden ratio composition guide inside the camera view");
841
842 prop = RNA_def_property(srna, "show_composition_golden_tria_a", PROP_BOOLEAN, PROP_NONE);
845 "Golden Triangle A",
846 "Display golden triangle A composition guide inside the camera view");
848
849 prop = RNA_def_property(srna, "show_composition_golden_tria_b", PROP_BOOLEAN, PROP_NONE);
852 "Golden Triangle B",
853 "Display golden triangle B composition guide inside the camera view");
855
856 prop = RNA_def_property(srna, "show_composition_harmony_tri_a", PROP_BOOLEAN, PROP_NONE);
859 prop, "Harmonious Triangle A", "Display harmony A composition guide inside the camera view");
861
862 prop = RNA_def_property(srna, "show_composition_harmony_tri_b", PROP_BOOLEAN, PROP_NONE);
865 prop, "Harmonious Triangle B", "Display harmony B composition guide inside the camera view");
867
868 /* Panoramic settings. */
869 prop = RNA_def_property(srna, "panorama_type", PROP_ENUM, PROP_NONE);
870 RNA_def_property_enum_items(prop, panorama_type_items);
871 RNA_def_property_ui_text(prop, "Panorama Type", "Distortion to use for the calculation");
872 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
873
874 prop = RNA_def_property(srna, "fisheye_fov", PROP_FLOAT, PROP_ANGLE);
875 RNA_def_property_range(prop, 0.1745, 10.0 * M_PI);
876 RNA_def_property_ui_range(prop, 0.1745, 2.0 * M_PI, 3, 2);
877 RNA_def_property_ui_text(prop, "Field of View", "Field of view for the fisheye lens");
878 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
879
880 prop = RNA_def_property(srna, "fisheye_lens", PROP_FLOAT, PROP_NONE);
881 RNA_def_property_range(prop, 0.01, 100.0);
882 RNA_def_property_ui_range(prop, 0.01, 15.0, 3, 2);
883 RNA_def_property_ui_text(prop, "Fisheye Lens", "Lens focal length (mm)");
884 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
885
886 prop = RNA_def_property(srna, "latitude_min", PROP_FLOAT, PROP_ANGLE);
887 RNA_def_property_range(prop, -0.5 * M_PI, 0.5 * M_PI);
888 RNA_def_property_ui_range(prop, -0.5 * M_PI, 0.5 * M_PI, 3, 2);
890 prop, "Min Latitude", "Minimum latitude (vertical angle) for the equirectangular lens");
891 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
892
893 prop = RNA_def_property(srna, "latitude_max", PROP_FLOAT, PROP_ANGLE);
894 RNA_def_property_range(prop, -0.5 * M_PI, 0.5 * M_PI);
895 RNA_def_property_ui_range(prop, -0.5 * M_PI, 0.5 * M_PI, 3, 2);
897 prop, "Max Latitude", "Maximum latitude (vertical angle) for the equirectangular lens");
898 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
899
900 prop = RNA_def_property(srna, "longitude_min", PROP_FLOAT, PROP_ANGLE);
901 RNA_def_property_ui_range(prop, -M_PI, M_PI, 3, 2);
903 prop, "Min Longitude", "Minimum longitude (horizontal angle) for the equirectangular lens");
904 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
905
906 prop = RNA_def_property(srna, "longitude_max", PROP_FLOAT, PROP_ANGLE);
907 RNA_def_property_ui_range(prop, -M_PI, M_PI, 3, 2);
909 prop, "Max Longitude", "Maximum longitude (horizontal angle) for the equirectangular lens");
910 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
911
912 prop = RNA_def_property(srna, "fisheye_polynomial_k0", PROP_FLOAT, PROP_ANGLE);
914 RNA_def_property_ui_text(prop, "Fisheye Polynomial K0", "Coefficient K0 of the lens polynomial");
915 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
916
917 prop = RNA_def_property(srna, "fisheye_polynomial_k1", PROP_FLOAT, PROP_ANGLE);
919 RNA_def_property_ui_text(prop, "Fisheye Polynomial K1", "Coefficient K1 of the lens polynomial");
920 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
921
922 prop = RNA_def_property(srna, "fisheye_polynomial_k2", PROP_FLOAT, PROP_ANGLE);
924 RNA_def_property_ui_text(prop, "Fisheye Polynomial K2", "Coefficient K2 of the lens polynomial");
925 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
926
927 prop = RNA_def_property(srna, "fisheye_polynomial_k3", PROP_FLOAT, PROP_ANGLE);
929 RNA_def_property_ui_text(prop, "Fisheye Polynomial K3", "Coefficient K3 of the lens polynomial");
930 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
931
932 prop = RNA_def_property(srna, "fisheye_polynomial_k4", PROP_FLOAT, PROP_ANGLE);
934 RNA_def_property_ui_text(prop, "Fisheye Polynomial K4", "Coefficient K4 of the lens polynomial");
935 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
936
937 prop = RNA_def_property(srna, "central_cylindrical_range_u_min", PROP_FLOAT, PROP_ANGLE);
938 RNA_def_property_ui_range(prop, -M_PI, M_PI, 3, 2);
940 prop, "Min Longitude", "Minimum Longitude value for the central cylindrical lens");
941 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
942
943 prop = RNA_def_property(srna, "central_cylindrical_range_u_max", PROP_FLOAT, PROP_ANGLE);
944 RNA_def_property_ui_range(prop, -M_PI, M_PI, 3, 2);
946 prop, "Max Longitude", "Maximum Longitude value for the central cylindrical lens");
947 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
948
949 prop = RNA_def_property(srna, "central_cylindrical_range_v_min", PROP_FLOAT, PROP_DISTANCE);
950 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1f, 3);
952 prop, "Min Height", "Minimum Height value for the central cylindrical lens");
953 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
954
955 prop = RNA_def_property(srna, "central_cylindrical_range_v_max", PROP_FLOAT, PROP_DISTANCE);
956 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1f, 3);
958 prop, "Max Height", "Maximum Height value for the central cylindrical lens");
959 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
960
961 prop = RNA_def_property(srna, "central_cylindrical_radius", PROP_FLOAT, PROP_DISTANCE);
962 RNA_def_property_range(prop, 0.00001f, FLT_MAX);
963 RNA_def_property_ui_range(prop, 0.00001f, 10.0f, 0.1f, 3);
964 RNA_def_property_ui_text(prop, "Cylinder Radius", "Radius of the virtual cylinder");
965 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
966
967 /* pointers */
968 prop = RNA_def_property(srna, "dof", PROP_POINTER, PROP_NONE);
969 RNA_def_property_struct_type(prop, "CameraDOFSettings");
970 RNA_def_property_ui_text(prop, "Depth Of Field", "");
971 RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, nullptr);
972
973 prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
974 RNA_def_property_collection_sdna(prop, nullptr, "bg_images", nullptr);
975 RNA_def_property_struct_type(prop, "CameraBackgroundImage");
976 RNA_def_property_ui_text(prop, "Background Images", "List of background images");
979 prop, nullptr, nullptr, "rna_Camera_background_images_override_apply");
981
983
985
988
989 /* Nested Data. */
991
992 /* *** Animated *** */
995
996 /* Camera API */
997 RNA_api_camera(srna);
998}
999
1000#endif
Camera data-block and utility functions.
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
struct CameraBGImage * BKE_camera_background_image_new(struct Camera *cam)
void BKE_camera_background_image_clear(struct Camera *cam)
struct CameraBGImage * BKE_camera_background_image_copy(const struct CameraBGImage *bgpic_src, int flag)
void BKE_camera_background_image_remove(struct Camera *cam, struct CameraBGImage *bgpic)
General operations, lookup, etc. for blender objects.
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
#define BLI_assert(a)
Definition BLI_assert.h:50
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:331
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define M_PI_2
#define M_PI
#define DEG2RAD(_deg)
float fov_to_focallength(float hfov, float sensor)
float focallength_to_fov(float focal_length, float sensor)
#define ELEM(...)
#define BLT_I18NCONTEXT_ID_CAMERA
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ LIBOVERRIDE_OP_INSERT_AFTER
Definition DNA_ID.h:239
@ ID_CA
@ CAM_S3D_PARALLEL
@ CAM_S3D_OFFAXIS
@ CAM_S3D_TOE
@ CAMERA_SENSOR_FIT_HOR
@ CAMERA_SENSOR_FIT_AUTO
@ CAMERA_SENSOR_FIT_VERT
@ CAM_DTX_GOLDEN_TRI_A
@ CAM_DTX_CENTER
@ CAM_DTX_HARMONY_TRI_A
@ CAM_DTX_GOLDEN
@ CAM_DTX_GOLDEN_TRI_B
@ CAM_DTX_HARMONY_TRI_B
@ CAM_DTX_CENTER_DIAG
@ CAM_DTX_THIRDS
@ CAM_SHOWLIMITS
@ CAM_SHOW_BG_IMAGE
@ CAM_SHOWPASSEPARTOUT
@ CAM_SHOW_SAFE_MARGINS
@ CAM_SHOW_SAFE_CENTER
@ CAM_SHOWMIST
@ CAM_ANGLETOGGLE
@ CAM_SHOWNAME
@ CAM_SHOWSENSOR
@ CAM_BGIMG_FLAG_FLIP_X
@ CAM_BGIMG_FLAG_FLIP_Y
@ CAM_BGIMG_FLAG_CAMERA_CROP
@ CAM_BGIMG_FLAG_CAMERACLIP
@ CAM_BGIMG_FLAG_CAMERA_ASPECT
@ CAM_BGIMG_FLAG_DISABLED
@ CAM_BGIMG_FLAG_FOREGROUND
@ CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL
@ CAM_BGIMG_FLAG_EXPANDED
@ CAM_S3D_PIVOT_CENTER
@ CAM_S3D_PIVOT_RIGHT
@ CAM_S3D_PIVOT_LEFT
@ CAM_S3D_SPHERICAL
@ CAM_S3D_POLE_MERGE
@ CAM_BGIMG_SOURCE_IMAGE
@ CAM_BGIMG_SOURCE_MOVIE
@ CAM_PERSP
@ CAM_PANO
@ CAM_ORTHO
@ CAM_PANORAMA_CENTRAL_CYLINDRICAL
@ CAM_PANORAMA_FISHEYE_EQUIDISTANT
@ CAM_PANORAMA_MIRRORBALL
@ CAM_PANORAMA_EQUIANGULAR_CUBEMAP_FACE
@ CAM_PANORAMA_FISHEYE_EQUISOLID
@ CAM_PANORAMA_EQUIRECTANGULAR
@ CAM_PANORAMA_FISHEYE_LENS_POLYNOMIAL
@ CAM_DOF_ENABLED
#define RNA_POINTER_INVALIDATE(ptr)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROPOVERRIDE_LIBRARY_INSERTION
Definition RNA_types.hh:380
@ PROPOVERRIDE_NO_PROP_NAME
Definition RNA_types.hh:388
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_NO_DEG_UPDATE
Definition RNA_types.hh:328
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_DISTANCE_CAMERA
Definition RNA_types.hh:160
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_FACTOR
Definition RNA_types.hh:154
#define ND_SEQUENCER
Definition WM_types.hh:404
#define ND_DRAW
Definition WM_types.hh:428
#define NC_SCENE
Definition WM_types.hh:345
#define NC_CAMERA
Definition WM_types.hh:368
#define NC_OBJECT
Definition WM_types.hh:346
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:437
#define offsetof(t, d)
#define GS(x)
Definition iris.cc:202
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
void rna_def_animdata_common(StructRNA *srna)
static void rna_def_camera_stereo_data(BlenderRNA *brna)
void RNA_def_camera(BlenderRNA *brna)
static void rna_def_camera_dof_settings_data(BlenderRNA *brna)
static void rna_def_camera_background_image(BlenderRNA *brna)
static void rna_def_camera_background_images(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_camera(StructRNA *srna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_define_animate_sdna(bool animate)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
std::optional< std::string > rna_CameraBackgroundImage_image_or_movieclip_user_path(const PointerRNA *ptr)
#define FLT_MAX
Definition stdcycles.h:14
void SEQ_relations_invalidate_scene_strips(Main *bmain, Scene *scene_target)
struct ListBase bg_images
char name[66]
Definition DNA_ID.h:425
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
IDOverrideLibraryPropertyOperation * liboverride_operation
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126