RNA: Curves and VFont

Implemented RNA wrappers for curves and VFont. Only issue I could
not yet solve is related to struct CharInfo curinfo; . This particular
line proved to be hard to wrap and I therefore marked it as a TODO
should someone want to fix this issue.

I also cleaned up makesrna.c a bit by unifying brush/meta parts
under one call just the way it is done in the case of other
wrappers.
This commit is contained in:
2008-12-01 19:02:27 +00:00
parent 6a73a27d81
commit 1ebf257bf4
8 changed files with 440 additions and 11 deletions

View File

@@ -41,8 +41,10 @@ extern StructRNA RNA_BooleanProperty;
extern StructRNA RNA_Brush;
extern StructRNA RNA_BrushClone;
extern StructRNA RNA_Camera;
extern StructRNA RNA_CharInfo;
extern StructRNA RNA_CollectionProperty;
extern StructRNA RNA_CollisionSensor;
extern StructRNA RNA_Curve;
extern StructRNA RNA_CurveMap;
extern StructRNA RNA_CurveMapPoint;
extern StructRNA RNA_CurveMapping;
@@ -112,8 +114,10 @@ extern StructRNA RNA_Screen;
extern StructRNA RNA_Sensor;
extern StructRNA RNA_StringProperty;
extern StructRNA RNA_Struct;
extern StructRNA RNA_TextBox;
extern StructRNA RNA_TouchSensor;
extern StructRNA RNA_UnknownType;
extern StructRNA RNA_VFont;
extern StructRNA RNA_WindowManager;
extern StructRNA RNA_World;

View File

@@ -878,11 +878,10 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_ID.c", RNA_def_ID},
{"rna_actuator.c", RNA_def_actuator},
{"rna_brush.c", RNA_def_brush},
{"rna_brush.c", RNA_def_brushclone},
{"rna_camera.c", RNA_def_camera},
{"rna_color.c", RNA_def_color},
{"rna_controller.c", RNA_def_controller},
{"rna_property.c", RNA_def_gameproperty},
{"rna_curve.c", RNA_def_curve},
{"rna_group.c", RNA_def_group},
{"rna_image.c", RNA_def_image},
{"rna_ipo.c", RNA_def_ipo},
@@ -891,16 +890,17 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_main.c", RNA_def_main},
{"rna_material.c", RNA_def_material},
{"rna_mesh.c", RNA_def_mesh},
{"rna_meta.c", RNA_def_metaball},
{"rna_meta.c", RNA_def_metaelem},
{"rna_meta.c", RNA_def_meta},
{"rna_modifier.c", RNA_def_modifier},
{"rna_nodetree.c", RNA_def_nodetree},
{"rna_object.c", RNA_def_object},
{"rna_property.c", RNA_def_gameproperty},
{"rna_radio.c", RNA_def_radio},
{"rna_rna.c", RNA_def_rna},
{"rna_scene.c", RNA_def_scene},
{"rna_screen.c", RNA_def_screen},
{"rna_sensor.c", RNA_def_sensor},
{"rna_vfont.c", RNA_def_vfont},
{"rna_wm.c", RNA_def_wm},
{"rna_world.c", RNA_def_world},
{NULL, NULL}};

View File

