Stage two of the giant animation recode project; Ipo/Action/NLA cleanup

-> Note; added 2 new c files (split editipo.c). MSVC needs upgrade.

Impatient people can check the goodies in CMS:
http://www.blender3d.org/cms/Action_and_NLA_editor.706.0.html

Most work was on trying to unwind the spaghetti for editing ipos. Too much
history and bad design got added here. Most evident changes:
- made generic 'context' for detecting which Ipo is being edited, or to
  assign ipos or to retrieve ipo curves.
- made generic insertkey() for all ipo types, including actions
- shuffled a lot of code around to make things more logical. Also made
  sure local functions are not exported

It is far from ready... when action/nla was added in Blender, a lot of
duplicate code was generated. That's for another time.

Now the goodies;
- made Actions to allow any Ipo type
- made NLA to define active actions, for Action window too
- corrected timing for active action, so it shows the 'real time', as
  defined in NLA editor.

I did update python code, but that would require testing. Testing is
needed for this commit in general, too many changes happened on all
levels of the animation system. :)
Will keep track of all reports this evening, hopefully it doesnt break
the pre-release schedule!
This commit is contained in:
2005-10-10 17:42:48 +00:00
parent ad915277a0
commit 87365d8d40
26 changed files with 4045 additions and 3963 deletions

View File

@@ -85,11 +85,11 @@ ListBase *get_active_constraint_channels (Object *ob, int forcevalid)
if (!forcevalid)
return NULL;
ob->action=add_empty_action();
ob->action=add_empty_action(ID_PO);
}
/* Make sure we have an actionchannel */
achan = get_named_actionchannel(ob->action, pchan->name);
achan = get_action_channel(ob->action, pchan->name);
if (!achan){
if (!forcevalid)
return NULL;
@@ -109,7 +109,17 @@ ListBase *get_active_constraint_channels (Object *ob, int forcevalid)
else return NULL;
}
/* else we return object constraints */
return &ob->constraintChannels;
else {
if(ob->ipoflag & OB_ACTION_OB) {
bActionChannel *achan = get_action_channel(ob->action, "Object");
if(achan)
return &achan->constraintChannels;
else
return NULL;
}
return &ob->constraintChannels;
}
}
@@ -162,7 +172,7 @@ bConstraintChannel *get_active_constraint_channel(Object *ob)
if(con->flag & CONSTRAINT_ACTIVE)
break;
if(con) {
bActionChannel *achan = get_named_actionchannel(ob->action, pchan->name);
bActionChannel *achan = get_action_channel(ob->action, pchan->name);
if(achan) {
for(chan= achan->constraintChannels.first; chan; chan= chan->next)
if(!strcmp(chan->name, con->name))
@@ -178,10 +188,14 @@ bConstraintChannel *get_active_constraint_channel(Object *ob)
if(con->flag & CONSTRAINT_ACTIVE)
break;
if(con) {
for(chan= ob->constraintChannels.first; chan; chan= chan->next)
if(!strcmp(chan->name, con->name))
break;
return chan;
ListBase *lb= get_active_constraint_channels(ob, 0);
if(lb) {
for(chan= lb->first; chan; chan= chan->next)
if(!strcmp(chan->name, con->name))
break;
return chan;
}
}
}
@@ -189,7 +203,6 @@ bConstraintChannel *get_active_constraint_channel(Object *ob)
}
bConstraint *add_new_constraint(short type)
{
bConstraint *con;