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_object_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_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 6435102d8e4..827e0cc60d9 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -33,7 +33,6 @@ #include "RNA_define.h" #include "RNA_types.h" -#include "RNA_enum_types.h" #include "DNA_object_types.h" @@ -51,7 +50,6 @@ #include "BKE_mesh.h" #include "BKE_DerivedMesh.h" -#include "BKE_constraint.h" #include "BKE_customdata.h" #include "BKE_anim.h" #include "BKE_depsgraph.h" @@ -352,30 +350,6 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int } */ -static bConstraint *rna_Object_constraints_add(Object *object, bContext *C, int type) -{ - WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); - return add_ob_constraint(object, NULL, type); -} - -static int rna_Object_constraints_remove(Object *object, bContext *C, int index) -{ - bConstraint *con= BLI_findlink(&object->constraints, index); - - if(con) { - free_constraint_data(con); - BLI_freelinkN(&object->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 void RNA_api_object(StructRNA *srna) @@ -451,27 +425,6 @@ void RNA_api_object(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm= RNA_def_boolean(func, "is_visible", 0, "", "Object visibility."); RNA_def_function_return(func, parm); - - /* Constraint collection */ - func= RNA_def_function(srna, "constraints__add", "rna_Object_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_Object_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); } #endif |