* Added more lamp properties. (patch by Michael Fox)
* Fix a number of warnings in the RNA code.
* Converted DOS line endings to UNIX.
* Added some information on defining ID structs, and fixed use
  of "ID" inheritance for some non-ID structs.
* Added text on naming conventions to the RNA documentation, and
  applied it to the current code.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA#Naming_Conventions
This commit is contained in:
Brecht Van Lommel 2008-11-29 14:35:50 +00:00
parent 4fc369564a
commit 97dcbbf886
16 changed files with 432 additions and 66 deletions

@ -65,7 +65,7 @@
/* PLEASE READ INSTRUCTIONS ABOUT ADDING VARIABLES IN 'DNA' STRUCTS IN
../blenloader/intern/genfile.c
intern/dna_genfile.c
(ton)
*/

@ -39,6 +39,7 @@ extern StructRNA RNA_ID;
extern StructRNA RNA_IDProperty;
extern StructRNA RNA_IDPropertyGroup;
extern StructRNA RNA_Main;
extern StructRNA RNA_CurveMapping;
extern StructRNA RNA_Mesh;
extern StructRNA RNA_MVert;
extern StructRNA RNA_MVertGroup;

@ -48,13 +48,17 @@ void RNA_def_struct_identifier(StructRNA *srna, const char *identifier, const ch
/* Property */
typedef enum EnumPropertyFlag {
PROP_DEF_ENUM_BITFLAGS = 1
} EnumPropertyFlag;
PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, int subtype);
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit);
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname);
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname);
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname);
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bitflags);
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname, EnumPropertyFlag flag);
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname);
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname);

@ -240,13 +240,23 @@ static void rna_float_print(FILE *f, float num)
else fprintf(f, "%.10ff", num);
}
static void rna_int_print(FILE *f, int num)
{
if(num == INT_MIN) fprintf(f, "INT_MIN");
else if(num == INT_MAX) fprintf(f, "INT_MAX");
else fprintf(f, "%d", num);
}
static void rna_clamp_value(FILE *f, PropertyRNA *prop)
{
if(prop->type == PROP_INT) {
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX)
fprintf(f, " CLAMP(value, %d, %d);\n", iprop->hardmin, iprop->hardmax);
if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
fprintf(f, " CLAMP(value, ");
rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
rna_int_print(f, iprop->hardmax); fprintf(f, ");\n");
}
}
else if(prop->type == PROP_FLOAT) {
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
@ -323,7 +333,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else if(prop->type == PROP_ENUM && dp->enumbitflags) {
fprintf(f, " data->%s &= ~%d;\n", dp->dnaname, rna_enum_bitmask(prop));
fprintf(f, " data->%s |= value;\n", dp->dnaname, rna_enum_bitmask(prop));
fprintf(f, " data->%s |= value;\n", dp->dnaname);
}
else {
rna_clamp_value(f, prop);
@ -767,7 +777,13 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
}
case PROP_INT: {
IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s, %s, %d, %d, %d, %d, %d,\n\t%d, ", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range), iprop->softmin, iprop->softmax, iprop->hardmin, iprop->hardmax, iprop->step, iprop->defaultvalue);
fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range), iprop->softmin, iprop->softmax, iprop->hardmin, iprop->hardmax, iprop->step, iprop->defaultvalue);
rna_int_print(f, iprop->softmin); fprintf(f, ", ");
rna_int_print(f, iprop->softmax); fprintf(f, ", ");
rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
rna_int_print(f, iprop->hardmax); fprintf(f, ", ");
rna_int_print(f, iprop->step); fprintf(f, ", ");
rna_int_print(f, iprop->defaultvalue); fprintf(f, ", ");
if(prop->arraylength) fprintf(f, "rna_%s_%s_default\n", srna->identifier, prop->identifier);
else fprintf(f, "NULL\n");
break;
@ -861,6 +877,7 @@ typedef struct RNAProcessItem {
RNAProcessItem PROCESS_ITEMS[]= {
{"rna_ID.c", RNA_def_ID},
{"rna_main.c", RNA_def_main},
{"rna_color.c", RNA_def_color},
{"rna_mesh.c", RNA_def_mesh},
{"rna_nodetree.c", RNA_def_nodetree},
{"rna_material.c", RNA_def_material},

@ -66,7 +66,6 @@ static StructRNA *rna_ID_refine(PointerRNA *ptr)
case ID_SCE: return &RNA_Scene;
case ID_SCR: return &RNA_Screen;
case ID_WM: return &RNA_WindowManager;
case ID_SE: return &RNA_Sensor;
default: return &RNA_ID;
}
}

