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:
-rw-r--r--source/blender/blenkernel/BKE_constraint.h30
-rw-r--r--source/blender/blenkernel/intern/constraint.c8
2 files changed, 21 insertions, 17 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 02084b49716..628032c1fca 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -66,31 +66,31 @@ typedef struct bConstraintOb {
/* ---------------------------------------------------------------------------- */
/* Constraint function prototypes */
-void unique_constraint_name (struct bConstraint *con, struct ListBase *list);
-void *new_constraint_data (short type);
-void free_constraints (struct ListBase *conlist);
-void copy_constraints (struct ListBase *dst, struct ListBase *src);
-void relink_constraints (struct ListBase *list);
-void free_constraint_data (struct bConstraint *con);
+void unique_constraint_name(struct bConstraint *con, struct ListBase *list);
+void *new_constraint_data(short type);
+void free_constraints(struct ListBase *conlist);
+void copy_constraints(struct ListBase *dst, struct ListBase *src);
+void relink_constraints(struct ListBase *list);
+void free_constraint_data(struct bConstraint *con);
/* Constraint Channel function prototypes */
-struct bConstraintChannel *get_constraint_channel (ListBase *list, const char *name);
-struct bConstraintChannel *verify_constraint_channel (ListBase *list, const char *name);
-void do_constraint_channels (struct ListBase *conbase, struct ListBase *chanbase, float ctime);
-void copy_constraint_channels (ListBase *dst, ListBase *src);
-void clone_constraint_channels (struct ListBase *dst, struct ListBase *src);
-void free_constraint_channels (ListBase *chanbase);
+struct bConstraintChannel *get_constraint_channel(ListBase *list, const char *name);
+struct bConstraintChannel *verify_constraint_channel(ListBase *list, const char *name);
+void do_constraint_channels(struct ListBase *conbase, struct ListBase *chanbase, float ctime);
+void copy_constraint_channels(ListBase *dst, ListBase *src);
+void clone_constraint_channels(struct ListBase *dst, struct ListBase *src);
+void free_constraint_channels(ListBase *chanbase);
/* Target function prototypes */
-char constraint_has_target (struct bConstraint *con);
+char constraint_has_target(struct bConstraint *con);
struct Object *get_constraint_target(struct bConstraint *con, char **subtarget);
void set_constraint_target(struct bConstraint *con, struct Object *ob, char *subtarget);
/* Constraint Evaluation function prototypes */
-struct bConstraintOb *constraints_make_evalob (struct Object *ob, void *subdata, short datatype);
+struct bConstraintOb *constraints_make_evalob(struct Object *ob, void *subdata, short datatype);
void constraints_clear_evalob(struct bConstraintOb *cob);
-short get_constraint_target_matrix (struct bConstraint *con, short ownertype, void *ownerdata, float mat[][4], float time);
+short get_constraint_target_matrix(struct bConstraint *con, short ownertype, void *ownerdata, float mat[][4], float time);
void solve_constraints (struct ListBase *conlist, struct bConstraintOb *cob, float ctime);
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 6cbe454b79c..08b8239513b 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -772,8 +772,9 @@ bConstraintChannel *verify_constraint_channel (ListBase *list, const char *name)
{
bConstraintChannel *chan;
- chan= get_constraint_channel (list, name);
- if(chan==NULL) {
+ chan= get_constraint_channel(list, name);
+
+ if(chan == NULL) {
chan= MEM_callocN(sizeof(bConstraintChannel), "new constraint chan");
BLI_addtail(list, chan);
strcpy(chan->name, name);
@@ -887,9 +888,12 @@ void do_constraint_channels (ListBase *conbase, ListBase *chanbase, float ctime)
/* for each Constraint, calculate its Influence from the corresponding ConstraintChannel */
for (con=conbase->first; con; con=con->next) {
+
chan = get_constraint_channel(chanbase, con->name);
+
if (chan && chan->ipo) {
calc_ipo(chan->ipo, ctime);
+
for (icu=chan->ipo->curve.first; icu; icu=icu->next) {
switch (icu->adrcode) {
case CO_ENFORCE: