diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-12-01 02:27:10 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-12-01 02:27:10 +0300 |
commit | 3f0d3e0a50da6920ade941d85d54a7b21e6f1154 (patch) | |
tree | 8d0d43811b50a70641a7ff5a12e5043f21da0850 /source | |
parent | e66fff7906dd6c3045d42bbf15ddfffb129136dc (diff) |
RNA
- Minor updates to Camera and start of Ipo (+ IpoDriver and IpoCurve) wrappings.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ipo.c | 132 |
6 files changed, 153 insertions, 4 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index bae20f165ac..fd17042d6a4 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -56,6 +56,9 @@ extern StructRNA RNA_IDPropertyGroup; extern StructRNA RNA_Image; extern StructRNA RNA_ImageUser; extern StructRNA RNA_IntProperty; +extern StructRNA RNA_Ipo; +extern StructRNA RNA_IpoDriver; +extern StructRNA RNA_IpoCurve; extern StructRNA RNA_JoystickSensor; extern StructRNA RNA_KeyboardSensor; extern StructRNA RNA_Lamp; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index d35805d317e..3b2957e386b 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -883,6 +883,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_property.c", RNA_def_gameproperty}, {"rna_group.c", RNA_def_group}, {"rna_image.c", RNA_def_image}, + {"rna_ipo.c", RNA_def_ipo}, {"rna_lamp.c", RNA_def_lamp}, {"rna_lattice.c", RNA_def_lattice}, {"rna_main.c", RNA_def_main}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 4d65ea95b71..13577e62cfe 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -61,6 +61,7 @@ static StructRNA *rna_ID_refine(PointerRNA *ptr) case ID_CA: return &RNA_Camera; case ID_GR: return &RNA_Group; case ID_IM: return &RNA_Image; + case ID_IP: return &RNA_Ipo; case ID_LA: return &RNA_Lamp; case ID_LI: return &RNA_Library; case ID_LT: return &RNA_Lattice; diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 1fb3893bf5c..153397f0bd7 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -61,7 +61,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens in degrees."); + RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens value in degrees."); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); @@ -76,7 +76,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_range(prop, 1.0f, 250.0f); - RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens in mm."); + RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm."); prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); @@ -124,9 +124,20 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME); RNA_def_property_ui_text(prop, "Show Name", "Draw the active Camera's name in Camera view."); - prop= RNA_def_property(srna, "angle_toggle", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_degrees", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_ANGLETOGGLE); - RNA_def_property_ui_text(prop, "Angle Toggle", "Use degrees instead of mm as the unit of the Camera lens."); + RNA_def_property_ui_text(prop, "Use Degrees", "Use degrees instead of mm as the unit of the Camera lens."); + + /* Pointers */ + + prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Ipo"); + RNA_def_property_ui_text(prop, "Ipo Curve", ""); + + 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"); + RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define depth of field focal point."); } #endif diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 8c2cd2449b2..cca5a5ec492 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -88,6 +88,7 @@ void RNA_def_controller(struct BlenderRNA *brna); void RNA_def_gameproperty(struct BlenderRNA *brna); void RNA_def_group(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); +void RNA_def_ipo(struct BlenderRNA *brna); void RNA_def_lamp(struct BlenderRNA *brna); void RNA_def_lattice(struct BlenderRNA *brna); void RNA_def_main(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_ipo.c b/source/blender/makesrna/intern/rna_ipo.c new file mode 100644 index 00000000000..50bef98877b --- /dev/null +++ b/source/blender/makesrna/intern/rna_ipo.c @@ -0,0 +1,132 @@ +/** + * $Id$ + * + * ***** 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, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Blender Foundation (2008). + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <stdlib.h> + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_ipo_types.h" + +#ifdef RNA_RUNTIME + +void *rna_Ipo_ipocurves_get(CollectionPropertyIterator *iter) +{ + ListBaseIterator *internal= iter->internal; + + return ((Base*)internal->link)->object; +} + +#else + +void rna_def_ipodriver(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + static EnumPropertyItem prop_type_items[] = { + {IPO_DRIVER_TYPE_NORMAL, "NORMAL", "Normal", ""}, + {IPO_DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted", ""}, + {0, NULL, NULL, NULL}}; + + srna= RNA_def_struct(brna, "IpoDriver", NULL, "Ipo Driver"); + + /* Enums */ + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_ui_text(prop, "Type", "Ipo Driver types."); + + /* String values */ + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Name", "Bone name or scripting expression."); + + /* Pointers */ + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Object"); + RNA_def_property_pointer_sdna(prop, NULL, "ob"); + RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Ipo Driver."); + +} + +void rna_def_ipocurve(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "IpoCurve", NULL, "Ipo Curve"); + + /* Number values */ + + prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "curval"); + RNA_def_property_ui_text(prop, "Value", "Value of this Ipo Curve at the current frame."); + + /* Pointers */ + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "IpoDriver"); + RNA_def_property_pointer_sdna(prop, NULL, "driver"); + RNA_def_property_ui_text(prop, "Ipo Driver", ""); +} + +void rna_def_ipo(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "Ipo", "ID", "Ipo"); + + /* Boolean values */ + + prop= RNA_def_property(srna, "show_key", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "showkey", 0); + RNA_def_property_ui_text(prop, "Show Keys", "Show Ipo Keys."); + + prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "muteipo", 0); + RNA_def_property_ui_text(prop, "Mute", "Mute this Ipo block."); + + /* Collection */ + + prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "curve", NULL); + RNA_def_property_struct_type(prop, "IpoCurve"); + RNA_def_property_ui_text(prop, "Curves", ""); + RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Ipo_ipocurves_get", 0, 0, 0, 0); + +} + +void RNA_def_ipo(BlenderRNA *brna) +{ + rna_def_ipo(brna); + rna_def_ipocurve(brna); + rna_def_ipodriver(brna); +} + +#endif + |