@ -868,7 +868,7 @@ void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, Collectio
memset(&iter->ptr, 0, sizeof(iter->ptr));
}
else
memset(&iter, 0, sizeof(*iter));
memset(iter, 0, sizeof(*iter));
}
void RNA_property_collection_next(CollectionPropertyIterator *iter)

@ -0,0 +1,50 @@
/**
* $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 <stdio.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "DNA_color_types.h"
#ifdef RNA_RUNTIME
#else
void RNA_def_color(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "CurveMapPoint", NULL, "CurveMapPoint");
srna= RNA_def_struct(brna, "CurveMap", NULL, "CurveMap");
srna= RNA_def_struct(brna, "CurveMapping", NULL, "CurveMapping");
}
#endif

@ -562,7 +562,7 @@ void RNA_def_property_flag(PropertyRNA *prop, int flag)
void RNA_def_property_array(PropertyRNA *prop, int arraylength)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_BOOLEAN:
@ -585,7 +585,7 @@ void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *d
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_INT: {
@ -612,7 +612,7 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_INT: {
@ -640,7 +640,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
fprintf(stderr, "RNA_def_property_struct_type: only during preprocessing.\n");
@ -667,7 +667,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
int i;
switch(prop->type) {
@ -689,7 +689,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_STRING: {
@ -706,7 +706,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_BOOLEAN: {
@ -723,7 +723,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_BOOLEAN: {
@ -740,7 +740,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_INT: {
@ -757,7 +757,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_INT: {
@ -774,7 +774,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_FLOAT: {
@ -791,7 +791,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_FLOAT: {
@ -808,7 +808,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_STRING: {
@ -825,7 +825,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
{
StructRNA *srna;
StructRNA *srna= DefRNA.laststruct;
switch(prop->type) {
case PROP_ENUM: {
@ -953,7 +953,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
rna_def_property_sdna(prop, structname, propname);
}
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bitflags)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname, EnumPropertyFlag flag)
{
PropertyDefRNA *dp;
StructRNA *srna= DefRNA.laststruct;
@ -970,7 +970,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
}
if((dp=rna_def_property_sdna(prop, structname, propname))) {
dp->enumbitflags= bitflags;
dp->enumbitflags= (flag & PROP_DEF_ENUM_BITFLAGS);
if(prop->arraylength) {
prop->arraylength= 0;

@ -81,6 +81,7 @@ extern BlenderDefRNA DefRNA;
extern BlenderRNA BLENDER_RNA;
void RNA_def_ID(struct BlenderRNA *brna);
void RNA_def_color(struct BlenderRNA *brna);
void RNA_def_lamp(struct BlenderRNA *brna);
void RNA_def_main(struct BlenderRNA *brna);
void RNA_def_mesh(struct BlenderRNA *brna);

@ -51,33 +51,324 @@ void RNA_def_lamp(BlenderRNA *brna)
{LA_SHAD_BUF, "BUFSHADOW", "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer."},
{LA_SHAD_RAY, "RAYSHADOW", "Ray Shadow", "Use ray tracing for shadow."},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_raysampmethod_items[] = {
{LA_SAMP_CONSTANT, "CONSTANT", "Constant", ""},
{LA_SAMP_HALTON, "HALTON", "Halton", ""},
{LA_SHAD_RAY, "LA_SAMP_HAMMERSLEY", "Hammersley", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_areashape_items[] = {
{LA_AREA_SQUARE, "SQUARE", "Square", ""},
{LA_AREA_RECT, "RECTANGLE", "Rectangle", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_shadbuftype_items[] = {
{LA_SHADBUF_REGULAR , "REGULAR", "Classical", "Use the Classic Buffer type"},
{LA_SHADBUF_IRREGULAR, "IRREGULAR", "Irregular", "Use the Irregular Shadow Buffer type."},
{LA_SHADBUF_HALFWAY, "HALFWAY", "Classic-Halfway", "Use the Classic-Halfway Buffer type."},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
{LA_SHADBUF_BOX , "BOX", "Box", "Use the Box filter"},
{LA_SHADBUF_TENT, "TENT", "Tent", "Use the Tent Filter."},
{LA_SHADBUF_GAUSS, "GAUSS", "Gauss", "Use the Gauss filter."},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_numbuffer_items[] = {
{1, "1BUFF", "1", "Sample 1 Shadow Buffer."},
{4, "4BUFF", "4", "Sample 4 Shadow Buffers."},
{9, "9BUFF", "9", "Sample 9 Shadow Buffers."},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_skycolorspace_items[] = {
{0, "SMPTE", "SMPTE", ""},
{1, "REC709", "REC709", ""},
{2, "CIE", "CIE", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_blendmode_items[] = {
{0, "MIX", "Mix", ""},
{1, "ADD", "Add", ""},
{2, "MULTIPLY", "Multiply", ""},
{3, "SUBTRACT", "Subtract", ""},
{4, "SCREEN", "Screen", ""},
{5, "DIVIDE", "Divide", ""},
{6, "DIFFERENCE", "Difference", ""},
{7, "DARKEN", "Darken", ""},
{8, "LIGHTEN", "Lighten", ""},
{9, "OVERLAY", "Overlay", ""},
{10, "DODGE", "Dodge", ""},
{11, "BURN", "Burn", ""},
{12, "HUE", "Hue", ""},
{13, "SATURATION", "Satruation", ""},
{14, "VALUE", "Value", ""},
{15, "COLOR", "Color", ""},
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_fallofftype_items[] = {
{LA_FALLOFF_CONSTANT, "CONSTANT", "Constant", ""},
{LA_FALLOFF_INVLINEAR, "INVLINEAR", "Invert Linear", ""},
{LA_FALLOFF_INVSQUARE, "INVSQUARE", "Invert Square", ""},
{LA_FALLOFF_CURVE, "CURVE", "Custum Curve", ""},
{LA_FALLOFF_SLIDERS, "SLIDERS", "Lin/Quad Weighted", ""},
{0, NULL, NULL, NULL}};
srna= RNA_def_struct(brna, "Lamp", "ID", "Lamp");
/* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
prop= RNA_def_property(srna, "dist", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f , 9999.0f);
prop= RNA_def_property(srna, "sky_colorspace", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "");
prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype", 0);
RNA_def_property_enum_items(prop, prop_blendmode_items);
RNA_def_property_ui_text(prop, "Sky Blend Type", "Blend type for how sky is combined with world sky");
prop= RNA_def_property(srna, "area_shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Area Shape", "Shape of the Area lamp");
prop= RNA_def_property(srna, "ray_samp_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_raysampmethod_items);
RNA_def_property_ui_text(prop, "Ray Sample Method", "The Method in how rays are sampled");
prop= RNA_def_property(srna, "buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype", 0);
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Buffer Type", "Type of Shadow Buffer.");
prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype", 0);
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Filter Type", "Type of Shadow Buffer Filter.");
prop= RNA_def_property(srna, "buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Sample Buffers", "Number of Buffers to sample.");
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance.");
prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custum Lamp Falloff Curve");
/* Number values */
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Distance", "Distance that the lamp emits light.");
prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation.");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation.");
prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softeness of the spotlight edge.");
prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotsize");
RNA_def_property_range(prop, 1.0f ,180.0f);
RNA_def_property_ui_text(prop, "Spot Size", "The angle of the spotlight beam in degrees.");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Clip Start", "Distance that the buffer calculations start.");
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Clip End", "Distance that the buffer calculations finish.");
prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Bias", "Shadow Map sampling bias.");
prop= RNA_def_property(srna, "soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Soft", "Size of shadow sampling area.");
prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1,16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow map samples.");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f , 10.0f);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits.");
prop= RNA_def_property(srna, "ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Ray Samples", "Amount of smaples taken extra (samples x samples).");
prop= RNA_def_property(srna, "ray_sampy", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1,16);
RNA_def_property_ui_text(prop, "Ray Samples Y", "Amount of smaples taken extra (samples x samples).");
prop= RNA_def_property(srna, "area_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Area Size", "Size of the area of the Area Lamp.");
prop= RNA_def_property(srna, "area_sizey", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Area Size Y", "Size of the area of the Area Lamp.");
prop= RNA_def_property(srna, "adapt_thresh", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Adapt Threshold", "Threshold for Adaptive Sampleing.");
prop= RNA_def_property(srna, "buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Buffer Size", "The Size in Bytes of the Shadow Buffer");
prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Halo Intensity", "Intesity of Spot Halo");
prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,20.0f);
RNA_def_property_ui_text(prop, "Hor. Bright", "horizon brightness");
prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,10.0f);
RNA_def_property_ui_text(prop, "Hor. Spread", "horizon Spread");
prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,10.0f);
RNA_def_property_ui_text(prop, "Sun Bright", "Sun Brightness");
prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun Size");
prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Back Light", "Backscatter Light");
prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,10.0f);
RNA_def_property_ui_text(prop, "Sun Intens", "Sun Intensity");
prop= RNA_def_property(srna, "atm_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,30.0f);
RNA_def_property_ui_text(prop, "Turbidity", "Sky Tubidity");
prop= RNA_def_property(srna, "atm_inscattering_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Inscatter", "Scatter Contibution factor");
prop= RNA_def_property(srna, "atm_extinction_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Extinction", "Extinction Scattering Contibution factor");
prop= RNA_def_property(srna, "atm_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,500.0f);
RNA_def_property_ui_text(prop, "Atmos Distance", "Scale blender distance to real distance");
prop= RNA_def_property(srna, "sky_blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f,2.0f);
RNA_def_property_ui_text(prop, "Sky Blend Factor", "Blend factor with sky");
prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f,20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Expsure Correction");
/*short sky_colorspace, pad4;*/
/* Colors */
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Lamp color.");
RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10.0f, 3.0f);
prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Shadow Color", "");
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10.0f, 3.0f);
/* Booleans */
prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatically Sets Clip start to the nearest pixel.");
prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatically Sets Clip start to the furthurest away pixel.");
prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphersise parts in full shadow.");
prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling.");
prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling.");
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "sky", "Apply sun effect on sky");
prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on Atmosphere");
/* mode */
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Lamp creates a halo.");
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Lamp is only used on the Scene layer the lamp is on.");
prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light.");
prop= RNA_def_property(srna, "no_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "No Specular", "Lamp does not create specular higlights.");
prop= RNA_def_property(srna, "no_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "No Diffuse", "Lamp does not create diffuse shading.");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Lamp only creates shadows.");
prop= RNA_def_property(srna, "shadow", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode", 1); /* use bitflags */
RNA_def_property_enum_sdna(prop, NULL, "mode", PROP_DEF_ENUM_BITFLAGS);
RNA_def_property_enum_items(prop, prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow", "Method to compute lamp shadow.");
prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Sets square spotbundles.");
prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Sets light intensity to zero beyond lamp distance.");
}
#endif

@ -52,7 +52,7 @@ void RNA_def_material(BlenderRNA *brna)
{0, NULL, NULL, NULL}};
static EnumPropertyItem prop_diff_shader_items[] = {
{MA_DIFF_LAMBERT, "DIFF_LAMBERT", "Lambert", ""},
{MA_DIFF_ORENNAYAR, "DIFF_ORENNAYAR", "Orennayar", ""},
{MA_DIFF_ORENNAYAR, "DIFF_ORENNAYAR", "Oren-Nayar", ""},
{MA_DIFF_TOON, "DIFF_TOON", "Toon", ""},
{MA_DIFF_MINNAERT, "DIFF_MINNAERT", "Minnaert", ""},
{MA_DIFF_FRESNEL, "DIFF_FRESNEL", "Fresnel", ""},
@ -61,52 +61,55 @@ void RNA_def_material(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Material", "ID", "Material");
prop= RNA_def_property(srna, "colormodel", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "color_model", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "colormodel", 0);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Color Model", "Color model.");
RNA_def_property_ui_text(prop, "Color Model", "");
/* colors */
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, "Material", "r");
prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Diffuse color.");
RNA_def_property_ui_text(prop, "Diffuse Color", "");
RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
prop= RNA_def_property(srna, "specular", PROP_FLOAT, PROP_COLOR);
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "specr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Specular color.");
RNA_def_property_ui_text(prop, "Specular Color", "");
RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
prop= RNA_def_property(srna, "mirror", PROP_FLOAT, PROP_COLOR);
prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "mirr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color.");
RNA_def_property_ui_text(prop, "Mirror Color", "");
RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_COLOR);
prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color.");
RNA_def_property_ui_text(prop, "Ambient Color", "");
RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha");
RNA_def_property_ui_text(prop, "Alpha", "");
/* diffuse shaders */
prop= RNA_def_property(srna, "diff_shader", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "diff_shader", 0);
RNA_def_property_enum_items(prop, prop_diff_shader_items);
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "Diffuse shader model.");
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
prop= RNA_def_property(srna, "ref", PROP_FLOAT, PROP_NONE);
prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Reflection", "Sets the amount of reflection.");
RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection.");
prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Roughness", "Sets Oren Nayar Roughness");
RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
prop= RNA_def_property(srna, "params1_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param");
@ -116,7 +119,7 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Darkness", "Sets Minnaert darkness.");
RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness.");
/* raytrace mirror */
prop= RNA_def_property(srna, "mode_ray_mirror", PROP_BOOLEAN, PROP_NONE);
@ -161,13 +164,12 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "fadeto_mir", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
RNA_def_property_ui_text(prop, "Ray end fade-out", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
RNA_def_property_ui_text(prop, "Ray End Fade-out", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
/* nodetree */
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "NodeTree");
RNA_def_property_ui_text(prop, "Nodetree", "Nodetree");
RNA_def_property_ui_text(prop, "Nodetree", "");
}
#endif