@@ -60,6 +60,7 @@ static StructRNA *rna_ID_refine(PointerRNA *ptr)
switch(GS(id->name)) {
case ID_BR: return &RNA_Brush;
case ID_CA: return &RNA_Camera;
case ID_CU: return &RNA_Curve;
case ID_GR: return &RNA_Group;
case ID_IM: return &RNA_Image;
case ID_IP: return &RNA_Ipo;
@@ -73,6 +74,7 @@ static StructRNA *rna_ID_refine(PointerRNA *ptr)
case ID_OB: return &RNA_Object;
case ID_SCE: return &RNA_Scene;
case ID_SCR: return &RNA_Screen;
case ID_VF: return &RNA_VFont;
case ID_WO: return &RNA_World;
case ID_WM: return &RNA_WindowManager;
default: return &RNA_ID;

View File

@@ -35,7 +35,7 @@
#else
void RNA_def_brushclone(BlenderRNA *brna)
void rna_def_brushclone(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -64,7 +64,7 @@ void RNA_def_brushclone(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Opacity", "The amount of opacity of the clone image.");
}
void RNA_def_brush(BlenderRNA *brna)
void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -158,4 +158,10 @@ void RNA_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");
}
void RNA_def_brush(BlenderRNA *brna)
{
rna_def_brush(brna);
rna_def_brushclone(brna);
}
#endif

View File

@@ -0,0 +1,358 @@
/**
* $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), Juho Veps<70>l<EFBFBD>inen
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "DNA_curve_types.h"
#ifdef RNA_RUNTIME
#else
static void rna_def_path(BlenderRNA *brna);
static void rna_def_nurbs(BlenderRNA *brna);
static void rna_def_font(BlenderRNA *brna);
void rna_def_curve(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "Curve", "ID", "Curve");
rna_def_path(brna);
rna_def_nurbs(brna);
rna_def_font(brna);
/* Number values */
prop= RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bevresol");
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined.");
prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "width");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor.");
prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext1");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object.");
prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext2");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object.");
prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "U Resolution", "Surface resolution in U direction.");
prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "V Resolution", "Surface resolution in V direction.");
prop= RNA_def_property(srna, "resolution_u_rendering", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "U Resolution (Rendering)", "Surface resolution in U direction used while rendering. Zero skips this property.");
prop= RNA_def_property(srna, "resolution_v_rendering", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "V Resolution (Rendering)", "Surface resolution in V direction used while rendering. Zero skips this property.");
/* pointers */
prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape.");
prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width).");
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", "");
/* Flags */
prop= RNA_def_property(srna, "3d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_3D);
RNA_def_property_ui_text(prop, "3D Curve", "Define curve in three dimensions. Note that in this case fill won't work.");
prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves.");
prop= RNA_def_property(srna, "back", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves.");
prop= RNA_def_property(srna, "retopo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_RETOPO);
RNA_def_property_ui_text(prop, "Retopo", "Turn on the re-topology tool.");
}
static void rna_def_path(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
/* number values */
prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pathlen");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Path Length", "If no speed IPO was set, the length of path in frames.");
/* flags */
prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH);
RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path.");
prop= RNA_def_property(srna, "follow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW);
RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path.");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path.");
prop= RNA_def_property(srna, "offset_path_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST);
RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset.");
}
static void rna_def_nurbs(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
/* flags */
prop= RNA_def_property(srna, "uv_orco", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'.");
prop= RNA_def_property(srna, "no_puno_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_NOPUNOFLIP);
RNA_def_property_ui_text(prop, "No Puno Flip", "Don't flip vertex normals while rendering.");
}
static void rna_def_font(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
/* number values */
prop= RNA_def_property(srna, "text_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Text Size", "");
prop= RNA_def_property(srna, "line_dist", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linedist");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Distance Between Lines of Text", "");
prop= RNA_def_property(srna, "word_spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wordspace");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Word Spacing", "");
prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Character Spacing", "");
prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shear");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters.");
prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center.");
prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center.");
prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulpos");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline.");
prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulheight");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Thickness", "");
prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "actbox");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Active Textbox", "");
/* strings */
prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, 21);
RNA_def_property_ui_text(prop, "Family", "Blender uses font from selfmade objects.");
prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, "Curve", "str");
RNA_def_property_ui_text(prop, "String", "");
RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */
RNA_def_struct_name_property(srna, prop);
/* pointers */
prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object.");
prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "VFont");
RNA_def_property_pointer_sdna(prop, NULL, "vfont");
RNA_def_property_ui_text(prop, "Font", "");
prop= RNA_def_property(srna, "textbox", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TextBox");
RNA_def_property_pointer_sdna(prop, NULL, "tb");
RNA_def_property_ui_text(prop, "Textbox", "");
/*
TODO: struct CharInfo curinfo;
Obviously a pointer won't work in this case.
*/
/*
prop= RNA_def_property(srna, "curinfo", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "CharInfo");
RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
RNA_def_property_ui_text(prop, "curinfo", "");
*/
/* flags */
prop= RNA_def_property(srna, "fast", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
RNA_def_property_ui_text(prop, "Fast", "Don't fill polygons while editing.");
prop= RNA_def_property(srna, "left_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_LEFT);
RNA_def_property_ui_text(prop, "Left Align", "Left align the text from the object center.");
prop= RNA_def_property(srna, "middle_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_MIDDLE);
RNA_def_property_ui_text(prop, "Middle Align", "Middle align the text from the object center.");
prop= RNA_def_property(srna, "right_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_RIGHT);
RNA_def_property_ui_text(prop, "Right Align", "Right align the text from the object center.");
prop= RNA_def_property(srna, "justify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_JUSTIFY);
RNA_def_property_ui_text(prop, "Justify", "Fill complete lines to maximum textframe width.");
prop= RNA_def_property(srna, "flush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_FLUSH);
RNA_def_property_ui_text(prop, "Left Align", "Fill every line to maximum textframe width distributing space among all characters.");
}
void rna_def_textbox(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "TextBox", NULL, "TextBox");
/* number values */
prop= RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox X Offset", "");
prop= RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "y");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Y Offset", "");
prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "w");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Width", "");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "h");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Height", "");
}
void rna_def_charinfo(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CharInfo", NULL, "CharInfo");
/* flags */
prop= RNA_def_property(srna, "style", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STYLE);
RNA_def_property_ui_text(prop, "Style", "");
prop= RNA_def_property(srna, "bold", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BOLD);
RNA_def_property_ui_text(prop, "Bold", "");
prop= RNA_def_property(srna, "italic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_ITALIC);
RNA_def_property_ui_text(prop, "Italic", "");
prop= RNA_def_property(srna, "underline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UNDERLINE);
RNA_def_property_ui_text(prop, "Underline", "");
prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_WRAP);
RNA_def_property_ui_text(prop, "Wrap", "");
}
void RNA_def_curve(BlenderRNA *brna)
{
rna_def_curve(brna);
rna_def_textbox(brna);
rna_def_charinfo(brna);
}
#endif

View File

@@ -87,6 +87,7 @@ void RNA_def_brushclone(struct BlenderRNA *brna);
void RNA_def_camera(struct BlenderRNA *brna);
void RNA_def_color(struct BlenderRNA *brna);
void RNA_def_controller(struct BlenderRNA *brna);
void RNA_def_curve(struct BlenderRNA *brna);
void RNA_def_gameproperty(struct BlenderRNA *brna);
void RNA_def_group(struct BlenderRNA *brna);
void RNA_def_image(struct BlenderRNA *brna);
@@ -96,8 +97,7 @@ void RNA_def_lattice(struct BlenderRNA *brna);
void RNA_def_main(struct BlenderRNA *brna);
void RNA_def_material(struct BlenderRNA *brna);
void RNA_def_mesh(struct BlenderRNA *brna);
void RNA_def_metaball(struct BlenderRNA *brna);
void RNA_def_metaelem(struct BlenderRNA *brna);
void RNA_def_meta(struct BlenderRNA *brna);
void RNA_def_modifier(struct BlenderRNA *brna);
void RNA_def_nodetree(struct BlenderRNA *brna);
void RNA_def_object(struct BlenderRNA *brna);
@@ -106,6 +106,7 @@ void RNA_def_rna(struct BlenderRNA *brna);
void RNA_def_scene(struct BlenderRNA *brna);
void RNA_def_screen(struct BlenderRNA *brna);
void RNA_def_sensor(struct BlenderRNA *brna);
void RNA_def_vfont(struct BlenderRNA *brna);
void RNA_def_wm(struct BlenderRNA *brna);
void RNA_def_world(BlenderRNA *brna);

View File

@@ -35,7 +35,7 @@
#else
void RNA_def_metaelem(BlenderRNA *brna)
void rna_def_metaelem(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -75,7 +75,7 @@ void RNA_def_metaelem(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the metaelement to fill.");
/* flag */
/* flags */
prop= RNA_def_property(srna, "metaelem_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE);
RNA_def_property_ui_text(prop, "Negative Metaelement", "Set metaball as negative one.");
@@ -89,7 +89,7 @@ void RNA_def_metaelem(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale Metaelement Radius", "Scale metaball radius?");
}
void RNA_def_metaball(BlenderRNA *brna)
void rna_def_metaball(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -124,4 +124,10 @@ void RNA_def_metaball(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Threshold", "Influence of metaelements.");
}
void RNA_def_meta(BlenderRNA *brna)
{
rna_def_metaelem(brna);
rna_def_metaball(brna);
}
#endif

View File

@@ -0,0 +1,52 @@
/**
* $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), Juho Veps<70>l<EFBFBD>inen
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "DNA_vfont_types.h"
#ifdef RNA_RUNTIME
#else
void RNA_def_vfont(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "VFont", "ID", "VFont");
/* number values */
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_range(prop, 0.1f, 100.0f); /* TODO: check bounds! */
RNA_def_property_ui_text(prop, "Font Scale", "");
}
#endif