[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12205] trunk/blender/source/blender/src/ poseobject.c: Bugfix for Move Bone to Layer:
Joshua Leung
aligorith at gmail.com
Thu Oct 4 11:20:01 CEST 2007
Revision: 12205
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12205
Author: aligorith
Date: 2007-10-04 11:20:01 +0200 (Thu, 04 Oct 2007)
Log Message:
-----------
Bugfix for Move Bone to Layer:
The case for EditMode needed to occur before the one for PoseMode as PoseMode can still be 'on' for an armature even while it is in EditMode.
Modified Paths:
--------------
trunk/blender/source/blender/src/poseobject.c
Modified: trunk/blender/source/blender/src/poseobject.c
===================================================================
--- trunk/blender/source/blender/src/poseobject.c 2007-10-04 01:36:12 UTC (rev 12204)
+++ trunk/blender/source/blender/src/poseobject.c 2007-10-04 09:20:01 UTC (rev 12205)
@@ -881,7 +881,7 @@
bArmature *arm;
short lay= 0;
- if(ob==NULL) return;
+ if (ob==NULL) return;
arm= ob->data;
if (G.qual & LR_SHIFTKEY) {
@@ -897,6 +897,32 @@
allqueue(REDRAWACTION, 0);
allqueue(REDRAWBUTSEDIT, 0);
}
+ else if (G.obedit) {
+ /* the check for editbone layer moving needs to occur before posemode one to work */
+ EditBone *ebo;
+
+ for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
+ if (arm->layer & ebo->layer) {
+ if (ebo->flag & BONE_SELECTED)
+ lay |= ebo->layer;
+ }
+ }
+ if (lay==0) return;
+
+ if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return;
+ if (lay==0) return;
+
+ for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
+ if (arm->layer & ebo->layer) {
+ if (ebo->flag & BONE_SELECTED)
+ ebo->layer= lay;
+ }
+ }
+
+ BIF_undo_push("Move Bone Layer");
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+ }
else if (ob->flag & OB_POSEMODE) {
/* pose-channel layers */
bPoseChannel *pchan;
@@ -922,35 +948,9 @@
}
}
- BIF_undo_push("Move Bone layer");
+ BIF_undo_push("Move Bone Layer");
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWBUTSEDIT, 0);
}
- else if (G.obedit) {
- /* must be editbone layers then */
- EditBone *ebo;
-
- for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if (arm->layer & ebo->layer) {
- if (ebo->flag & BONE_SELECTED)
- lay |= ebo->layer;
- }
- }
- if (lay==0) return;
-
- if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return;
- if (lay==0) return;
-
- for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if (arm->layer & ebo->layer) {
- if (ebo->flag & BONE_SELECTED)
- ebo->layer= lay;
- }
- }
-
- BIF_undo_push("Move Bone layer");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
}
More information about the Bf-blender-cvs
mailing list