@ -444,7 +444,8 @@ static void rna_def_mvert_group(BlenderRNA *brna)
srna= RNA_def_struct(brna, "MVertGroup", NULL, "Mesh Vertex Group");
RNA_def_struct_sdna(srna, "MDeformWeight");
/* XXX how to point to actual group? */
/* we can't point to actual group, it is in the object and so
* there is no unique group to point to, hence the index */
prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "def_nr");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
@ -463,7 +464,7 @@ static void rna_def_mvert(BlenderRNA *brna)
srna= RNA_def_struct(brna, "MVert", NULL, "Mesh Vertex");
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
RNA_def_property_ui_text(prop, "Location", "Vertex Location");
RNA_def_property_ui_text(prop, "Location", "");
/*prop= RNA_def_property(srna, "no", PROP_FLOAT, PROP_VECTOR);
RNA_def_property_float_funcs(prop, "rna_MVert_no_get", NULL, NULL);
@ -940,7 +941,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "Materials");
RNA_def_property_ui_text(prop, "Materials", "");
/*prop= RNA_def_property(srna, "key", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Key", "");*/

@ -47,7 +47,7 @@ void RNA_def_nodetree(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
RNA_def_property_struct_type(prop, "Node");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_ui_text(prop, "Nodes", "Nodes in the Node Tree.");
RNA_def_property_ui_text(prop, "Nodes", "");
srna= RNA_def_struct(brna, "Node", NULL, "Node");
RNA_def_struct_sdna(srna, "bNode");
@ -56,7 +56,7 @@ void RNA_def_nodetree(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "locx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Location", "Node Location");
RNA_def_property_ui_text(prop, "Location", "");
}

@ -56,7 +56,7 @@ void RNA_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_VECTOR);
RNA_def_property_ui_text(prop, "Location", "Location of the object.");
RNA_def_property_ui_text(prop, "Location", "");
}

@ -101,7 +101,7 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "Objects in the scene.");
RNA_def_property_ui_text(prop, "Objects", "");
RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0);
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
@ -112,25 +112,25 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "prop_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Proportional Mode", "Proportional edit mode.");
RNA_def_property_ui_text(prop, "Proportional Mode", "Proportional editing mode.");
prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "Current frame.");
RNA_def_property_ui_text(prop, "Current Frame", "");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "Start frame.");
RNA_def_property_ui_text(prop, "Start Frame", "");
prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.efra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "End frame.");
RNA_def_property_ui_text(prop, "End Frame", "");
prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
@ -143,7 +143,7 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "NodeTree");
RNA_def_property_ui_text(prop, "Nodetree", "Nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
}
#endif

@ -41,7 +41,7 @@ void RNA_def_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "Sensor", "ID", "Sensor");
srna= RNA_def_struct(brna, "Sensor", NULL, "Sensor");
}