Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2007-06-18 11:41:21 +0400
committerJoshua Leung <aligorith@gmail.com>2007-06-18 11:41:21 +0400
commit01e8789f3f950a15aea9947ebadb1dcdcccf6a7e (patch)
tree6c9d3fa3b93d427728c1a0ce619f765227c9e677 /source/blender/makesdna/DNA_constraint_types.h
parent770291b9ea1ec03d98b6bae4fd2a2d3f0091be41 (diff)
== PyConstraints ==
At last! The ability to code constraints in Python. This opens up many interesting rigging possibilities, as well as making prototyping constraints easier. * A PyConstraint script must begin with the line #BPYCONSTRAINT * It must also define a doConstraint function, which performs the core actions of the constraint. * PyConstraints use IDProperties to store custom properties for each PyConstraint instance. The scripter can choose which of these ID-Properties to expose to a user to control the behaviour of the constraint. This must be done using the Draw.PupBlock method. Credits to Joe Eager (joeedh) for coding the original patch on which this is based. I've made heavy revisions to large parts of the patch. For more detailed information, and some demo scripts, see the following page: http://aligorith.googlepages.com/pyconstraints2
Diffstat (limited to 'source/blender/makesdna/DNA_constraint_types.h')
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 74307454187..3179d1035ff 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -39,6 +39,10 @@
#include "DNA_object_types.h"
struct Action;
+struct Text;
+#ifndef __cplusplus
+struct PyObject;
+#endif
/* channels reside in Object or Action (ListBase) constraintChannels */
typedef struct bConstraintChannel{
@@ -59,6 +63,18 @@ typedef struct bConstraint{
float enforce;
} bConstraint;
+/* Python Script Constraint */
+typedef struct bPythonConstraint {
+ Object *tar; /* object to use as target (if required) */
+ char subtarget[32]; /* bone to use as subtarget (if required) */
+
+ struct Text *text; /* text-buffer (containing script) to execute */
+ IDProperty *prop; /* 'id-properties' used to store custom properties for constraint */
+
+ int flag; /* general settings/state indicators accessed by bitmapping */
+ int pad;
+} bPythonConstraint;
+
/* Single-target subobject constraints */
typedef struct bKinematicConstraint{
Object *tar;
@@ -350,6 +366,10 @@ typedef struct bClampToConstraint {
#define LIMIT_NOPARENT 0x01
+/* python constraint -> flag */
+#define PYCON_USETARGETS 0x01
+#define PYCON_SCRIPTERROR 0x02
+
#define CONSTRAINT_DRAW_PIVOT 0x40
/* important: these defines need to match up with PHY_DynamicTypes headerfile */