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:
authorMatt Ebb <matt@mke3.net>2007-11-01 00:55:06 +0300
committerMatt Ebb <matt@mke3.net>2007-11-01 00:55:06 +0300
commit0edb5983ecb6fcf67a7bf3de407cad19324ce94d (patch)
treeee4855038c9bb065913d33c09db2705cce9ab6b8 /source/blender/src/editarmature.c
parent95300bac58704b971ffda1bd25e9fe05d3fef0f6 (diff)
* Two usability tweaks in adding objects, with user prefs
This changes the default behaviour in adding new objects, which has been discussed for a long time, in person, on the funboard, and in the tracker, and was agreed to be implemented during the 2.5 release cycle, so here it is. They have been made default, with preferences to bring back old behaviour since although people like myself still prefer the new default anyway, it will benefit new users the most. The preferences are in the 'Edit Methods' section, changing back to old behaviour is as simple as a click of a button. - Switch to edit mode preference By default, now adding a new object doesn't automatically switch to edit mode. Not only can this be annoying (most of the time when setting up scenes and models I don't want to edit it straight away anyway), but it's a major hurdle in the learning curve that new users have had to deal with at a very early stage. Blender's different modes are an important part of understanding how the software works and should have clear behaviour. The problem is that when a user selects something from the add menu, he's not telling Blender to change modes, he wants to add an object. But Blender then goes ahead and changes modes underneath him anyway, something that was never explicitly asked for, something that's unrelated to the mental task at hand, and fundamentally important to the operation of the software. We observed plenty of people struggling with this during the training sessions that we ran during Project Orange, and there's also no shortage of "why can't I select other objects" questions on the forums. - Aligned to View preference Now by default, adding a new object doesn't rotate it so it's aligned facing the view, but rather, it's remains unrotated in world space. This is something that's more of a convenience issue (allowing people like me to stop the 'Add->Tab->Alt R dance), but also makes things easier for new users, especially when doing things like rigging. For a lot of tools in Blender, like curve deform, path cycling, constraints, it's necessary for your objects' local axes to be aligned. This requirement isn't that obvious, and I've had to debug rigs a few times from the animator in our studio, who has everything set up correctly, but he just happened to be in a different vie at the time he added the object, so they're misaligned and causing problems. Having all objects get created aligned to worldspace, by default, makes a lot of these problems go away. It's much more understandable when rotations are caused by something you've done explicitly, rather than as a side effect of the software. For convenience as well, most of the time, when I'm working in context and I decide I need a new object, particularly working on production scenes that involve more than just one model, an Alt R is almost always required after adding, since I don't want to have to disrupt the current view of the scene by switching to top view, just to add an object. It's a bit arbitrary, the view from which you want to look at your objects isn't usually the way you want them to be looking at you.
Diffstat (limited to 'source/blender/src/editarmature.c')
-rw-r--r--source/blender/src/editarmature.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c
index e08f95e6443..b5675ef9c09 100644
--- a/source/blender/src/editarmature.c
+++ b/source/blender/src/editarmature.c
@@ -55,6 +55,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_modifier_types.h"
@@ -1485,7 +1486,7 @@ static EditBone *add_editbone(char *name)
return bone;
}
-static void add_primitive_bone(Object *ob)
+static void add_primitive_bone(Object *ob, short newob)
{
float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3];
EditBone *bone;
@@ -1496,7 +1497,9 @@ static void add_primitive_bone(Object *ob)
Mat4Invert(G.obedit->imat, G.obedit->obmat);
Mat4MulVecfl(G.obedit->imat, curs);
- Mat3CpyMat4(obmat, G.vd->viewmat);
+ if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(obmat, G.vd->viewmat);
+ else Mat3One(obmat);
+
Mat3CpyMat4(viewmat, G.obedit->obmat);
Mat3MulMat3(totmat, obmat, viewmat);
Mat3Inv(imat, totmat);
@@ -1507,12 +1510,18 @@ static void add_primitive_bone(Object *ob)
bone= add_editbone("Bone");
VECCOPY(bone->head, curs);
- VecAddf(bone->tail, bone->head, imat[1]); // bone with unit length 1
+
+ if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED)
+ VecAddf(bone->tail, bone->head, imat[1]); // bone with unit length 1
+ else
+ VecAddf(bone->tail, bone->head, imat[2]); // bone with unit length 1, pointing up Z
}
void add_primitiveArmature(int type)
{
+ short newob=0;
+
if(G.scene->id.lib) return;
/* this function also comes from an info window */
@@ -1534,13 +1543,18 @@ void add_primitiveArmature(int type)
make_editArmature();
setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
+ newob=1;
}
/* no primitive support yet */
- add_primitive_bone(G.obedit);
+ add_primitive_bone(G.obedit, newob);
countall(); // flushes selection!
+ if ( (newob) && !(U.flag & USER_ADD_EDITMODE)) {
+ exit_editmode(2);
+ }
+
allqueue(REDRAWALL, 0);
BIF_undo_push("Add primitive");
}