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>2009-01-05 12:54:39 +0300
committerJoshua Leung <aligorith@gmail.com>2009-01-05 12:54:39 +0300
commitdf20a12728626372de8a5eb127e57cb2cca40649 (patch)
tree1db0a794e8bd2bcdc899857715859ede024ca564 /source/blender/blenkernel
parent7de52578c044f20b166045eaf5e925c6714f6598 (diff)
2.5 - Animation Fixes + More Porting work in Action Editor
* Added crash fixes for loading old files with Actions/Armatures in them. Was caused by usage of some old globals still and the functions in question not performing NULL checks on the validity of the data they're given. * Added back reorganise action channels tools (shift/ctrl-shif pageup/down) for Action Editor. These are only available in 'Action Mode' only. * Tidied up Action Editor/Dopesheet tools code - removed various unused things, and also, added an API call in anim_deps.c to send the correct notifiers, since I anticipate that they're likely to require a few context checks which would be better to centralise than copy+paste everywhere. Note to Ton: could you have a look at this notifier stuff here? I'm not sure which ones I should be sending... * Also added a few assorted comments in various places
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/action.c8
-rw-r--r--source/blender/blenkernel/intern/armature.c8
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/blenkernel/intern/ipo.c1
4 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 31669cc212a..06597c983ca 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1493,19 +1493,19 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
void do_all_pose_actions(Scene *scene, Object *ob)
{
/* only to have safe calls from editor */
- if(ob==NULL) return;
- if(ob->type!=OB_ARMATURE || ob->pose==NULL) return;
+ if(ELEM(NULL, scene, ob)) return;
+ if((ob->type!=OB_ARMATURE) || (ob->pose==NULL)) return;
if(ob->pose->flag & POSE_LOCKED) { /* no actions to execute while transform */
if(ob->pose->flag & POSE_DO_UNLOCK)
ob->pose->flag &= ~(POSE_LOCKED|POSE_DO_UNLOCK);
}
- else if(ob->action && ((ob->nlaflag & OB_NLA_OVERRIDE)==0 || ob->nlastrips.first==NULL) ) {
+ else if( (ob->action) && ((ob->nlaflag & OB_NLA_OVERRIDE)==0 || (ob->nlastrips.first==NULL)) ) {
float cframe= (float) scene->r.cfra;
cframe= get_action_frame(ob, cframe);
- extract_pose_from_action (ob->pose, ob->action, bsystem_time(scene, ob, cframe, 0.0));
+ extract_pose_from_action(ob->pose, ob->action, bsystem_time(scene, ob, cframe, 0.0));
}
else if(ob->nlastrips.first) {
do_nla(scene, ob, ID_AR);
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index ce5921a701d..fe1d334f7f9 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2273,13 +2273,15 @@ void where_is_pose (Scene *scene, Object *ob)
Bone *bone;
bPoseChannel *pchan;
float imat[4][4];
- float ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0); /* not accurate... */
+ float ctime;
arm = get_armature(ob);
- if(arm==NULL) return;
- if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
+ if(ELEM(NULL, arm, scene)) return;
+ if((ob->pose==NULL) || (ob->pose->flag & POSE_RECALC))
armature_rebuild_pose(ob, arm);
+
+ ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0); /* not accurate... */
/* In editmode or restposition we read the data from the bones */
if(arm->edbo || (arm->flag & ARM_RESTPOS)) {
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index e6fd3cc8612..262a2b35713 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -352,7 +352,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
/* this can happen when active scene was lib-linked, and doesnt exist anymore */
if(CTX_data_scene(C)==NULL) {
- CTX_data_scene_set(C, G.main->scene.first);
+ CTX_data_scene_set(C, bfd->main->scene.first);
CTX_wm_screen(C)->scene= CTX_data_scene(C);
curscene= CTX_data_scene(C);
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index de374587f4e..78b1423e6bc 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -233,6 +233,7 @@ void free_ipo (Ipo *ipo)
/* ---------------------- Init --------------------------- */
/* on adding new ipos, or for empty views */
+// XXX users usually find these zoom settings problematic...
void ipo_default_v2d_cur (Scene *scene, int blocktype, rctf *cur)
{
switch (blocktype) {