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:
authorJoseph Eagar <joeedh@gmail.com>2009-08-26 14:27:04 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-08-26 14:27:04 +0400
commitde7f08cc41c7087ecde096c89ee58f43ccb1cf91 (patch)
tree401ab2a2a7429c2caa63c3135341958155a86935 /source/blender/editors/armature
parenta34ffefa0025d144826cd1bf7a136af743847f1b (diff)
parentd893b0f9ff5fc21277b9c24568e224961537c23c (diff)
merge with 2.5 at r22793
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c18
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c6
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/armature/poseobject.c21
4 files changed, 25 insertions, 22 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index c1b24375b3d..632f037679f 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -713,7 +713,7 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* get pose of active object and move it out of posemode */
pose= ob->pose;
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) {
@@ -724,8 +724,8 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* Get Pose of current armature */
opose= base->object->pose;
- base->object->flag &= ~OB_POSEMODE;
- BASACT->flag &= ~OB_POSEMODE;
+ base->object->mode &= ~OB_MODE_POSE;
+ //BASACT->flag &= ~OB_MODE_POSE;
/* Find the difference matrix */
Mat4Invert(oimat, ob->obmat);
@@ -1034,8 +1034,8 @@ static int separate_armature_exec (bContext *C, wmOperator *op)
/* 1) store starting settings and exit editmode */
oldob= obedit;
oldbase= BASACT;
- oldob->flag &= ~OB_POSEMODE;
- oldbase->flag &= ~OB_POSEMODE;
+ oldob->mode &= ~OB_MODE_POSE;
+ //oldbase->flag &= ~OB_POSEMODE;
ED_armature_from_edit(scene, obedit);
ED_armature_edit_free(obedit);
@@ -4332,7 +4332,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
}
/* in weightpaint we select the associated vertex group too */
- if (G.f & G_WEIGHTPAINT) {
+ if (ob->mode & OB_MODE_WEIGHT_PAINT) {
if (nearBone->flag & BONE_ACTIVE) {
vertexgroup_select_by_name(OBACT, nearBone->name);
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
@@ -4424,7 +4424,7 @@ static int bone_skinnable(Object *ob, Bone *bone, void *datap)
int a, segments;
struct { Object *armob; void *list; int heat; } *data = datap;
- if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+ if(!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
segments = bone->segments;
@@ -4489,7 +4489,7 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
int a, segments;
struct { Object *armob; void *list; int heat; } *data= datap;
- if (!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+ if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
segments = bone->segments;
@@ -4588,7 +4588,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
float (*root)[3], (*tip)[3], (*verts)[3];
int *selected;
int numbones, vertsfilled = 0, i, j, segments = 0;
- int wpmode = (G.f & G_WEIGHTPAINT);
+ int wpmode = (ob->mode & OB_MODE_WEIGHT_PAINT);
struct { Object *armob; void *list; int heat; } looper_data;
looper_data.armob = par;
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index f3f7bccde04..79d3d7b1366 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -2320,7 +2320,7 @@ void sk_drawSketch(Scene *scene, View3D *v3d, SK_Sketch *sketch, int with_names)
for (p = sketch->depth_peels.first; p; p = p->next)
{
- int index = (int)(p->ob);
+ int index = GET_INT_FROM_POINTER(p->ob);
index = (index >> 5) & 7;
glColor3fv(colors[index]);
@@ -2466,8 +2466,10 @@ static int sketch_delete(bContext *C, wmOperator *op, wmEvent *event)
void BIF_sk_selectStroke(bContext *C, short mval[2], short extend)
{
+ ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0);
- if (sketch)
+
+ if (sketch != NULL && ts->bone_sketching & BONE_SKETCHING)
{
sk_selectStroke(C, sketch, mval, extend);
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index ef2e5188487..021bec05a3b 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -342,7 +342,7 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt)
uiItemIntO(layout, "Add New (Current Frame)", 0, "POSELIB_OT_pose_add", "frame", CFRA);
/* replace existing - submenu */
- uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu);
+ uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu, NULL);
}
uiPupMenuEnd(C, pup);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 174bb39d7b9..5b378878f91 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -126,7 +126,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
switch (ob->type){
case OB_ARMATURE:
- ob->flag |= OB_POSEMODE;
+ ob->mode |= OB_MODE_POSE;
base->flag= ob->flag;
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_POSE, NULL);
@@ -135,7 +135,8 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
default:
return;
}
- ED_view3d_exit_paint_modes(C);
+
+ ED_object_toggle_modes(C, ob->mode);
}
void ED_armature_exit_posemode(bContext *C, Base *base)
@@ -143,7 +144,7 @@ void ED_armature_exit_posemode(bContext *C, Base *base)
if(base) {
Object *ob= base->object;
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
base->flag= ob->flag;
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
@@ -527,7 +528,7 @@ void pose_select_constraint_target(Scene *scene)
/* paranoia checks */
if (!ob && !ob->pose) return;
- if (ob==obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if (ob==obedit || (ob->mode & OB_MODE_POSE)==0) return;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (arm->layer & pchan->bone->layer) {
@@ -715,7 +716,7 @@ void pose_copy_menu(Scene *scene)
/* paranoia checks */
if (ELEM(NULL, ob, ob->pose)) return;
- if ((ob==obedit) || (ob->flag & OB_POSEMODE)==0) return;
+ if ((ob==obedit) || (ob->mode & OB_MODE_POSE)==0) return;
/* find active */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1105,7 +1106,7 @@ void pose_adds_vgroups(Scene *scene, Object *meshobj, int heatweights)
// XXX extern VPaint Gwp; /* from vpaint */
Object *poseobj= modifiers_isDeformedByArmature(meshobj);
- if(poseobj==NULL || (poseobj->flag & OB_POSEMODE)==0) {
+ if(poseobj==NULL || (poseobj->mode & OB_MODE_POSE)==0) {
error("The active object must have a deforming armature in pose mode");
return;
}
@@ -1646,10 +1647,10 @@ void pose_activate_flipped_bone(Scene *scene)
if(ob==NULL) return;
- if(G.f & G_WEIGHTPAINT) {
+ if(ob->mode && OB_MODE_WEIGHT_PAINT) {
ob= modifiers_isDeformedByArmature(ob);
}
- if(ob && (ob->flag & OB_POSEMODE)) {
+ if(ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan, *pchanf;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1670,7 +1671,7 @@ void pose_activate_flipped_bone(Scene *scene)
pchanf->bone->flag |= (BONE_SELECTED|BONE_ACTIVE);
/* in weightpaint we select the associated vertex group too */
- if(G.f & G_WEIGHTPAINT) {
+ if(ob->mode & OB_MODE_WEIGHT_PAINT) {
vertexgroup_select_by_name(OBACT, name);
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
}
@@ -2150,7 +2151,7 @@ void pose_special_editmenu(Scene *scene)
/* paranoia checks */
if(!ob && !ob->pose) return;
- if(ob==obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if(ob==obedit || (ob->mode & OB_MODE_POSE)==0) return;
nr= pupmenu("Specials%t|Select Constraint Target%x1|Flip Left-Right Names%x2|Calculate Paths%x3|Clear Paths%x4|Clear User Transform %x5|Relax Pose %x6|%l|AutoName Left-Right%x7|AutoName Front-Back%x8|AutoName Top-Bottom%x9");
if(nr==1) {