2008-10-31 23:50:02 +00: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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-10-31 23:50:02 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef RNA_INTERNAL_H
|
|
|
|
|
#define RNA_INTERNAL_H
|
|
|
|
|
|
2009-06-03 23:16:51 +00:00
|
|
|
#include "UI_resources.h"
|
|
|
|
|
|
2008-11-17 18:44:06 +00:00
|
|
|
#include "rna_internal_types.h"
|
|
|
|
|
|
|
|
|
|
#define RNA_MAGIC ((int)~0)
|
|
|
|
|
|
2010-03-30 11:49:07 +00:00
|
|
|
struct ID;
|
2008-11-17 18:44:06 +00:00
|
|
|
struct IDProperty;
|
2008-10-31 23:50:02 +00:00
|
|
|
struct SDNA;
|
|
|
|
|
|
|
|
|
|
/* Data structures used during define */
|
|
|
|
|
|
2009-04-07 00:49:39 +00:00
|
|
|
typedef struct ContainerDefRNA {
|
|
|
|
|
void *next, *prev;
|
|
|
|
|
|
|
|
|
|
ContainerRNA *cont;
|
|
|
|
|
ListBase properties;
|
|
|
|
|
} ContainerDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct FunctionDefRNA {
|
|
|
|
|
ContainerDefRNA cont;
|
|
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
const char *srna;
|
|
|
|
|
const char *call;
|
2009-04-15 15:12:42 +00:00
|
|
|
const char *gencall;
|
2009-04-07 00:49:39 +00:00
|
|
|
} FunctionDefRNA;
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
typedef struct PropertyDefRNA {
|
|
|
|
|
struct PropertyDefRNA *next, *prev;
|
|
|
|
|
|
2009-04-07 00:49:39 +00:00
|
|
|
struct ContainerRNA *cont;
|
2008-10-31 23:50:02 +00:00
|
|
|
struct PropertyRNA *prop;
|
|
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
/* struct */
|
2008-10-31 23:50:02 +00:00
|
|
|
const char *dnastructname;
|
2008-12-02 23:45:11 +00:00
|
|
|
const char *dnastructfromname;
|
|
|
|
|
const char *dnastructfromprop;
|
|
|
|
|
|
|
|
|
|
/* property */
|
2008-10-31 23:50:02 +00:00
|
|
|
const char *dnaname;
|
|
|
|
|
const char *dnatype;
|
|
|
|
|
int dnaarraylength;
|
2008-11-26 22:24:26 +00:00
|
|
|
int dnapointerlevel;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
/* for finding length of array collections */
|
|
|
|
|
const char *dnalengthstructname;
|
|
|
|
|
const char *dnalengthname;
|
|
|
|
|
int dnalengthfixed;
|
|
|
|
|
|
2008-12-03 20:17:12 +00:00
|
|
|
int booleanbit, booleannegative;
|
2009-12-22 16:11:11 +00:00
|
|
|
|
|
|
|
|
/* not to be confused with PROP_ENUM_FLAG
|
|
|
|
|
* this only allows one of the flags to be set at a time, clearing all others */
|
2008-11-26 22:52:01 +00:00
|
|
|
int enumbitflags;
|
2008-10-31 23:50:02 +00:00
|
|
|
} PropertyDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct StructDefRNA {
|
2009-04-07 00:49:39 +00:00
|
|
|
ContainerDefRNA cont;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
struct StructRNA *srna;
|
2009-01-08 13:57:29 +00:00
|
|
|
const char *filename;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
const char *dnaname;
|
2008-12-02 23:45:11 +00:00
|
|
|
|
|
|
|
|
/* for derived structs to find data in some property */
|
|
|
|
|
const char *dnafromname;
|
|
|
|
|
const char *dnafromprop;
|
|
|
|
|
|
2009-04-07 00:49:39 +00:00
|
|
|
ListBase functions;
|
2008-10-31 23:50:02 +00:00
|
|
|
} StructDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct AllocDefRNA {
|
|
|
|
|
struct AllocDefRNA *next, *prev;
|
|
|
|
|
void *mem;
|
|
|
|
|
} AllocDefRNA;
|
|
|
|
|
|
|
|
|
|
typedef struct BlenderDefRNA {
|
|
|
|
|
struct SDNA *sdna;
|
|
|
|
|
ListBase structs;
|
|
|
|
|
ListBase allocs;
|
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 02:23:46 +00:00
|
|
|
struct StructRNA *laststruct;
|
2009-07-21 01:14:55 +00:00
|
|
|
int error, silent, preprocess, verify;
|
2008-10-31 23:50:02 +00:00
|
|
|
} BlenderDefRNA;
|
|
|
|
|
|
|
|
|
|
extern BlenderDefRNA DefRNA;
|
|
|
|
|
|
|
|
|
|
/* Define functions for all types */
|
|
|
|
|
|
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 02:23:46 +00:00
|
|
|
extern BlenderRNA BLENDER_RNA;
|
2008-11-17 18:44:06 +00:00
|
|
|
|
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 02:23:46 +00:00
|
|
|
void RNA_def_ID(struct BlenderRNA *brna);
|
2009-02-13 01:51:33 +00:00
|
|
|
void RNA_def_action(struct BlenderRNA *brna);
|
2009-02-02 11:51:10 +00:00
|
|
|
void RNA_def_animation(struct BlenderRNA *brna);
|
2010-01-07 22:54:05 +00:00
|
|
|
void RNA_def_animviz(struct BlenderRNA *brna);
|
2008-12-09 11:29:40 +00:00
|
|
|
void RNA_def_armature(struct BlenderRNA *brna);
|
2008-11-30 19:52:21 +00:00
|
|
|
void RNA_def_actuator(struct BlenderRNA *brna);
|
2009-07-20 23:52:53 +00:00
|
|
|
void RNA_def_boid(struct BlenderRNA *brna);
|
2008-12-01 06:52:18 +00:00
|
|
|
void RNA_def_brush(struct BlenderRNA *brna);
|
|
|
|
|
void RNA_def_brushclone(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_camera(struct BlenderRNA *brna);
|
2009-01-04 19:25:24 +00:00
|
|
|
void RNA_def_cloth(struct BlenderRNA *brna);
|
2008-11-29 14:35:50 +00:00
|
|
|
void RNA_def_color(struct BlenderRNA *brna);
|
2008-12-12 23:30:23 +00:00
|
|
|
void RNA_def_constraint(struct BlenderRNA *brna);
|
2009-03-19 19:03:38 +00:00
|
|
|
void RNA_def_context(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_controller(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_curve(struct BlenderRNA *brna);
|
2008-12-29 17:36:06 +00:00
|
|
|
void RNA_def_fluidsim(struct BlenderRNA *brna);
|
2009-04-19 10:44:07 +00:00
|
|
|
void RNA_def_fcurve(struct BlenderRNA *brna);
|
2008-11-30 19:52:21 +00:00
|
|
|
void RNA_def_gameproperty(struct BlenderRNA *brna);
|
2009-08-27 06:03:41 +00:00
|
|
|
void RNA_def_gpencil(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_group(struct BlenderRNA *brna);
|
2008-11-30 18:39:49 +00:00
|
|
|
void RNA_def_image(struct BlenderRNA *brna);
|
2008-12-03 21:18:10 +00:00
|
|
|
void RNA_def_key(struct BlenderRNA *brna);
|
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 02:23:46 +00:00
|
|
|
void RNA_def_lamp(struct BlenderRNA *brna);
|
2008-11-30 18:39:49 +00:00
|
|
|
void RNA_def_lattice(struct BlenderRNA *brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
void RNA_def_main(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_material(struct BlenderRNA *brna);
|
2008-11-07 02:58:25 +00:00
|
|
|
void RNA_def_mesh(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_meta(struct BlenderRNA *brna);
|
2008-12-01 13:01:48 +00:00
|
|
|
void RNA_def_modifier(struct BlenderRNA *brna);
|
2009-06-07 06:49:04 +00:00
|
|
|
void RNA_def_nla(struct BlenderRNA *brna);
|
2008-11-27 00:23:22 +00:00
|
|
|
void RNA_def_nodetree(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_object(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_object_force(struct BlenderRNA *brna);
|
2008-12-01 21:23:58 +00:00
|
|
|
void RNA_def_packedfile(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_particle(struct BlenderRNA *brna);
|
2009-01-07 04:06:52 +00:00
|
|
|
void RNA_def_pose(struct BlenderRNA *brna);
|
2009-07-21 14:11:51 +00:00
|
|
|
void RNA_def_render(struct BlenderRNA *brna);
|
2008-11-14 14:34:19 +00:00
|
|
|
void RNA_def_rna(struct BlenderRNA *brna);
|
2008-10-31 23:50:02 +00:00
|
|
|
void RNA_def_scene(struct BlenderRNA *brna);
|
2008-11-29 01:04:15 +00:00
|
|
|
void RNA_def_screen(struct BlenderRNA *brna);
|
2009-07-25 22:31:02 +00:00
|
|
|
void RNA_def_sculpt_paint(struct BlenderRNA *brna);
|
2008-11-29 02:01:39 +00:00
|
|
|
void RNA_def_sensor(struct BlenderRNA *brna);
|
2009-12-13 15:48:57 +00:00
|
|
|
void RNA_def_sequencer(struct BlenderRNA *brna);
|
2009-07-30 15:00:26 +00:00
|
|
|
void RNA_def_smoke(struct BlenderRNA *brna);
|
2009-01-15 04:22:23 +00:00
|
|
|
void RNA_def_space(struct BlenderRNA *brna);
|
2009-09-06 15:13:57 +00:00
|
|
|
void RNA_def_test(struct BlenderRNA *brna);
|
2008-12-31 15:02:40 +00:00
|
|
|
void RNA_def_text(struct BlenderRNA *brna);
|
2009-01-02 23:05:28 +00:00
|
|
|
void RNA_def_texture(struct BlenderRNA *brna);
|
2009-02-24 03:06:23 +00:00
|
|
|
void RNA_def_timeline_marker(struct BlenderRNA *brna);
|
2008-12-26 16:50:05 +00:00
|
|
|
void RNA_def_sound(struct BlenderRNA *brna);
|
2009-04-08 16:40:46 +00:00
|
|
|
void RNA_def_ui(struct BlenderRNA *brna);
|
2009-01-02 13:47:33 +00:00
|
|
|
void RNA_def_userdef(struct BlenderRNA *brna);
|
2008-12-01 19:02:27 +00:00
|
|
|
void RNA_def_vfont(struct BlenderRNA *brna);
|
2008-11-30 15:55:14 +00:00
|
|
|
void RNA_def_wm(struct BlenderRNA *brna);
|
2008-12-02 23:45:11 +00:00
|
|
|
void RNA_def_world(struct BlenderRNA *brna);
|
|
|
|
|
|
2009-04-08 16:40:46 +00:00
|
|
|
/* Common Define functions */
|
|
|
|
|
|
2009-02-02 11:51:10 +00:00
|
|
|
void rna_def_animdata_common(struct StructRNA *srna);
|
|
|
|
|
|
2010-01-07 22:54:05 +00:00
|
|
|
void rna_def_animviz_common(struct StructRNA *srna);
|
|
|
|
|
void rna_def_motionpath_common(struct StructRNA *srna);
|
|
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update);
|
2009-07-21 14:11:51 +00:00
|
|
|
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2009-01-08 13:57:29 +00:00
|
|
|
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
|
|
|
|
|
int rna_ID_name_length(struct PointerRNA *ptr);
|
|
|
|
|
void rna_ID_name_set(struct PointerRNA *ptr, const char *value);
|
|
|
|
|
struct StructRNA *rna_ID_refine(struct PointerRNA *ptr);
|
2009-05-20 09:52:02 +00:00
|
|
|
struct IDProperty *rna_ID_idproperties(struct PointerRNA *ptr, int create);
|
2009-01-08 13:57:29 +00:00
|
|
|
void rna_ID_fake_user_set(struct PointerRNA *ptr, int value);
|
2009-05-20 09:52:02 +00:00
|
|
|
struct IDProperty *rna_IDPropertyGroup_idproperties(struct PointerRNA *ptr, int create);
|
2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
2009-08-18 01:29:25 +00:00
|
|
|
void rna_IDPropertyGroup_unregister(const struct bContext *C, struct StructRNA *type);
|
|
|
|
|
struct StructRNA *rna_IDPropertyGroup_register(const struct bContext *C, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
|
|
|
|
|
struct StructRNA* rna_IDPropertyGroup_refine(struct PointerRNA *ptr);
|
2009-01-08 13:57:29 +00:00
|
|
|
|
2009-01-04 19:25:24 +00:00
|
|
|
void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index);
|
|
|
|
|
int rna_object_vgroup_name_index_length(struct PointerRNA *ptr, int index);
|
|
|
|
|
void rna_object_vgroup_name_index_set(struct PointerRNA *ptr, const char *value, short *index);
|
|
|
|
|
void rna_object_vgroup_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
|
|
|
|
void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
|
|
|
|
void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen);
|
2010-03-30 11:49:07 +00:00
|
|
|
PointerRNA rna_object_shapekey_index_get(struct ID *id, int value);
|
|
|
|
|
int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
|
2009-01-04 19:25:24 +00:00
|
|
|
|
2010-06-09 08:24:31 +00:00
|
|
|
/* named internal so as not to conflict with obj.update() rna func */
|
|
|
|
|
void rna_Object_internal_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
|
|
|
|
void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
2009-12-08 17:23:48 +00:00
|
|
|
void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
|
|
|
|
void rna_TextureSlot_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
2009-07-02 19:41:31 +00:00
|
|
|
|
2009-10-26 11:56:12 +00:00
|
|
|
char *rna_TextureSlot_path(struct PointerRNA *ptr);
|
|
|
|
|
|
2009-04-08 16:40:46 +00:00
|
|
|
/* API functions */
|
|
|
|
|
|
2009-08-19 09:52:13 +00:00
|
|
|
void RNA_api_action(StructRNA *srna);
|
2009-12-04 02:32:34 +00:00
|
|
|
void RNA_api_armature_edit_bone(StructRNA *srna);
|
2009-11-06 11:09:04 +00:00
|
|
|
void RNA_api_drivers(StructRNA *srna);
|
2009-08-19 09:52:13 +00:00
|
|
|
void RNA_api_image(struct StructRNA *srna);
|
2009-12-10 18:28:22 +00:00
|
|
|
void RNA_api_operator(struct StructRNA *srna);
|
2009-12-30 22:14:32 +00:00
|
|
|
void RNA_api_macro(struct StructRNA *srna);
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void RNA_api_keyconfig(struct StructRNA *srna);
|
2009-08-25 04:05:37 +00:00
|
|
|
void RNA_api_keyingset(struct StructRNA *srna);
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void RNA_api_keymap(struct StructRNA *srna);
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
void RNA_api_keymapitem(struct StructRNA *srna);
|
2009-06-18 19:48:55 +00:00
|
|
|
void RNA_api_main(struct StructRNA *srna);
|
2009-08-19 09:52:13 +00:00
|
|
|
void RNA_api_material(StructRNA *srna);
|
2009-06-18 19:48:55 +00:00
|
|
|
void RNA_api_mesh(struct StructRNA *srna);
|
|
|
|
|
void RNA_api_object(struct StructRNA *srna);
|
2010-05-23 12:14:07 +00:00
|
|
|
void RNA_api_object_base(struct StructRNA *srna);
|
2009-11-11 19:58:30 +00:00
|
|
|
void RNA_api_pose_channel(struct StructRNA *srna);
|
2010-01-08 13:52:38 +00:00
|
|
|
void RNA_api_scene(struct StructRNA *srna);
|
|
|
|
|
void RNA_api_scene_render(struct StructRNA *srna);
|
2009-09-16 06:02:56 +00:00
|
|
|
void RNA_api_text(struct StructRNA *srna);
|
2009-04-08 16:40:46 +00:00
|
|
|
void RNA_api_ui_layout(struct StructRNA *srna);
|
2009-06-18 19:48:55 +00:00
|
|
|
void RNA_api_wm(struct StructRNA *srna);
|
2009-04-08 16:40:46 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
/* main collection functions */
|
|
|
|
|
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop);
|
2010-05-08 07:25:26 +00:00
|
|
|
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop);
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop);
|
|
|
|
|
|
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 02:23:46 +00:00
|
|
|
/* ID Properties */
|
2008-11-17 18:44:06 +00:00
|
|
|
|
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 02:23:46 +00:00
|
|
|
extern StringPropertyRNA rna_IDProperty_string;
|
|
|
|
|
extern IntPropertyRNA rna_IDProperty_int;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern IntPropertyRNA rna_IDProperty_int_array;
|
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 02:23:46 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_float;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_float_array;
|
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 02:23:46 +00:00
|
|
|
extern PointerPropertyRNA rna_IDProperty_group;
|
RNA:
* Added support for using pointers + collections as operator properties,
but with the restriction that they must point to other type derived from
ID property groups. The "add" function for these properties will allocate
a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
2008-12-26 20:38:52 +00:00
|
|
|
extern CollectionPropertyRNA rna_IDProperty_collection;
|
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 02:23:46 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_double;
|
2009-01-10 22:57:33 +00:00
|
|
|
extern FloatPropertyRNA rna_IDProperty_double_array;
|
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 02:23:46 +00:00
|
|
|
|
|
|
|
|
extern StructRNA RNA_IDProperty;
|
|
|
|
|
extern StructRNA RNA_IDPropertyGroup;
|
2008-11-14 14:34:19 +00:00
|
|
|
|
2008-11-17 18:44:06 +00:00
|
|
|
struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, struct PointerRNA *ptr);
|
|
|
|
|
|
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 02:23:46 +00:00
|
|
|
/* Builtin Property Callbacks */
|
|
|
|
|
|
|
|
|
|
void rna_builtin_properties_begin(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
|
|
|
|
|
void rna_builtin_properties_next(struct CollectionPropertyIterator *iter);
|
2009-02-02 19:57:57 +00:00
|
|
|
PointerRNA rna_builtin_properties_get(struct CollectionPropertyIterator *iter);
|
|
|
|
|
PointerRNA rna_builtin_type_get(struct PointerRNA *ptr);
|
2009-06-19 23:05:21 +00:00
|
|
|
PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key);
|
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 02:23:46 +00:00
|
|
|
|
|
|
|
|
/* Iterators */
|
|
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
typedef int (*IteratorSkipFunc)(struct CollectionPropertyIterator *iter, void *data);
|
|
|
|
|
|
2008-11-17 18:44:06 +00:00
|
|
|
typedef struct ListBaseIterator {
|
|
|
|
|
Link *link;
|
|
|
|
|
int flag;
|
2008-11-24 12:12:24 +00:00
|
|
|
IteratorSkipFunc skip;
|
2008-11-17 18:44:06 +00:00
|
|
|
} ListBaseIterator;
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-11-24 12:12:24 +00:00
|
|
|
void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct ListBase *lb, IteratorSkipFunc skip);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter);
|
|
|
|
|
void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter);
|
2008-11-17 18:44:06 +00:00
|
|
|
void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter);
|
2010-03-14 22:30:57 +00:00
|
|
|
PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct ListBase *lb, int index);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
typedef struct ArrayIterator {
|
|
|
|
|
char *ptr;
|
|
|
|
|
char *endptr;
|
2009-07-13 19:33:59 +00:00
|
|
|
void *free_ptr; /* will be free'd if set */
|
2008-11-07 02:58:25 +00:00
|
|
|
int itemsize;
|
2008-11-24 12:12:24 +00:00
|
|
|
IteratorSkipFunc skip;
|
2008-11-07 02:58:25 +00:00
|
|
|
} ArrayIterator;
|
|
|
|
|
|
2009-07-13 19:33:59 +00:00
|
|
|
void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_array_next(struct CollectionPropertyIterator *iter);
|
|
|
|
|
void *rna_iterator_array_get(struct CollectionPropertyIterator *iter);
|
2008-11-26 22:24:26 +00:00
|
|
|
void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_iterator_array_end(struct CollectionPropertyIterator *iter);
|
2010-03-14 22:30:57 +00:00
|
|
|
PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
/* Duplicated code since we can't link in blenlib */
|
|
|
|
|
|
|
|
|
|
void rna_addtail(struct ListBase *listbase, void *vlink);
|
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 02:23:46 +00:00
|
|
|
void rna_freelinkN(struct ListBase *listbase, void *vlink);
|
2008-10-31 23:50:02 +00:00
|
|
|
void rna_freelistN(struct ListBase *listbase);
|
2009-08-09 10:05:33 +00:00
|
|
|
PropertyDefRNA *rna_findlink(ListBase *listbase, const char *identifier);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2009-04-07 00:49:39 +00:00
|
|
|
StructDefRNA *rna_find_struct_def(StructRNA *srna);
|
|
|
|
|
FunctionDefRNA *rna_find_function_def(FunctionRNA *func);
|
|
|
|
|
PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm);
|
2009-07-02 03:32:57 +00:00
|
|
|
PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop);
|
2009-04-07 00:49:39 +00:00
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
/* Pointer Handling */
|
|
|
|
|
|
|
|
|
|
PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *type, void *data);
|
|
|
|
|
|
2009-04-07 00:49:39 +00:00
|
|
|
/* Functions */
|
|
|
|
|
|
|
|
|
|
int rna_parameter_size(struct PropertyRNA *parm);
|
2010-01-24 10:51:59 +00:00
|
|
|
int rna_parameter_size_alloc(struct PropertyRNA *parm);
|
2009-04-07 00:49:39 +00:00
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
#endif /* RNA_INTERNAL_H */
|
|
|
|
|
|
2008-12-01 21:23:58 +00:00
|
|
|
|