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>2005-07-26 23:51:15 +0400
committerTon Roosendaal <ton@blender.org>2005-07-26 23:51:15 +0400
commitb0065e3451108adb94a675e997a0404b5be4a069 (patch)
tree9848a79341fec9f1de2f4c40d0a947f707494f00 /source/blender
parenteadfd13123aa29c88d0bffd605f1314c05383680 (diff)
Added PoseMode CTRL+C copy menu. Does loc/rot/size and constraints.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/BIF_poseobject.h1
-rw-r--r--source/blender/src/poseobject.c51
-rw-r--r--source/blender/src/space.c5
3 files changed, 56 insertions, 1 deletions
diff --git a/source/blender/include/BIF_poseobject.h b/source/blender/include/BIF_poseobject.h
index 6c065ace0d8..0091d4dfe1e 100644
--- a/source/blender/include/BIF_poseobject.h
+++ b/source/blender/include/BIF_poseobject.h
@@ -54,6 +54,7 @@ void pose_special_editmenu(void);
void pose_add_IK(void);
void pose_clear_IK(void);
void pose_clear_constraints(void);
+void pose_copy_menu(void);
#endif
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c
index 2aea0ecfb26..76fb388f475 100644
--- a/source/blender/src/poseobject.c
+++ b/source/blender/src/poseobject.c
@@ -48,6 +48,7 @@
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_object.h"
+#include "BKE_utildefines.h"
#include "BIF_editconstraint.h"
#include "BIF_gl.h"
@@ -326,3 +327,53 @@ void pose_clear_constraints(void)
}
+void pose_copy_menu(void)
+{
+ Object *ob= OBACT;
+ bPoseChannel *pchan, *pchanact;
+ short nr;
+
+ /* paranoia checks */
+ if(!ob && !ob->pose) return;
+ if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+
+ /* find active */
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if(pchan->bone->flag & BONE_ACTIVE) break;
+ }
+
+ if(pchan==NULL) return;
+ pchanact= pchan;
+
+ nr= pupmenu("Copy Pose Attributes %t|Location%x1|Rotation%x2|Size%x3|Constraints");
+
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if(pchan->bone->flag & BONE_SELECTED) {
+ if(pchan!=pchanact) {
+ if(nr==1) {
+ VECCOPY(pchan->loc, pchanact->loc);
+ }
+ else if(nr==2) {
+ QUATCOPY(pchan->quat, pchanact->quat);
+ }
+ else if(nr==3) {
+ VECCOPY(pchan->size, pchanact->size);
+ }
+ else if(nr==4) {
+ free_constraints(&pchan->constraints);
+ copy_constraints(&pchan->constraints, &pchanact->constraints);
+ pchan->constflag = pchanact->constflag;
+ }
+ }
+ }
+ }
+
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
+
+ allqueue (REDRAWVIEW3D, 0);
+ allqueue (REDRAWBUTSOBJECT, 0);
+
+ BIF_undo_push("Copy Pose Attributes");
+
+}
+
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index c112fd059fc..19cf4bdd0eb 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -1120,7 +1120,10 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case CKEY:
if(G.qual==LR_CTRLKEY) {
- copy_attr_menu();
+ if(ob && (ob->flag & OB_POSEMODE))
+ pose_copy_menu(); /* poseobject.c */
+ else
+ copy_attr_menu();
}
else if(G.qual==LR_ALTKEY) {
if(ob && (ob->flag & OB_POSEMODE))