2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-29 19:53:49 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-11-29 19:53:49 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_camera.c
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2008-11-29 19:53:49 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_camera_types.h"
|
|
|
|
|
|
2010-01-26 11:25:39 +00:00
|
|
|
#include "BLI_math.h"
|
|
|
|
|
|
2009-01-05 05:42:48 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2008-11-29 19:53:49 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
2011-11-18 21:19:03 +00:00
|
|
|
#include "BKE_camera.h"
|
2010-04-15 04:56:44 +00:00
|
|
|
#include "BKE_object.h"
|
2011-11-04 14:36:06 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
2009-10-01 04:14:43 +00:00
|
|
|
|
2010-02-04 21:48:10 +00:00
|
|
|
static float rna_Camera_angle_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
2011-11-18 21:19:03 +00:00
|
|
|
float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
|
2011-11-04 14:36:06 +00:00
|
|
|
return focallength_to_fov(cam->lens, sensor);
|
2010-02-04 21:48:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Camera_angle_set(PointerRNA *ptr, float value)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
2011-11-18 21:19:03 +00:00
|
|
|
float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
|
2011-11-04 14:36:06 +00:00
|
|
|
cam->lens= fov_to_focallength(value, sensor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float rna_Camera_angle_x_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
|
|
|
|
return focallength_to_fov(cam->lens, cam->sensor_x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
|
|
|
|
cam->lens= fov_to_focallength(value, cam->sensor_x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float rna_Camera_angle_y_get(PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
|
|
|
|
return focallength_to_fov(cam->lens, cam->sensor_y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
|
|
|
|
|
{
|
|
|
|
|
Camera *cam= ptr->id.data;
|
|
|
|
|
cam->lens= fov_to_focallength(value, cam->sensor_y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
Camera *camera= (Camera*)ptr->id.data;
|
|
|
|
|
|
|
|
|
|
DAG_id_tag_update(&camera->id, 0);
|
2010-02-04 21:48:10 +00:00
|
|
|
}
|
2009-10-01 04:14:43 +00:00
|
|
|
|
2008-11-29 19:53:49 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
void RNA_def_camera(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
static EnumPropertyItem prop_type_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{CAM_PERSP, "PERSP", 0, "Perspective", ""},
|
|
|
|
|
{CAM_ORTHO, "ORTHO", 0, "Orthographic", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
2011-05-10 03:03:53 +00:00
|
|
|
static EnumPropertyItem prop_draw_type_extra_items[] = {
|
|
|
|
|
{CAM_DTX_CENTER, "CENTER", 0, "Center", ""},
|
|
|
|
|
{CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""},
|
|
|
|
|
{CAM_DTX_THIRDS, "THIRDS", 0, "Thirds", ""},
|
|
|
|
|
{CAM_DTX_GOLDEN, "GOLDEN", 0, "Golden", ""},
|
2011-05-15 05:43:59 +00:00
|
|
|
{CAM_DTX_GOLDEN_TRI_A, "GOLDEN_TRIANGLE_A", 0, "Golden Triangle A", ""},
|
|
|
|
|
{CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""},
|
|
|
|
|
{CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""},
|
|
|
|
|
{CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""},
|
2011-05-10 03:03:53 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}};
|
2008-12-03 20:17:12 +00:00
|
|
|
static EnumPropertyItem prop_lens_unit_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{0, "MILLIMETERS", 0, "Millimeters", ""},
|
|
|
|
|
{CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
2011-11-04 14:36:06 +00:00
|
|
|
static EnumPropertyItem sensor_fit_items[] = {
|
|
|
|
|
{CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Calculate field of view using sensor size, with direction depending on image resolution"},
|
|
|
|
|
{CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Calculate field of view using sensor width"},
|
|
|
|
|
{CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Calculate field of view using sensor height"},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2008-12-19 04:06:24 +00:00
|
|
|
srna= RNA_def_struct(brna, "Camera", "ID");
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
/* Enums */
|
|
|
|
|
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_type_items);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Type", "Camera types");
|
2011-11-04 14:36:06 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
2011-05-10 03:03:53 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "dtx");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_draw_type_extra_items);
|
|
|
|
|
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
|
2011-05-10 05:20:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay");
|
2011-05-10 03:03:53 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2011-11-04 14:36:06 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "sensor_fit");
|
|
|
|
|
RNA_def_property_enum_items(prop, sensor_fit_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Sensor Fit", "Mode of calculating field of view from sensor dimensions and focal length");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
2008-11-29 19:53:49 +00:00
|
|
|
/* Number values */
|
|
|
|
|
|
2009-09-21 21:19:58 +00:00
|
|
|
prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
|
2008-11-29 19:53:49 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
prop= RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
|
|
|
|
|
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees");
|
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL);
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
|
|
|
|
|
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees");
|
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL);
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
|
|
|
|
|
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees");
|
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL);
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
2010-07-24 00:24:58 +00:00
|
|
|
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
|
2008-11-29 19:53:49 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "clipsta");
|
2011-05-16 18:04:19 +00:00
|
|
|
RNA_def_property_range(prop, 0.001f, FLT_MAX);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2010-07-24 00:24:58 +00:00
|
|
|
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
|
2008-11-29 19:53:49 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "clipend");
|
2009-05-31 01:22:34 +00:00
|
|
|
RNA_def_property_range(prop, 1.0f, FLT_MAX);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "lens");
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_range(prop, 1.0f, 5000.0f);
|
2010-09-27 05:16:45 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
|
2011-11-04 14:36:06 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "sensor_x");
|
|
|
|
|
RNA_def_property_range(prop, 1.0f, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "sensor_y");
|
|
|
|
|
RNA_def_property_range(prop, 1.0f, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
|
2011-06-13 20:21:48 +00:00
|
|
|
RNA_def_property_range(prop, 0.01f, 4000.0f);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
|
2011-11-04 14:36:06 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2010-07-24 00:24:58 +00:00
|
|
|
prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
|
2008-11-29 19:53:49 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "drawsize");
|
2010-11-17 01:15:31 +00:00
|
|
|
RNA_def_property_range(prop, 0.01f, 1000.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shiftx");
|
2010-02-09 16:05:12 +00:00
|
|
|
RNA_def_property_range(prop, -10.0f, 10.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift");
|
2011-11-04 14:36:06 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shifty");
|
2010-02-09 16:05:12 +00:00
|
|
|
RNA_def_property_range(prop, -10.0f, 10.0f);
|
|
|
|
|
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
|
2011-11-04 14:36:06 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2010-07-24 00:24:58 +00:00
|
|
|
prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
|
2008-11-29 19:53:49 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 5000.0f);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
/* flag */
|
|
|
|
|
prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Title Safe", "Show indicators for the title safe zone in Camera view");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2008-11-29 19:53:49 +00:00
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
prop= RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view");
|
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
|
|
|
|
|
2008-12-03 20:17:12 +00:00
|
|
|
prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_lens_unit_items);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
|
2008-11-30 23:27:10 +00:00
|
|
|
|
2010-08-18 07:14:10 +00:00
|
|
|
prop= RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE);
|
2.5: Render
* UI layout for scene buttons has quite some changes, I tried to
better organize things according to the pipeline, and also showing
important properties by default, and collapsing less important ones.
Some changes compared to 2.4x:
* Panorama is now a Camera property.
* Sequence and Compositing are now enabled by default, but will only
do something when there is a node tree using nodes, or a strip in the
sequence editor.
* Enabling Full Sample now automatically enables Save Buffers too.
* Stamp option to include info in file is removed, it now simply always
does this if one of the stamp infos is enabled.
* Xvid, H.264 and Ogg Theora are now directly in the file format menu,
but still using FFMPEG. Unfortunately Ogg is broken at the moment
(also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux,
maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes
it work.
* Organized file format menu by image/movie types.
Added:
* Render layers RNA wrapped, operatorized, layouted.
* FFMPEG format/codec options are now working.
Defaults changed:
* Compositing & Sequencer enabled.
* Tiles set to 8x8.
* Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
2009-07-13 19:09:13 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects");
|
2.5: Render
* UI layout for scene buttons has quite some changes, I tried to
better organize things according to the pipeline, and also showing
important properties by default, and collapsing less important ones.
Some changes compared to 2.4x:
* Panorama is now a Camera property.
* Sequence and Compositing are now enabled by default, but will only
do something when there is a node tree using nodes, or a strip in the
sequence editor.
* Enabling Full Sample now automatically enables Save Buffers too.
* Stamp option to include info in file is removed, it now simply always
does this if one of the stamp infos is enabled.
* Xvid, H.264 and Ogg Theora are now directly in the file format menu,
but still using FFMPEG. Unfortunately Ogg is broken at the moment
(also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux,
maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes
it work.
* Organized file format menu by image/movie types.
Added:
* Render layers RNA wrapped, operatorized, layouted.
* FFMPEG format/codec options are now working.
Defaults changed:
* Compositing & Sequencer enabled.
* Tiles set to 8x8.
* Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
2009-07-13 19:09:13 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
|
|
|
|
|
2008-12-03 20:17:12 +00:00
|
|
|
/* pointers */
|
2009-02-02 11:51:10 +00:00
|
|
|
rna_def_animdata_common(srna);
|
2008-11-30 23:27:10 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_struct_type(prop, "Object");
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
|
2009-05-28 23:23:47 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 20:41:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point");
|
2009-01-05 05:42:48 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
2011-09-29 08:23:52 +00:00
|
|
|
|
|
|
|
|
/* Camera API */
|
|
|
|
|
RNA_api_camera(srna);
|
2008-11-29 19:53:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|