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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-10-03 18:40:42 +0400
committerTon Roosendaal <ton@blender.org>2005-10-03 18:40:42 +0400
commitbec1e2572052e711b0785bb63f306dc961c77239 (patch)
tree58c848138e838a9a66fc41563ca5567e1acd8bf6 /source
parent9459f7c1be6c75f5d46f6ede9cc55e82dfeba270 (diff)
Adding Drivers in Actions now update live as well.
The main change is that an Action now always updates Poses on transform, unless you are editing the Pose itself. Please test!
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/action.c6
-rw-r--r--source/blender/makesdna/DNA_action_types.h4
-rw-r--r--source/blender/src/editaction.c2
-rw-r--r--source/blender/src/editipo.c2
-rw-r--r--source/blender/src/poseobject.c1
-rwxr-xr-xsource/blender/src/transform_conversions.c3
6 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 0fee6125f55..2df93f47e2a 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -467,8 +467,6 @@ void extract_pose_from_action(bPose *pose, bAction *act, float ctime)
if (!pose)
return;
- pose->ctime= ctime;
-
/* Copy the data from the action into the pose */
for (pchan= pose->chanbase.first; pchan; pchan=pchan->next) {
achan= get_named_actionchannel(act, pchan->name);
@@ -555,7 +553,7 @@ void do_all_actions(Object *ob)
ctime= bsystem_time(ob, 0, (float) G.scene->r.cfra, 0.0);
- if(ob->pose->ctime==ctime) { // no actions to execute while transform
+ if(ob->pose->flag & POSE_LOCKED) { // no actions to execute while transform
;
}
else if(ob->action) {
@@ -658,8 +656,6 @@ void do_all_actions(Object *ob)
}
}
}
-
- ob->pose->ctime= ctime;
}
if (tpose){
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 9a33e7a15b9..872d4b8e1ce 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -75,8 +75,7 @@ typedef struct bPoseChannel {
typedef struct bPose{
ListBase chanbase;
- int flag;
- float ctime; // last time actions were done, to allow keyframing
+ int flag, pad;
} bPose;
typedef struct bActionChannel {
@@ -122,6 +121,7 @@ typedef struct SpaceAction {
/* Pose->flag */
#define POSE_RECALC 1
+#define POSE_LOCKED 2
/* PoseChannel (transform) flags */
enum {
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index faead395413..6dad0f8eb88 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -1056,7 +1056,6 @@ void transform_actionchannel_keys(char mode)
if (G.saction->lock){
if(ob && ob->pose) {
- ob->pose->ctime= -123456.0f;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
}
force_draw_plus(SPACE_VIEW3D, 0);
@@ -1075,7 +1074,6 @@ void transform_actionchannel_keys(char mode)
/* Depending on the lock status, draw necessary views */
if(ob && ob->pose) {
- ob->pose->ctime= -123456.0f;
DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
}
remake_action_ipos(act);
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index c79b97c08f1..cb5988ee16e 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -547,7 +547,6 @@ void editipo_changed(SpaceIpo *si, int doredraw)
else if(si->blocktype==ID_AC) {
Object *ob= OBACT;
if(ob && ob->pose) {
- ob->pose->ctime= -123456.0f;
DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
}
allqueue(REDRAWVIEW3D, 0);
@@ -5013,7 +5012,6 @@ void transform_ipo(int mode)
else if(G.sipo->blocktype==ID_AC) {
Object *ob= OBACT;
if(ob && ob->pose) {
- ob->pose->ctime= -123456.0f;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
}
force_draw_plus(SPACE_VIEW3D, 0);
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c
index f8bd026fa93..8481f569e70 100644
--- a/source/blender/src/poseobject.c
+++ b/source/blender/src/poseobject.c
@@ -556,7 +556,6 @@ void paste_posebuf (int flip)
}
/* Update event for pose and deformation children */
- ob->pose->ctime= -123456.0f;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
if (G.flags & G_RECORDKEYS) {
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index b2834fd10dd..fbbea6a76fd 100755
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -498,6 +498,7 @@ static void createTransPose(Object *ob, TransInfo *t)
t->flag |= T_POSE;
t->poseobj= ob; // we also allow non-active objects to be transformed, in weightpaint
+ ob->pose->flag |= POSE_LOCKED;
/* init trans data */
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone");
@@ -1617,6 +1618,8 @@ void special_aftertrans_update(TransInfo *t)
ob= t->poseobj;
arm= ob->data;
+ ob->pose->flag &= ~POSE_LOCKED;
+
if(cancelled) /* if cancelled we do the update always */
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
else if(G.flags & G_RECORDKEYS) {