diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 19:08:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 19:08:03 +0300 |
commit | 91352006c4ba8276ff2c7c8ae21461d16cf3f702 (patch) | |
tree | 6eb2a8d52e697c045eadca8e9e122e14dc73a4a6 /source/blender/makesrna/intern/rna_pose_api.c | |
parent | 6df83fba020c596aaf242271237f333d178e4c0e (diff) |
arbitrary property and function support for rna properties (arrays and collections), this means functions can be easily added.
eg.
scene.objects.link()
object.constraints.new()
mesh.verts.transform(...)
mesh.faces.active
PropertyRNA stores an StructRNA pointer where these can be defined.
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_pose_api.c | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c index ae83b728dd6..d044a0f7f51 100644 --- a/source/blender/makesrna/intern/rna_pose_api.c +++ b/source/blender/makesrna/intern/rna_pose_api.c @@ -33,7 +33,6 @@ #include "RNA_define.h" #include "RNA_types.h" -#include "RNA_enum_types.h" #include "DNA_object_types.h" @@ -44,33 +43,6 @@ /* #include "DNA_anim_types.h" */ #include "DNA_action_types.h" /* bPose */ -#include "BKE_constraint.h" /* bPose */ - -static bConstraint *rna_PoseChannel_constraints_add(bPoseChannel *pchan, bContext *C, int type) -{ - //WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); - // TODO, pass object also - // TODO, new pose bones don't have updated draw flags - return add_pose_constraint(NULL, pchan, NULL, type); -} - -static int rna_PoseChannel_constraints_remove(bPoseChannel *pchan, bContext *C, int index) -{ - bConstraint *con= BLI_findlink(&pchan->constraints, index); - - if(con) { - free_constraint_data(con); - BLI_freelinkN(&pchan->constraints, con); - - //ED_object_constraint_set_active(object, NULL); - //WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, object); - - return 1; - } - else { - return 0; - } -} #else @@ -82,31 +54,8 @@ void RNA_api_pose(StructRNA *srna) void RNA_api_pose_channel(StructRNA *srna) { - FunctionRNA *func; - PropertyRNA *parm; - - - /* Constraint collection */ - func= RNA_def_function(srna, "constraints__add", "rna_PoseChannel_constraints_add"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Add a constraint to this object"); - /* return type */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint."); - RNA_def_function_return(func, parm); - /* object to add */ - parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "constraints__remove", "rna_PoseChannel_constraints_remove"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Remove a constraint from this object."); - /* return type */ - parm= RNA_def_boolean(func, "success", 0, "Success", "Removed the constraint successfully."); - RNA_def_function_return(func, parm); - /* object to add */ - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); - RNA_def_property_flag(parm, PROP_REQUIRED); - +// FunctionRNA *func; +// PropertyRNA *parm; } |