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:
authorTon Roosendaal <ton@blender.org>2007-11-28 15:11:06 +0300
committerTon Roosendaal <ton@blender.org>2007-11-28 15:11:06 +0300
commit36f7da70466603643ec28b47e4ec0b082fa5226a (patch)
treea93b182bc592a579fa53ee494ded494449aee1a1 /source/blender/blenkernel/intern/constraint.c
parentbb77ea8df5f016399e50bce5ef8b67d2cac89a28 (diff)
Tiny feature, but loadsa code, and big impact for the Blender riggers:
-> Constraint Influence Ipo now can be local, linked to constraint itself You enable this in the IpoWindow header, with the Action icon to the left of the Ipo Type menu. The button tooltips give the clue as well. Tech note: the Ipo now can get directly linked to a constraint, and is being called during regular pose constraint solving. Actions (and drivers in actions) are being calculated *before* pose constraint solving. Result of actions then is written in bones, which then solves the entire pose. This means you can have a driver on both the constraint, as on the action channel for the constraint! Not that I'm going to debug that easily :) Additional fix: Joshua added a copy/paste IpoCurve feature, but he broke the functionality to be able to paste in an empty ipo channel. That now works again
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 2dc488f8377..3d565c2a5a3 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -142,9 +142,11 @@ bConstraintChannel *get_constraint_channel (ListBase *list, const char name[])
{
bConstraintChannel *chan;
- for (chan = list->first; chan; chan=chan->next) {
- if (!strcmp(name, chan->name)) {
- return chan;
+ if(list) {
+ for (chan = list->first; chan; chan=chan->next) {
+ if (!strcmp(name, chan->name)) {
+ return chan;
+ }
}
}
@@ -175,17 +177,24 @@ bConstraintChannel *verify_constraint_channel (ListBase *list, const char name[]
void do_constraint_channels (ListBase *conbase, ListBase *chanbase, float ctime, short onlydrivers)
{
bConstraint *con;
- bConstraintChannel *chan;
- IpoCurve *icu= NULL;
/* 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);
+ Ipo *ipo= NULL;
+
+ if(con->flag & CONSTRAINT_OWN_IPO)
+ ipo= con->ipo;
+ else {
+ bConstraintChannel *chan = get_constraint_channel(chanbase, con->name);
+ if(chan) ipo= chan->ipo;
+ }
- if (chan && chan->ipo) {
- calc_ipo(chan->ipo, ctime);
+ if (ipo) {
+ IpoCurve *icu;
+
+ calc_ipo(ipo, ctime);
- for (icu=chan->ipo->curve.first; icu; icu=icu->next) {
+ for (icu=ipo->curve.first; icu; icu=icu->next) {
if (!onlydrivers || icu->driver) {
switch (icu->adrcode) {
case CO_ENFORCE: