[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14789] trunk/blender/source/blender/src: More bugfixes for Armature Separation/Joining:
Joshua Leung
aligorith at gmail.com
Sun May 11 14:34:56 CEST 2008
Revision: 14789
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14789
Author: aligorith
Date: 2008-05-11 14:34:56 +0200 (Sun, 11 May 2008)
Log Message:
-----------
More bugfixes for Armature Separation/Joining:
* Move armatures out of posemode before joining/separating, so that bones don't mysteriously disappear after the operation
* Added an undo push and fixed up hotkey access for armature separation
Modified Paths:
--------------
trunk/blender/source/blender/src/editarmature.c
trunk/blender/source/blender/src/header_view3d.c
trunk/blender/source/blender/src/space.c
Modified: trunk/blender/source/blender/src/editarmature.c
===================================================================
--- trunk/blender/source/blender/src/editarmature.c 2008-05-11 12:34:39 UTC (rev 14788)
+++ trunk/blender/source/blender/src/editarmature.c 2008-05-11 12:34:56 UTC (rev 14789)
@@ -565,7 +565,11 @@
/* Get editbones of active armature to add editbones to */
ebbase.first=ebbase.last= NULL;
make_boneList(&ebbase, &arm->bonebase, NULL);
+
+ /* get pose of active object and move it out of posemode */
pose= ob->pose;
+ ob->flag &= ~OB_POSEMODE;
+ BASACT->flag &= ~OB_POSEMODE;
for (base=FIRSTBASE; base; base=nextbase) {
nextbase = base->next;
@@ -577,6 +581,8 @@
/* Get Pose of current armature */
opose= base->object->pose;
+ base->object->flag &= ~OB_POSEMODE;
+ BASACT->flag &= ~OB_POSEMODE;
/* Find the difference matrix */
Mat4Invert(oimat, ob->obmat);
@@ -837,7 +843,7 @@
arm= G.obedit->data;
/* we are going to do this as follows (unlike every other instance of separate):
- * 1. exit editmode for active armature/base. Take note of what this is.
+ * 1. exit editmode +posemode for active armature/base. Take note of what this is.
* 2. duplicate base - BASACT is the new one now
* 3. for each of the two armatures, enter editmode -> remove appropriate bones -> exit editmode + recalc
* 4. fix constraint links
@@ -856,6 +862,8 @@
/* 1) store starting settings and exit editmode */
oldob= G.obedit;
oldbase= BASACT;
+ oldob->flag &= ~OB_POSEMODE;
+ oldbase->flag &= ~OB_POSEMODE;
load_editArmature();
free_editArmature();
@@ -894,6 +902,8 @@
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWOOPS, 0);
+
+ BIF_undo_push("Separate Armature");
}
/* **************** END tools on Editmode Armature **************** */
Modified: trunk/blender/source/blender/src/header_view3d.c
===================================================================
--- trunk/blender/source/blender/src/header_view3d.c 2008-05-11 12:34:39 UTC (rev 14788)
+++ trunk/blender/source/blender/src/header_view3d.c 2008-05-11 12:34:56 UTC (rev 14789)
@@ -3964,7 +3964,7 @@
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill Between Joints|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|Ctrl Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c 2008-05-11 12:34:39 UTC (rev 14788)
+++ trunk/blender/source/blender/src/space.c 2008-05-11 12:34:56 UTC (rev 14789)
@@ -2411,7 +2411,7 @@
clear_bone_parent();
else if((G.qual==0) && (G.obedit->type==OB_ARMATURE))
select_bone_parent();
- else if((G.qual==(LR_CTRLKEY|LR_SHIFTKEY)) && (G.obedit->type==OB_ARMATURE))
+ else if((G.qual==(LR_CTRLKEY|LR_ALTKEY)) && (G.obedit->type==OB_ARMATURE))
separate_armature();
else if((G.qual==0) && G.obedit->type==OB_MESH)
separatemenu();
More information about the Bf-blender-cvs
mailing list