2008-11-01 00:50:02 +01:00
|
|
|
/**
|
|
|
|
* $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 *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RNA_TYPES
|
|
|
|
#define RNA_TYPES
|
|
|
|
|
2008-11-07 03:58:25 +01:00
|
|
|
/* Pointer
|
|
|
|
*
|
|
|
|
* RNA pointers are not a single C pointer but include the type,
|
|
|
|
* and a pointer to the ID struct that owns the struct, since
|
|
|
|
* in some cases this information is needed to correctly get/set
|
|
|
|
* the properties and validate them. */
|
|
|
|
|
|
|
|
typedef struct PointerRNA {
|
|
|
|
struct {
|
|
|
|
struct StructRNA *type;
|
|
|
|
void *data;
|
|
|
|
} id;
|
|
|
|
|
|
|
|
struct StructRNA *type;
|
|
|
|
void *data;
|
|
|
|
} PointerRNA;
|
|
|
|
|
|
|
|
/* Property */
|
2008-11-01 00:50:02 +01:00
|
|
|
|
|
|
|
typedef enum PropertyType {
|
|
|
|
PROP_BOOLEAN = 0,
|
|
|
|
PROP_INT = 1,
|
|
|
|
PROP_FLOAT = 2,
|
|
|
|
PROP_STRING = 3,
|
|
|
|
PROP_ENUM = 4,
|
|
|
|
PROP_POINTER = 5,
|
|
|
|
PROP_COLLECTION = 6
|
|
|
|
} PropertyType;
|
|
|
|
|
|
|
|
typedef enum PropertySubType {
|
|
|
|
PROP_NONE = 0,
|
|
|
|
PROP_UNSIGNED = 1,
|
|
|
|
PROP_FILEPATH = 2,
|
|
|
|
PROP_COLOR = 3,
|
|
|
|
PROP_VECTOR = 4,
|
|
|
|
PROP_MATRIX = 5,
|
|
|
|
PROP_ROTATION = 6
|
|
|
|
} PropertySubType;
|
|
|
|
|
|
|
|
typedef enum PropertyFlag {
|
2008-11-07 03:58:25 +01:00
|
|
|
/* editable means the property is editable in the user
|
|
|
|
* interface, evaluated means that the property is set
|
|
|
|
* as part of an evaluation. these can change at runtime
|
|
|
|
* the property flag contains the default. editable is
|
|
|
|
* enabled by default except for collections. */
|
2008-11-14 15:34:19 +01:00
|
|
|
PROP_NOT_EDITABLE = 1,
|
2008-11-07 03:58:25 +01:00
|
|
|
PROP_EVALUATED = 2,
|
|
|
|
|
|
|
|
/* driveable means the property can be driven by some
|
|
|
|
* other input, be it animation curves, expressions, ..
|
2008-11-14 15:34:19 +01:00
|
|
|
* in other words making the property evaluated.
|
2008-11-07 03:58:25 +01:00
|
|
|
* enable by default except for pointers and collections. */
|
2008-11-14 15:34:19 +01:00
|
|
|
PROP_NOT_DRIVEABLE = 4,
|
2008-11-07 03:58:25 +01:00
|
|
|
|
2008-11-14 15:34:19 +01:00
|
|
|
#if 0
|
2008-11-07 03:58:25 +01:00
|
|
|
/* for pointers and collections, means that the struct
|
|
|
|
* depends on the data pointed to for evaluation, such
|
|
|
|
* that a change in the data pointed to will affect the
|
|
|
|
* evaluated result of this struct. */
|
|
|
|
PROP_EVALUATE_DEPENDENCY = 8,
|
|
|
|
PROP_INVERSE_EVALUATE_DEPENDENCY = 16,
|
|
|
|
|
|
|
|
/* for pointers and collections, means that the struct
|
|
|
|
* requires the data pointed to for rendering in the,
|
|
|
|
* be it the render engine or viewport */
|
|
|
|
PROP_RENDER_DEPENDENCY = 32,
|
|
|
|
PROP_INVERSE_RENDER_DEPENDENCY = 64,
|
2008-11-14 15:34:19 +01:00
|
|
|
#endif
|
|
|
|
|
2008-11-17 19:44:06 +01:00
|
|
|
/* internal flags */
|
|
|
|
PROP_BUILTIN = 128,
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 03:23:46 +01:00
|
|
|
PROP_EXPORT = 256,
|
|
|
|
PROP_RUNTIME = 512,
|
|
|
|
PROP_IDPROPERTY = 1024
|
2008-11-01 00:50:02 +01:00
|
|
|
} PropertyFlag;
|
|
|
|
|
|
|
|
typedef struct CollectionPropertyIterator {
|
2008-11-14 18:05:25 +01:00
|
|
|
PointerRNA parent;
|
2008-11-01 00:50:02 +01:00
|
|
|
void *internal;
|
2008-11-14 18:05:25 +01:00
|
|
|
|
2008-11-01 00:50:02 +01:00
|
|
|
int valid;
|
2008-11-14 18:05:25 +01:00
|
|
|
PointerRNA ptr;
|
2008-11-01 00:50:02 +01:00
|
|
|
} CollectionPropertyIterator;
|
|
|
|
|
2008-11-14 19:46:57 +01:00
|
|
|
typedef struct EnumPropertyItem {
|
2008-11-01 00:50:02 +01:00
|
|
|
int value;
|
2008-11-14 19:46:57 +01:00
|
|
|
const char *identifier;
|
2008-11-01 00:50:02 +01:00
|
|
|
const char *name;
|
2008-11-24 13:12:24 +01:00
|
|
|
const char *description;
|
2008-11-14 19:46:57 +01:00
|
|
|
} EnumPropertyItem;
|
2008-11-01 00:50:02 +01:00
|
|
|
|
2008-11-17 19:44:06 +01:00
|
|
|
struct PropertyRNA;
|
|
|
|
typedef struct PropertyRNA PropertyRNA;
|
2008-11-01 00:50:02 +01:00
|
|
|
|
2008-11-07 03:58:25 +01:00
|
|
|
/* Struct */
|
|
|
|
|
|
|
|
typedef enum StructFlag {
|
|
|
|
/* indicates that this struct is an ID struct */
|
RNA
* More ID property support. What was already possible was showing
ID properties as RNA properties. Now it is possible to define
RNA properties and have an ID property automatically created the
first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
This is useful for python and plugins, and could also be used
for operators, not sure yet what is best there, they could be done
in preprocess for speed, but not sure how to do that while keeping
operator registration a single function.
* Added quick functions to get/set properties based on names, to be
used for operators.
* Added some simple support for inheritance, was already doing this
but having it as a feature simplifies things. Two things were added
for this: when defining a struct you can give a 'from' struct whose
properties will be copied, and structs like ID, operator, modifier,
can define a refine callback that will return the more specific type
of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
list, used for testing RNA for operators.
2008-11-21 03:23:46 +01:00
|
|
|
STRUCT_ID = 1,
|
|
|
|
|
|
|
|
/* internal flags */
|
|
|
|
STRUCT_RUNTIME = 2
|
2008-11-07 03:58:25 +01:00
|
|
|
} StructFlag;
|
|
|
|
|
2008-11-17 19:44:06 +01:00
|
|
|
struct StructRNA;
|
|
|
|
typedef struct StructRNA StructRNA;
|
2008-11-01 00:50:02 +01:00
|
|
|
|
2008-11-07 03:58:25 +01:00
|
|
|
/* Blender RNA
|
|
|
|
*
|
|
|
|
* Root RNA data structure that lists all struct types. */
|
|
|
|
|
2008-11-17 19:44:06 +01:00
|
|
|
struct BlenderRNA;
|
|
|
|
typedef struct BlenderRNA BlenderRNA;
|
2008-11-01 00:50:02 +01:00
|
|
|
|
|
|
|
#endif /* RNA_TYPES */
|
|
|
|
|