Animato RNA wrapping:
It's about time that the RNA wrapping for various parts of the animation system were cleaned up for my recent changes. I've moved some code around (and/or deleted a file or two) in the process.
This commit is contained in:
@@ -448,7 +448,7 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index
|
||||
|
||||
|
||||
/* allocate new eval-strip for this strip + add to stack */
|
||||
nes= MEM_callocN(sizeof(NlaEvalStrip), "bNlaEvalStrip");
|
||||
nes= MEM_callocN(sizeof(NlaEvalStrip), "NlaEvalStrip");
|
||||
|
||||
nes->track= nlt;
|
||||
nes->strip= astrip;
|
||||
@@ -473,7 +473,7 @@ static void nlastrip_ctime_evaluate (ListBase *channels, NlaEvalStrip *nes, floa
|
||||
/* write the accumulated settings to */
|
||||
static void nladata_flush_channels (PointerRNA *ptr, ListBase *channels)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------- */
|
||||
|
||||
@@ -287,14 +287,13 @@ static char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
|
||||
case AC_QUAT_Z:
|
||||
*array_index= 3; return "rotation";
|
||||
|
||||
#if 0 // XXX these were not 'official' channels (i.e. not in bf-releases)... these will need separate wrapping to work...
|
||||
case AC_EUL_X:
|
||||
*array_index= 0; return "rotation";
|
||||
*array_index= 0; return "euler_rotation";
|
||||
case AC_EUL_Y:
|
||||
*array_index= 1; return "rotation";
|
||||
*array_index= 1; return "euler_rotation";
|
||||
case AC_EUL_Z:
|
||||
*array_index= 2; return "rotation";
|
||||
#endif
|
||||
*array_index= 2; return "euler_rotation";
|
||||
|
||||
case -1: // XXX special case for rotation drivers... until eulers are added...
|
||||
*array_index= 0; return "rotation";
|
||||
|
||||
@@ -937,7 +936,7 @@ static void icu_to_fcurves (ListBase *list, IpoCurve *icu, char *actname, char *
|
||||
fcurve= fcu;
|
||||
|
||||
/* set path */
|
||||
fcurve->rna_path= MEM_dupallocN(abp->path);
|
||||
fcurve->rna_path= adrcode_bitmap_path_copy(abp->path);
|
||||
fcurve->array_index= abp->array_index;
|
||||
|
||||
/* convert keyframes
|
||||
@@ -1010,9 +1009,11 @@ static void icu_to_fcurves (ListBase *list, IpoCurve *icu, char *actname, char *
|
||||
if (icu->ipo != IPO_MIXED)
|
||||
dst->ipo= icu->ipo;
|
||||
|
||||
/* correct values for object rotation curves - they were degrees/10 */
|
||||
/* correct values for euler rotation curves - they were degrees/10 */
|
||||
// XXX for now, just make them into radians as RNA sets/reads directly in that form
|
||||
if ((icu->blocktype == ID_OB) && ELEM3(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) {
|
||||
if ( ((icu->blocktype == ID_OB) && ELEM3(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) ||
|
||||
((icu->blocktype == ID_PO) && ELEM3(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z)) )
|
||||
{
|
||||
const float fac= (float)M_PI / 18.0f; //10.0f * M_PI/180.0f;
|
||||
|
||||
dst->vec[0][1] *= fac;
|
||||
|
||||
@@ -69,7 +69,7 @@ int geticon_anim_blocktype(short blocktype)
|
||||
case ID_PO:
|
||||
return ICON_POSE_HLT;
|
||||
case ID_KE:
|
||||
return ICON_EDIT;
|
||||
return ICON_SHAPEKEY;
|
||||
case ID_MA:
|
||||
return ICON_MATERIAL;
|
||||
case ID_WO:
|
||||
|
||||
@@ -3178,6 +3178,8 @@ static int tselem_rna_icon(PointerRNA *ptr)
|
||||
return ICON_LIBRARY_DEHLT;
|
||||
else if(rnatype == &RNA_Action)
|
||||
return ICON_ACTION;
|
||||
else if(rnatype == &RNA_FCurve)
|
||||
return ICON_IPO_DEHLT;
|
||||
//else if(rnatype == &RNA_Ipo)
|
||||
// return ICON_IPO_DEHLT;
|
||||
else if(rnatype == &RNA_Key)
|
||||
|
||||
@@ -255,14 +255,6 @@ enum {
|
||||
FCURVE_EXTRAPOLATE_LINEAR, /* just extend gradient of segment between first segment keyframes */
|
||||
} eFCurve_Extend;
|
||||
|
||||
/* interpolation modes (used only for BezTriple->ipo) */
|
||||
// TODO: move this to curve-types file?
|
||||
enum {
|
||||
BEZT_IPO_CONST = 0, /* constant interpolation */
|
||||
BEZT_IPO_LIN, /* linear interpolation */
|
||||
BEZT_IPO_BEZ, /* bezier interpolation */
|
||||
} eBezTriple_Interpolation;
|
||||
|
||||
/* ************************************************ */
|
||||
/* 'Action' Datatypes */
|
||||
|
||||
|
||||
@@ -260,12 +260,23 @@ typedef struct Curve {
|
||||
/* flagu flagv (nurb) */
|
||||
#define CU_CYCLIC 1
|
||||
|
||||
/* *************** BEZTRIPLE **************** */
|
||||
|
||||
/* h1 h2 (beztriple) */
|
||||
#define HD_FREE 0
|
||||
#define HD_AUTO 1
|
||||
#define HD_VECT 2
|
||||
#define HD_ALIGN 3
|
||||
#define HD_AUTO_ANIM 4
|
||||
enum {
|
||||
HD_FREE = 0,
|
||||
HD_AUTO,
|
||||
HD_VECT,
|
||||
HD_ALIGN,
|
||||
HD_AUTO_ANIM
|
||||
} eBezTriple_Handle;
|
||||
|
||||
/* interpolation modes (used only for BezTriple->ipo) */
|
||||
enum {
|
||||
BEZT_IPO_CONST = 0, /* constant interpolation */
|
||||
BEZT_IPO_LIN, /* linear interpolation */
|
||||
BEZT_IPO_BEZ, /* bezier interpolation */
|
||||
} eBezTriple_Interpolation;
|
||||
|
||||
/* *************** CHARINFO **************** */
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ struct Main;
|
||||
extern BlenderRNA BLENDER_RNA;
|
||||
|
||||
extern StructRNA RNA_Action;
|
||||
extern StructRNA RNA_ActionChannel;
|
||||
extern StructRNA RNA_ActionGroup;
|
||||
extern StructRNA RNA_Actuator;
|
||||
extern StructRNA RNA_ActuatorSensor;
|
||||
extern StructRNA RNA_AlwaysSensor;
|
||||
extern StructRNA RNA_AndController;
|
||||
extern StructRNA RNA_AnimData;
|
||||
extern StructRNA RNA_Area;
|
||||
extern StructRNA RNA_AreaLamp;
|
||||
extern StructRNA RNA_Armature;
|
||||
@@ -80,6 +80,7 @@ extern StructRNA RNA_DecimateModifier;
|
||||
extern StructRNA RNA_DelaySensor;
|
||||
extern StructRNA RNA_DisplaceModifier;
|
||||
extern StructRNA RNA_DomainFluidSettings;
|
||||
extern StructRNA RNA_Driver;
|
||||
extern StructRNA RNA_EdgeSplitModifier;
|
||||
extern StructRNA RNA_EffectSequence;
|
||||
extern StructRNA RNA_EnumProperty;
|
||||
@@ -87,6 +88,7 @@ extern StructRNA RNA_EnumPropertyItem;
|
||||
extern StructRNA RNA_EnvironmentMap;
|
||||
extern StructRNA RNA_ExplodeModifier;
|
||||
extern StructRNA RNA_ExpressionController;
|
||||
extern StructRNA RNA_FCurve;
|
||||
extern StructRNA RNA_FieldSettings;
|
||||
extern StructRNA RNA_FloatProperty;
|
||||
extern StructRNA RNA_FluidFluidSettings;
|
||||
@@ -112,9 +114,6 @@ extern StructRNA RNA_ImageSequence;
|
||||
extern StructRNA RNA_ImageUser;
|
||||
extern StructRNA RNA_InflowFluidSettings;
|
||||
extern StructRNA RNA_IntProperty;
|
||||
extern StructRNA RNA_Ipo;
|
||||
extern StructRNA RNA_IpoCurve;
|
||||
extern StructRNA RNA_IpoDriver;
|
||||
extern StructRNA RNA_JoystickSensor;
|
||||
extern StructRNA RNA_Key;
|
||||
extern StructRNA RNA_KeyboardSensor;
|
||||
@@ -235,13 +234,13 @@ extern StructRNA RNA_TextMarker;
|
||||
extern StructRNA RNA_Texture;
|
||||
extern StructRNA RNA_TextureSlot;
|
||||
extern StructRNA RNA_Theme;
|
||||
extern StructRNA RNA_ThemeActionEditor;
|
||||
extern StructRNA RNA_ThemeDopeSheetEditor;
|
||||
extern StructRNA RNA_ThemeAudioWindow;
|
||||
extern StructRNA RNA_ThemeBoneColorSet;
|
||||
extern StructRNA RNA_ThemeButtonsWindow;
|
||||
extern StructRNA RNA_ThemeFileBrowser;
|
||||
extern StructRNA RNA_ThemeImageEditor;
|
||||
extern StructRNA RNA_ThemeIpoEditor;
|
||||
extern StructRNA RNA_ThemeGraphEditor;
|
||||
extern StructRNA RNA_ThemeNLAEditor;
|
||||
extern StructRNA RNA_ThemeNodeEditor;
|
||||
extern StructRNA RNA_ThemeOutliner;
|
||||
|
||||
@@ -936,7 +936,7 @@ typedef struct RNAProcessItem {
|
||||
RNAProcessItem PROCESS_ITEMS[]= {
|
||||
{"rna_ID.c", RNA_def_ID},
|
||||
{"rna_texture.c", RNA_def_texture},
|
||||
{"rna_action.c", RNA_def_action},
|
||||
{"rna_action.c", RNA_def_animation},
|
||||
{"rna_actuator.c", RNA_def_actuator},
|
||||
{"rna_armature.c", RNA_def_armature},
|
||||
{"rna_brush.c", RNA_def_brush},
|
||||
@@ -949,7 +949,6 @@ RNAProcessItem PROCESS_ITEMS[]= {
|
||||
{"rna_fluidsim.c", RNA_def_fluidsim},
|
||||
{"rna_group.c", RNA_def_group},
|
||||
{"rna_image.c", RNA_def_image},
|
||||
{"rna_ipo.c", RNA_def_ipo},
|
||||
{"rna_key.c", RNA_def_key},
|
||||
{"rna_lamp.c", RNA_def_lamp},
|
||||
{"rna_lattice.c", RNA_def_lattice},
|
||||
|
||||
@@ -65,7 +65,7 @@ StructRNA *rna_ID_refine(PointerRNA *ptr)
|
||||
case ID_CU: return &RNA_Curve;
|
||||
case ID_GR: return &RNA_Group;
|
||||
case ID_IM: return &RNA_Image;
|
||||
case ID_IP: return &RNA_Ipo;
|
||||
//case ID_IP: return &RNA_Ipo;
|
||||
case ID_KE: return &RNA_Key;
|
||||
case ID_LA: return &RNA_Lamp;
|
||||
case ID_LI: return &RNA_Library;
|
||||
|
||||
@@ -29,74 +29,172 @@
|
||||
|
||||
#include "rna_internal.h"
|
||||
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_action_types.h"
|
||||
#include "DNA_constraint_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
static void rna_Driver_RnaPath_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
ChannelDriver *driver= (ChannelDriver *)ptr->data;
|
||||
|
||||
if (driver->rna_path)
|
||||
strcpy(value, driver->rna_path);
|
||||
else
|
||||
strcpy(value, "");
|
||||
}
|
||||
|
||||
static int rna_Driver_RnaPath_length(PointerRNA *ptr)
|
||||
{
|
||||
ChannelDriver *driver= (ChannelDriver *)ptr->data;
|
||||
|
||||
if (driver->rna_path)
|
||||
return strlen(driver->rna_path);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rna_Driver_RnaPath_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
ChannelDriver *driver= (ChannelDriver *)ptr->data;
|
||||
|
||||
if (driver->rna_path)
|
||||
MEM_freeN(driver->rna_path);
|
||||
|
||||
if (strlen(value))
|
||||
driver->rna_path= BLI_strdup(value);
|
||||
else
|
||||
driver->rna_path= NULL;
|
||||
}
|
||||
|
||||
|
||||
static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
FCurve *fcu= (FCurve *)ptr->data;
|
||||
|
||||
if (fcu->rna_path)
|
||||
strcpy(value, fcu->rna_path);
|
||||
else
|
||||
strcpy(value, "");
|
||||
}
|
||||
|
||||
static int rna_FCurve_RnaPath_length(PointerRNA *ptr)
|
||||
{
|
||||
FCurve *fcu= (FCurve *)ptr->data;
|
||||
|
||||
if (fcu->rna_path)
|
||||
return strlen(fcu->rna_path);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
FCurve *fcu= (FCurve *)ptr->data;
|
||||
|
||||
if (fcu->rna_path)
|
||||
MEM_freeN(fcu->rna_path);
|
||||
|
||||
if (strlen(value))
|
||||
fcu->rna_path= BLI_strdup(value);
|
||||
else
|
||||
fcu->rna_path= NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void rna_def_action_channel(BlenderRNA *brna)
|
||||
// XXX maybe this should be in a separate file?
|
||||
void rna_def_channeldriver(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
static EnumPropertyItem prop_type_items[] = {
|
||||
{DRIVER_TYPE_CHANNEL, "NORMAL", "Normal", ""},
|
||||
{DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted Expression", ""},
|
||||
{DRIVER_TYPE_ROTDIFF, "ROTDIFF", "Rotational Difference", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "ActionChannel", NULL);
|
||||
RNA_def_struct_sdna(srna, "bActionChannel");
|
||||
RNA_def_struct_ui_text(srna, "Action Channel", "A channel for one object or bone's Ipos in an Action.");
|
||||
srna= RNA_def_struct(brna, "ChannelDriver", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Driver", "Driver for the value of a setting based on an external value.");
|
||||
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Name", "");
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
/* 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", "Driver types.");
|
||||
|
||||
prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "grp");
|
||||
RNA_def_property_struct_type(prop, "ActionGroup");
|
||||
/* String values */
|
||||
prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Expression", "Expression to use for Scripted Expression.");
|
||||
|
||||
/* Pointers */
|
||||
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "id");
|
||||
RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Driver.");
|
||||
|
||||
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Group", "Action Group that this Action Channel belongs to.");
|
||||
|
||||
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_struct_type(prop, "Ipo");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Ipo", "Ipo block this Action Channel uses.");
|
||||
|
||||
/* constraint channel rna not yet implemented */
|
||||
/*prop= RNA_def_property(srna, "constraint_channels", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "ConstraintChannel", NULL);
|
||||
RNA_def_property_struct_type(prop, "ConstraintChannel");
|
||||
RNA_def_property_ui_text(prop, "Constraint Channels", "Ipos of Constraints attached to this object or bone."); */
|
||||
|
||||
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_SELECTED);
|
||||
RNA_def_property_ui_text(prop, "Selected", "Action Channel is selected.");
|
||||
|
||||
prop= RNA_def_property(srna, "highlighted", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_HILIGHTED);
|
||||
RNA_def_property_ui_text(prop, "Highlighted", "Action Channel is highlighted.");
|
||||
|
||||
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_HIDDEN);
|
||||
RNA_def_property_ui_text(prop, "Hidden", "Action Channel is hidden.");
|
||||
|
||||
prop= RNA_def_property(srna, "protected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_PROTECTED);
|
||||
RNA_def_property_ui_text(prop, "Protected", "Action Channel is protected.");
|
||||
|
||||
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_EXPANDED);
|
||||
RNA_def_property_ui_text(prop, "Expanded", "Action Channel is expanded.");
|
||||
|
||||
prop= RNA_def_property(srna, "show_ipo", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_SHOWIPO);
|
||||
RNA_def_property_ui_text(prop, "Show Ipo", "Action Channel's Ipos are visible.");
|
||||
|
||||
prop= RNA_def_property(srna, "show_constraints", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACHAN_SHOWCONS);
|
||||
RNA_def_property_ui_text(prop, "Show Constraints", "Action Channel's constraints are visible.");
|
||||
RNA_def_property_string_funcs(prop, "rna_Driver_RnaPath_get", "rna_Driver_RnaPath_length", "rna_Driver_RnaPath_set");
|
||||
RNA_def_property_ui_text(prop, "Driver RNA Path", "RNA Path (from Driver Object) to property used as Driver.");
|
||||
|
||||
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Driver RNA Array Index", "Index to the specific property used as Driver if applicable.");
|
||||
}
|
||||
|
||||
// XXX maybe this should be in a separate file?
|
||||
void rna_def_fcurve(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
static EnumPropertyItem prop_mode_extend_items[] = {
|
||||
{FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant", ""},
|
||||
{FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "FCurve", NULL);
|
||||
RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time.");
|
||||
|
||||
/* Enums */
|
||||
prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "extend");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_mode_extend_items);
|
||||
RNA_def_property_ui_text(prop, "Extrapolation", "");
|
||||
|
||||
/* Pointers */
|
||||
//prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
|
||||
//RNA_def_property_pointer_sdna(prop, NULL, "driver");
|
||||
//RNA_def_property_ui_text(prop, "Driver", "");
|
||||
|
||||
/* Path + Array Index */
|
||||
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");
|
||||
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path to property affected by F-Curve.");
|
||||
|
||||
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable.");
|
||||
|
||||
/* Collections */
|
||||
prop= RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "fpt", "totvert");
|
||||
RNA_def_property_struct_type(prop, "CurvePoint");
|
||||
RNA_def_property_ui_text(prop, "Sampled Points", "Sampled animation data");
|
||||
|
||||
prop= RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "bezt", "totvert");
|
||||
RNA_def_property_struct_type(prop, "BezierCurvePoint");
|
||||
RNA_def_property_ui_text(prop, "Keyframes", "User-editable keyframes");
|
||||
|
||||
// XXX to add modifiers...
|
||||
}
|
||||
|
||||
/* --- */
|
||||
|
||||
void rna_def_action_group(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -104,7 +202,7 @@ void rna_def_action_group(BlenderRNA *brna)
|
||||
|
||||
srna= RNA_def_struct(brna, "ActionGroup", NULL);
|
||||
RNA_def_struct_sdna(srna, "bActionGroup");
|
||||
RNA_def_struct_ui_text(srna, "Action Group", "Groups of Actions Channels.");
|
||||
RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves.");
|
||||
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Name", "");
|
||||
@@ -115,8 +213,8 @@ void rna_def_action_group(BlenderRNA *brna)
|
||||
probably shed some more light on why this is */
|
||||
/*prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
|
||||
RNA_def_property_struct_type(prop, "ActionChannel");
|
||||
RNA_def_property_ui_text(prop, "Channels", "Action channels in this action.");*/
|
||||
RNA_def_property_struct_type(prop, "FCurve");
|
||||
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");*/
|
||||
|
||||
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
|
||||
@@ -135,27 +233,24 @@ void rna_def_action_group(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set.");
|
||||
}
|
||||
|
||||
void RNA_def_action(BlenderRNA *brna)
|
||||
void rna_def_action(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
rna_def_action_channel(brna);
|
||||
rna_def_action_group(brna);
|
||||
|
||||
|
||||
srna= RNA_def_struct(brna, "Action", "ID");
|
||||
RNA_def_struct_sdna(srna, "bAction");
|
||||
RNA_def_struct_ui_text(srna, "Action", "A collection of Ipos for animation.");
|
||||
RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation.");
|
||||
|
||||
prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
|
||||
RNA_def_property_struct_type(prop, "ActionChannel");
|
||||
RNA_def_property_ui_text(prop, "Channels", "The individual animation channels that make up the Action.");
|
||||
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "curves", NULL);
|
||||
RNA_def_property_struct_type(prop, "FCurve");
|
||||
RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action.");
|
||||
|
||||
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
|
||||
RNA_def_property_struct_type(prop, "ActionGroup");
|
||||
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of Action Channels.");
|
||||
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves.");
|
||||
|
||||
prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
|
||||
@@ -163,4 +258,59 @@ void RNA_def_action(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses.");
|
||||
}
|
||||
|
||||
/* --- */
|
||||
|
||||
void rna_def_animdata_common(StructRNA *srna)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
prop= RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "adt");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this datablock.");
|
||||
}
|
||||
|
||||
void rna_def_animdata(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
srna= RNA_def_struct(brna, "AnimData", NULL);
|
||||
//RNA_def_struct_sdna(srna, "AnimData");
|
||||
RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for datablock.");
|
||||
|
||||
/* NLA */
|
||||
prop= RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL);
|
||||
RNA_def_property_struct_type(prop, "UnknownType"); // XXX!
|
||||
RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers).");
|
||||
|
||||
/* Action */
|
||||
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
|
||||
|
||||
/* Drivers */
|
||||
prop= RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
|
||||
RNA_def_property_struct_type(prop, "FCurve");
|
||||
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock.");
|
||||
|
||||
/* Settings */
|
||||
}
|
||||
|
||||
/* --- */
|
||||
|
||||
void RNA_def_animation(BlenderRNA *brna)
|
||||
{
|
||||
// XXX move this into its own file?
|
||||
rna_def_animdata(brna);
|
||||
|
||||
rna_def_action(brna);
|
||||
rna_def_action_group(brna);
|
||||
|
||||
// XXX move these to their own file?
|
||||
rna_def_fcurve(brna);
|
||||
rna_def_channeldriver(brna);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -152,7 +152,7 @@ void RNA_def_camera(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface.");
|
||||
|
||||
/* pointers */
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Object");
|
||||
|
||||
@@ -33,6 +33,43 @@
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
|
||||
static float rna_BezTriple_handle1_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[0][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_handle1_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[0][index]= value;
|
||||
}
|
||||
|
||||
static float rna_BezTriple_handle2_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[2][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_handle2_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[2][index]= value;
|
||||
}
|
||||
|
||||
static float rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[1][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[1][index]= value;
|
||||
}
|
||||
|
||||
static int rna_Curve_texspace_editable(PointerRNA *ptr)
|
||||
{
|
||||
Curve *cu= (Curve*)ptr->data;
|
||||
@@ -41,6 +78,136 @@ static int rna_Curve_texspace_editable(PointerRNA *ptr)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
void rna_def_bpoint(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
srna= RNA_def_struct(brna, "CurvePoint", NULL);
|
||||
RNA_def_struct_sdna(srna, "BPoint");
|
||||
RNA_def_struct_ui_text(srna, "CurvePoint", "Curve point without handles.");
|
||||
|
||||
/* Boolean values */
|
||||
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
|
||||
RNA_def_property_ui_text(prop, "Selected", "Selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
|
||||
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
|
||||
|
||||
/* Vector value */
|
||||
prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_float_sdna(prop, NULL, "vec");
|
||||
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
|
||||
|
||||
/* Number values */
|
||||
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "alfa");
|
||||
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
|
||||
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
|
||||
|
||||
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.01f, 100.0f);
|
||||
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
|
||||
|
||||
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "radius");
|
||||
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
|
||||
}
|
||||
|
||||
void rna_def_beztriple(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
static EnumPropertyItem prop_handle_type_items[] = {
|
||||
{HD_FREE, "FREE", "Free", ""},
|
||||
{HD_AUTO, "AUTO", "Auto", ""},
|
||||
{HD_VECT, "VECTOR", "Vector", ""},
|
||||
{HD_ALIGN, "ALIGNED", "Aligned", ""},
|
||||
{HD_AUTO_ANIM, "AUTO_CLAMPED", "Auto Clamped", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
static EnumPropertyItem prop_mode_interpolation_items[] = {
|
||||
{BEZT_IPO_CONST, "CONSTANT", "Constant", ""},
|
||||
{BEZT_IPO_LIN, "LINEAR", "Linear", ""},
|
||||
{BEZT_IPO_BEZ, "BEZIER", "Bezier", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "BezierCurvePoint", NULL);
|
||||
RNA_def_struct_sdna(srna, "BezTriple");
|
||||
RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles.");
|
||||
|
||||
/* Boolean values */
|
||||
prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
|
||||
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
|
||||
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "selected_control_point", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
|
||||
RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
|
||||
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
|
||||
|
||||
/* Enums */
|
||||
prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "h1");
|
||||
RNA_def_property_enum_items(prop, prop_handle_type_items);
|
||||
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
|
||||
|
||||
prop= RNA_def_property(srna, "handle2_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "h2");
|
||||
RNA_def_property_enum_items(prop, prop_handle_type_items);
|
||||
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
|
||||
|
||||
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "ipo");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_mode_interpolation_items);
|
||||
RNA_def_property_ui_text(prop, "Interpolation", "(For F-Curves Only) Interpolation to use for segment of curve starting from current BezTriple.");
|
||||
|
||||
/* Vector values */
|
||||
prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
|
||||
|
||||
prop= RNA_def_property(srna, "control_point", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
|
||||
|
||||
prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
|
||||
|
||||
/* Number values */
|
||||
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "alfa");
|
||||
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
|
||||
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
|
||||
|
||||
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.01f, 100.0f);
|
||||
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
|
||||
|
||||
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "radius");
|
||||
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
|
||||
}
|
||||
|
||||
static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -262,7 +429,7 @@ void rna_def_curve(BlenderRNA *brna)
|
||||
srna= RNA_def_struct(brna, "Curve", "ID");
|
||||
RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
rna_def_texmat_common(srna, "rna_Curve_texspace_editable");
|
||||
|
||||
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
|
||||
@@ -346,6 +513,8 @@ void RNA_def_curve(BlenderRNA *brna)
|
||||
rna_def_curve(brna);
|
||||
rna_def_textbox(brna);
|
||||
rna_def_charinfo(brna);
|
||||
rna_def_bpoint(brna);
|
||||
rna_def_beztriple(brna);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -422,8 +422,8 @@ void RNA_def_fluidsim(BlenderRNA *brna)
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // needs to update variables
|
||||
RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation.");
|
||||
|
||||
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by fluid simulation settings.");
|
||||
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
//RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by fluid simulation settings.");
|
||||
|
||||
/* types */
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ extern BlenderDefRNA DefRNA;
|
||||
extern BlenderRNA BLENDER_RNA;
|
||||
|
||||
void RNA_def_ID(struct BlenderRNA *brna);
|
||||
void RNA_def_action(struct BlenderRNA *brna);
|
||||
void RNA_def_animation(struct BlenderRNA *brna);
|
||||
void RNA_def_armature(struct BlenderRNA *brna);
|
||||
void RNA_def_actuator(struct BlenderRNA *brna);
|
||||
void RNA_def_brush(struct BlenderRNA *brna);
|
||||
@@ -110,7 +110,6 @@ void RNA_def_fluidsim(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_key(struct BlenderRNA *brna);
|
||||
void RNA_def_lamp(struct BlenderRNA *brna);
|
||||
void RNA_def_lattice(struct BlenderRNA *brna);
|
||||
@@ -142,7 +141,8 @@ void RNA_def_vpaint(struct BlenderRNA *brna);
|
||||
void RNA_def_wm(struct BlenderRNA *brna);
|
||||
void RNA_def_world(struct BlenderRNA *brna);
|
||||
|
||||
void rna_def_ipo_common(struct StructRNA *srna);
|
||||
void rna_def_animdata_common(struct StructRNA *srna);
|
||||
|
||||
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
|
||||
void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *structname);
|
||||
|
||||
|
||||
@@ -1,336 +0,0 @@
|
||||
/**
|
||||
* $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
|
||||
|
||||
static float rna_BezTriple_handle1_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[0][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_handle1_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[0][index]= value;
|
||||
}
|
||||
|
||||
static float rna_BezTriple_handle2_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[2][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_handle2_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[2][index]= value;
|
||||
}
|
||||
|
||||
static float rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, int index)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
return bt->vec[1][index];
|
||||
}
|
||||
|
||||
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, int index, float value)
|
||||
{
|
||||
BezTriple *bt= (BezTriple*)ptr->data;
|
||||
bt->vec[1][index]= value;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void rna_def_bpoint(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
srna= RNA_def_struct(brna, "CurvePoint", NULL);
|
||||
RNA_def_struct_sdna(srna, "BPoint");
|
||||
RNA_def_struct_ui_text(srna, "CurvePoint", "Curve point without handles.");
|
||||
|
||||
/* Boolean values */
|
||||
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
|
||||
RNA_def_property_ui_text(prop, "Selected", "Selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
|
||||
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
|
||||
|
||||
/* Vector value */
|
||||
prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_float_sdna(prop, NULL, "vec");
|
||||
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
|
||||
|
||||
/* Number values */
|
||||
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "alfa");
|
||||
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
|
||||
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
|
||||
|
||||
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.01f, 100.0f);
|
||||
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
|
||||
|
||||
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "radius");
|
||||
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
|
||||
}
|
||||
|
||||
void rna_def_beztriple(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
static EnumPropertyItem prop_handle_type_items[] = {
|
||||
{HD_FREE, "FREE", "Free", ""},
|
||||
{HD_AUTO, "AUTO", "Auto", ""},
|
||||
{HD_VECT, "VECTOR", "Vector", ""},
|
||||
{HD_ALIGN, "ALIGNED", "Aligned", ""},
|
||||
{HD_AUTO_ANIM, "AUTO_CLAMPED", "Auto Clamped", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
static EnumPropertyItem prop_mode_interpolation_items[] = {
|
||||
{IPO_CONST, "CONSTANT", "Constant", ""},
|
||||
{IPO_LIN, "LINEAR", "Linear", ""},
|
||||
{IPO_BEZ, "BEZIER", "Bezier", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "BezierCurvePoint", NULL);
|
||||
RNA_def_struct_sdna(srna, "BezTriple");
|
||||
RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles.");
|
||||
|
||||
/* Boolean values */
|
||||
prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
|
||||
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
|
||||
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "selected_control_point", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
|
||||
RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
|
||||
|
||||
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
|
||||
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
|
||||
|
||||
/* Enums */
|
||||
prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "h1");
|
||||
RNA_def_property_enum_items(prop, prop_handle_type_items);
|
||||
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
|
||||
|
||||
prop= RNA_def_property(srna, "handle2_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "h2");
|
||||
RNA_def_property_enum_items(prop, prop_handle_type_items);
|
||||
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
|
||||
|
||||
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "ipo");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_mode_interpolation_items);
|
||||
RNA_def_property_ui_text(prop, "Interpolation", "");
|
||||
|
||||
/* Vector values */
|
||||
prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
|
||||
|
||||
prop= RNA_def_property(srna, "control_point", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
|
||||
|
||||
prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_VECTOR);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
|
||||
|
||||
/* Number values */
|
||||
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "alfa");
|
||||
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
|
||||
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
|
||||
|
||||
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_range(prop, 0.01f, 100.0f);
|
||||
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
|
||||
|
||||
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "radius");
|
||||
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
|
||||
}
|
||||
|
||||
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);
|
||||
RNA_def_struct_ui_text(srna, "Ipo Driver", "Driver for the ipo curve value based on an external value.");
|
||||
|
||||
/* 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", "Ipo Driver types.");
|
||||
|
||||
/* String values */
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
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_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;
|
||||
static EnumPropertyItem prop_mode_interpolation_items[] = {
|
||||
{IPO_CONST, "CONSTANT", "Constant", ""},
|
||||
{IPO_LIN, "LINEAR", "Linear", ""},
|
||||
{IPO_BEZ, "BEZIER", "Bezier", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
static EnumPropertyItem prop_mode_extend_items[] = {
|
||||
{IPO_HORIZ, "CONSTANT", "Constant", ""},
|
||||
{IPO_DIR, "EXTRAP", "Extrapolation", ""},
|
||||
{IPO_CYCL, "CYCLIC", "Cyclic", ""},
|
||||
{IPO_CYCLX, "CYCLICX", "Cyclic Extrapolation", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "IpoCurve", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Ipo Curve", "Ipo curve defining values of a period of time.");
|
||||
|
||||
/* Enums */
|
||||
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "ipo");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_mode_interpolation_items);
|
||||
RNA_def_property_ui_text(prop, "Interpolation", "");
|
||||
|
||||
prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "extrap");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_mode_extend_items);
|
||||
RNA_def_property_ui_text(prop, "Extrapolation", "");
|
||||
|
||||
/* Pointers */
|
||||
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "driver");
|
||||
RNA_def_property_ui_text(prop, "Ipo Driver", "");
|
||||
|
||||
/* Collections XXX */
|
||||
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "bp", "totvert");
|
||||
RNA_def_property_struct_type(prop, "CurvePoint");
|
||||
RNA_def_property_ui_text(prop, "Points", "");
|
||||
|
||||
prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "bezt", "totvert");
|
||||
RNA_def_property_struct_type(prop, "BezierCurvePoint");
|
||||
RNA_def_property_ui_text(prop, "Bezier Points", "");
|
||||
}
|
||||
|
||||
void rna_def_ipo(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
static EnumPropertyItem prop_blocktype_items[] = {
|
||||
{ID_OB, "OBJECT", "Object", ""},
|
||||
{ID_MA, "MATERIAL", "Material", ""},
|
||||
{ID_TE, "TEXTURE", "Texture", ""},
|
||||
{ID_SEQ, "SEQUENCE", "Sequence", ""},
|
||||
{ID_CU, "CURVE", "Curve", ""},
|
||||
{ID_KE, "KEY", "Key", ""},
|
||||
{ID_WO, "WORLD", "World", ""},
|
||||
{ID_LA, "LAMP", "Lamp", ""},
|
||||
{ID_CA, "CAMERA", "Camera", ""},
|
||||
{ID_SO, "SOUND", "Sound", ""},
|
||||
{ID_PO, "POSECHANNEL", "PoseChannel", ""},
|
||||
{ID_CO, "CONSTRAINT", "Constraint", ""},
|
||||
{ID_FLUIDSIM, "FLUIDSIM", "FluidSim", ""},
|
||||
{ID_PA, "PARTICLES", "Particles", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "Ipo", "ID");
|
||||
RNA_def_struct_ui_text(srna, "Ipo", "Ipo datablock containing Ipo curves for animation of a datablock.");
|
||||
|
||||
/* Enums */
|
||||
prop= RNA_def_property(srna, "block_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "blocktype");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_blocktype_items);
|
||||
RNA_def_property_ui_text(prop, "Block Type", "");
|
||||
|
||||
/* Boolean values */
|
||||
prop= RNA_def_property(srna, "show_keys", 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", "");
|
||||
}
|
||||
|
||||
void RNA_def_ipo(BlenderRNA *brna)
|
||||
{
|
||||
rna_def_ipo(brna);
|
||||
rna_def_ipocurve(brna);
|
||||
rna_def_bpoint(brna);
|
||||
rna_def_beztriple(brna);
|
||||
rna_def_ipodriver(brna);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -327,7 +327,7 @@ static void rna_def_key(BlenderRNA *brna)
|
||||
RNA_def_property_struct_type(prop, "ShapeKey");
|
||||
RNA_def_property_ui_text(prop, "Keys", "Shape keys.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "from");
|
||||
|
||||
@@ -158,8 +158,6 @@ static void rna_def_lattice(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
|
||||
RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "key");
|
||||
RNA_def_property_ui_text(prop, "Shape Keys", "");
|
||||
|
||||
@@ -124,12 +124,6 @@ static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *
|
||||
rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
|
||||
}
|
||||
|
||||
static void rna_Main_ipo_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= (Main*)ptr->data;
|
||||
rna_iterator_listbase_begin(iter, &bmain->ipo, NULL);
|
||||
}
|
||||
|
||||
static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
||||
{
|
||||
Main *bmain= (Main*)ptr->data;
|
||||
@@ -237,7 +231,6 @@ void RNA_def_main(BlenderRNA *brna)
|
||||
{"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."},
|
||||
{"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks."},
|
||||
{"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks."},
|
||||
{"ipos", "Ipo", "rna_Main_ipo_begin", "Ipos", "Ipo datablocks."},
|
||||
{"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."},
|
||||
{"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks."},
|
||||
{"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."},
|
||||
|
||||
@@ -791,7 +791,7 @@ void RNA_def_material(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials.");
|
||||
|
||||
/* common */
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", "MaterialTextureSlot");
|
||||
|
||||
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
|
||||
|
||||
@@ -893,13 +893,6 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
|
||||
RNA_def_property_ui_text(prop, "Materials", "");
|
||||
}
|
||||
|
||||
void rna_def_ipo_common(StructRNA *srna)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this datablock.");
|
||||
}
|
||||
|
||||
static void rna_def_mesh(BlenderRNA *brna)
|
||||
{
|
||||
@@ -989,7 +982,6 @@ static void rna_def_mesh(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Shape Keys", "");
|
||||
|
||||
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
|
||||
rna_def_ipo_common(srna);
|
||||
}
|
||||
|
||||
void RNA_def_mesh(BlenderRNA *brna)
|
||||
|
||||
@@ -141,7 +141,6 @@ void rna_def_metaball(BlenderRNA *brna)
|
||||
|
||||
/* materials, textures */
|
||||
rna_def_texmat_common(srna, "rna_Meta_texspace_editable");
|
||||
rna_def_ipo_common(srna);
|
||||
}
|
||||
|
||||
void RNA_def_meta(BlenderRNA *brna)
|
||||
|
||||
@@ -600,20 +600,10 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
|
||||
|
||||
/* collections */
|
||||
|
||||
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Ipo");
|
||||
RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by the object.");
|
||||
|
||||
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Constraint");
|
||||
RNA_def_property_ui_text(prop, "Constraints", "Constraints of the object.");
|
||||
|
||||
prop= RNA_def_property(srna, "constraint_channels", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_collection_sdna(prop, NULL, "constraintChannels", NULL);
|
||||
RNA_def_property_struct_type(prop, "Constraint");
|
||||
RNA_def_property_ui_text(prop, "Constraint Channels", "Ipo curves for the object constraints.");
|
||||
|
||||
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Modifier");
|
||||
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
|
||||
@@ -697,6 +687,8 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
|
||||
/* anim */
|
||||
|
||||
rna_def_animdata_common(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "draw_keys", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEY);
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // update ipo flag indirect
|
||||
@@ -750,7 +742,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
|
||||
RNA_def_property_range(prop, 0.001, 10000.0);
|
||||
RNA_def_property_range(prop, 0.001f, 10000.0f);
|
||||
RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects.");
|
||||
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
||||
|
||||
@@ -861,12 +853,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others.");
|
||||
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
||||
|
||||
/* action / pose / nla */
|
||||
|
||||
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Action");
|
||||
RNA_def_property_ui_text(prop, "Action", "Action used by object to define Ipo curves.");
|
||||
|
||||
/* pose */
|
||||
prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "poselib");
|
||||
RNA_def_property_struct_type(prop, "Action");
|
||||
@@ -882,6 +869,8 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode.");
|
||||
|
||||
// XXX this stuff should be moved to AnimData...
|
||||
/*
|
||||
prop= RNA_def_property(srna, "nla_disable_path", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_DISABLE_PATH);
|
||||
RNA_def_property_ui_text(prop, "NLA Disable Path", "Disable path temporally, for editing cycles.");
|
||||
@@ -901,7 +890,8 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
|
||||
RNA_def_property_struct_type(prop, "UnknownType");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "NLA Strips", "NLA strips of the object.");
|
||||
|
||||
*/
|
||||
|
||||
/* shape keys */
|
||||
|
||||
prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
|
||||
static void rna_def_pose_channel(BlenderRNA *brna)
|
||||
{
|
||||
static EnumPropertyItem prop_rotmode_items[] = {
|
||||
{PCHAN_ROT_QUAT, "QUATERNION", "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
|
||||
{PCHAN_ROT_EUL, "EULER", "Euler (XYZ)", "Prone to Gimbal Lock"},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
@@ -90,10 +95,10 @@ static void rna_def_pose_channel(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
|
||||
RNA_def_property_ui_text(prop, "Selected", "");
|
||||
|
||||
// XXX note: bone groups are stored internally as bActionGroups :) - Aligorith
|
||||
//prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
|
||||
//RNA_def_property_int_sdna(prop, NULL, "agrp_index");
|
||||
//RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
|
||||
/* XXX note: bone groups are stored internally as bActionGroups :) - Aligorith */
|
||||
prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
|
||||
RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
|
||||
|
||||
prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "pathsf");
|
||||
@@ -131,6 +136,16 @@ static void rna_def_pose_channel(BlenderRNA *brna)
|
||||
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
|
||||
RNA_def_property_float_sdna(prop, NULL, "quat");
|
||||
RNA_def_property_ui_text(prop, "Rotation", "Rotation in Quaternions.");
|
||||
|
||||
prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_ROTATION);
|
||||
RNA_def_property_float_sdna(prop, NULL, "eul");
|
||||
RNA_def_property_ui_text(prop, "Rotation", "Rotation in Eulers.");
|
||||
|
||||
prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
|
||||
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
|
||||
RNA_def_property_enum_items(prop, prop_rotmode_items);
|
||||
RNA_def_property_ui_text(prop, "Rotation Mode", "");
|
||||
|
||||
/* These three matrix properties await an implementation of the PROP_MATRIX subtype, which currently doesn't exist. */
|
||||
/* prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
|
||||
|
||||
@@ -287,8 +287,8 @@ static void rna_def_sequence(BlenderRNA *brna)
|
||||
RNA_def_property_enum_items(prop, seq_type_items);
|
||||
RNA_def_property_ui_text(prop, "Type", "");
|
||||
|
||||
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
|
||||
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
|
||||
//RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
|
||||
|
||||
/* flags */
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ static void rna_def_sound(BlenderRNA *brna)
|
||||
RNA_def_struct_sdna(srna, "bSound");
|
||||
RNA_def_struct_ui_text(srna, "Sound", "Sound datablock referencing an external or packed sound file.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
//rna_def_ipo_common(srna);
|
||||
|
||||
/*prop= RNA_def_property(srna, "sample", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "SoundSample");
|
||||
|
||||
@@ -41,7 +41,7 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
|
||||
/*case SPACE_VIEW3D:
|
||||
return &RNA_SpaceView3D;
|
||||
case SPACE_IPO:
|
||||
return &RNA_SpaceIpoEditor;
|
||||
return &RNA_SpaceGraphEditor;
|
||||
case SPACE_OOPS:
|
||||
return &RNA_SpaceOutliner;
|
||||
case SPACE_BUTS:
|
||||
@@ -61,7 +61,7 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
|
||||
case SPACE_SOUND:
|
||||
return &RNA_SpaceAudioWindow;
|
||||
case SPACE_ACTION:
|
||||
return &RNA_SpaceActionEditor;
|
||||
return &RNA_SpaceDopeSheetEditor;
|
||||
case SPACE_NLA:
|
||||
return &RNA_SpaceNLAEditor;
|
||||
case SPACE_SCRIPT:
|
||||
@@ -90,7 +90,7 @@ static void rna_def_space(BlenderRNA *brna)
|
||||
static EnumPropertyItem type_items[] = {
|
||||
{SPACE_EMPTY, "EMPTY", "Empty", ""},
|
||||
{SPACE_VIEW3D, "VIEW_3D", "3D View", ""},
|
||||
{SPACE_IPO, "IPO_EDITOR", "Ipo Editor", ""},
|
||||
{SPACE_IPO, "GRAPH_EDITOR", "Graph Editor", ""},
|
||||
{SPACE_OOPS, "OUTLINER", "Outliner", ""},
|
||||
{SPACE_BUTS, "BUTTONS_WINDOW", "Buttons Window", ""},
|
||||
{SPACE_FILE, "FILE_BROWSER", "File Browser", ""},
|
||||
@@ -100,7 +100,7 @@ static void rna_def_space(BlenderRNA *brna)
|
||||
{SPACE_TEXT, "TEXT_EDITOR", "Text Editor", ""},
|
||||
//{SPACE_IMASEL, "IMAGE_BROWSER", "Image Browser", ""},
|
||||
{SPACE_SOUND, "AUDIO_WINDOW", "Audio Window", ""},
|
||||
{SPACE_ACTION, "ACTION_EDITOR", "Action Editor", ""},
|
||||
{SPACE_ACTION, "DOPESHEET_EDITOR", "DopeSheet Editor", ""},
|
||||
{SPACE_NLA, "NLA_EDITOR", "NLA Editor", ""},
|
||||
{SPACE_SCRIPT, "SCRIPTS_WINDOW", "Scripts Window", ""},
|
||||
{SPACE_TIME, "TIMELINE", "Timeline", ""},
|
||||
|
||||
@@ -423,7 +423,7 @@ void RNA_def_texture(BlenderRNA *brna)
|
||||
RNA_def_property_range(prop, 0, 25);
|
||||
RNA_def_property_ui_text(prop, "Normal Factor", "Amount the texture affects normal values.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
|
||||
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "ima");
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
#include "rna_internal.h"
|
||||
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
#include "DNA_ipo_types.h"
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
@@ -365,9 +365,9 @@ static void rna_def_userdef_theme_space_ipo(BlenderRNA *brna)
|
||||
|
||||
/* space_ipo */
|
||||
|
||||
srna= RNA_def_struct(brna, "ThemeIpoEditor", NULL);
|
||||
srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
|
||||
RNA_def_struct_sdna(srna, "ThemeSpace");
|
||||
RNA_def_struct_ui_text(srna, "Theme Ipo Editor", "Theme settings for the Ipo Editor.");
|
||||
RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the Ipo Editor.");
|
||||
|
||||
rna_def_userdef_theme_spaces_main(srna);
|
||||
|
||||
@@ -384,10 +384,10 @@ static void rna_def_userdef_theme_space_ipo(BlenderRNA *brna)
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Window Sliders", "");
|
||||
|
||||
prop= RNA_def_property(srna, "ipo_channels", PROP_FLOAT, PROP_COLOR);
|
||||
prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "shade2");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Ipo Channels", "");
|
||||
RNA_def_property_ui_text(prop, "Channels Region", "");
|
||||
|
||||
rna_def_userdef_theme_spaces_vertex(srna);
|
||||
|
||||
@@ -764,9 +764,9 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
|
||||
|
||||
/* space_action */
|
||||
|
||||
srna= RNA_def_struct(brna, "ThemeActionEditor", NULL);
|
||||
srna= RNA_def_struct(brna, "ThemeDopeSheetEditor", NULL);
|
||||
RNA_def_struct_sdna(srna, "ThemeSpace");
|
||||
RNA_def_struct_ui_text(srna, "Theme Action Editor", "Theme settings for the Action Editor.");
|
||||
RNA_def_struct_ui_text(srna, "Theme DopeSheet Editor", "Theme settings for the DopeSheet Editor.");
|
||||
|
||||
rna_def_userdef_theme_spaces_main(srna);
|
||||
|
||||
@@ -774,10 +774,10 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Grid", "");
|
||||
|
||||
prop= RNA_def_property(srna, "rvk_sliders", PROP_FLOAT, PROP_COLOR);
|
||||
prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "face");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "RVK Sliders", "");
|
||||
RNA_def_property_ui_text(prop, "Value Sliders", "");
|
||||
|
||||
prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "shade1");
|
||||
@@ -818,6 +818,16 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
|
||||
RNA_def_property_float_sdna(prop, NULL, "cframe");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Current Frame", "");
|
||||
|
||||
prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ds_channel");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
|
||||
|
||||
prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
|
||||
@@ -919,10 +929,10 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
|
||||
RNA_def_property_struct_type(prop, "ThemeView3D");
|
||||
RNA_def_property_ui_text(prop, "3D View", "");
|
||||
|
||||
prop= RNA_def_property(srna, "ipo_curve_editor", PROP_POINTER, PROP_NEVER_NULL);
|
||||
prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tipo");
|
||||
RNA_def_property_struct_type(prop, "ThemeIpoEditor");
|
||||
RNA_def_property_ui_text(prop, "Ipo Curve Editor", "");
|
||||
RNA_def_property_struct_type(prop, "ThemeGraphEditor");
|
||||
RNA_def_property_ui_text(prop, "Graph Editor", "");
|
||||
|
||||
prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tfile");
|
||||
@@ -934,10 +944,10 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
|
||||
RNA_def_property_struct_type(prop, "ThemeNLAEditor");
|
||||
RNA_def_property_ui_text(prop, "NLA Editor", "");
|
||||
|
||||
prop= RNA_def_property(srna, "action_editor", PROP_POINTER, PROP_NEVER_NULL);
|
||||
prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tact");
|
||||
RNA_def_property_struct_type(prop, "ThemeActionEditor");
|
||||
RNA_def_property_ui_text(prop, "Action Editor", "");
|
||||
RNA_def_property_struct_type(prop, "ThemeDopeSheetEditor");
|
||||
RNA_def_property_ui_text(prop, "DopeSheet Editor", "");
|
||||
|
||||
prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tima");
|
||||
@@ -1271,10 +1281,10 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
||||
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", "Replace Keys", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
static EnumPropertyItem new_ipo_curve_types[] = {
|
||||
{IPO_CONST, "CONSTANT", "Constant", ""},
|
||||
{IPO_LIN, "LINEAR", "Linear", ""},
|
||||
{IPO_BEZ, "BEZIER", "Bezier", ""},
|
||||
static EnumPropertyItem new_interpolation_types[] = {
|
||||
{BEZT_IPO_CONST, "CONSTANT", "Constant", ""},
|
||||
{BEZT_IPO_LIN, "LINEAR", "Linear", ""},
|
||||
{BEZT_IPO_BEZ, "BEZIER", "Bezier", ""},
|
||||
{0, NULL, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
|
||||
@@ -1339,7 +1349,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects.");
|
||||
|
||||
prop= RNA_def_property(srna, "new_interpolation_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, new_ipo_curve_types);
|
||||
RNA_def_property_enum_items(prop, new_interpolation_types);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
|
||||
RNA_def_property_ui_text(prop, "New Interpolation Type", "");
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ void RNA_def_world(BlenderRNA *brna)
|
||||
srna= RNA_def_struct(brna, "World", "ID");
|
||||
RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene.");
|
||||
|
||||
rna_def_ipo_common(srna);
|
||||
rna_def_animdata_common(srna);
|
||||
rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get", "WorldTextureSlot");
|
||||
|
||||
/* colors */
|
||||
|
||||
Reference in New Issue
Block a user