2.5/Posemode:
* Pose mode was already object-localized, but moved the flag from object->flag to object->mode, with all the other modes. * Updated object mode RNA * Commented out some dubious use of base->flag with the posemode flag. So far as I could see the value was only being set, not read, so a hopefully safe change.
This commit is contained in:
@@ -687,7 +687,7 @@ char *CTX_data_mode_string(const bContext *C)
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
|
||||
if(ob) {
|
||||
if(ob->flag & OB_POSEMODE) return "posemode";
|
||||
if(ob->mode & OB_MODE_POSE) return "posemode";
|
||||
else if(ob->mode & OB_MODE_SCULPT) return "sculpt_mode";
|
||||
else if(ob->mode & OB_MODE_WEIGHT_PAINT) return "weightpaint";
|
||||
else if(ob->mode & OB_MODE_VERTEX_PAINT) return "vertexpaint";
|
||||
|
||||
@@ -493,7 +493,7 @@ void set_scene_bg(Scene *scene)
|
||||
base->flag |= flag;
|
||||
|
||||
/* not too nice... for recovering objects with lost data */
|
||||
if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
|
||||
//if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
|
||||
ob->flag= base->flag;
|
||||
|
||||
ob->ctime= -1234567.0; /* force ipo to be calculated later */
|
||||
|
||||
@@ -3430,7 +3430,7 @@ static void lib_link_object(FileData *fd, Main *main)
|
||||
if(ob->pose) {
|
||||
free_pose(ob->pose);
|
||||
ob->pose= NULL;
|
||||
ob->flag &= ~OB_POSEMODE;
|
||||
ob->mode &= ~OB_MODE_POSE;
|
||||
}
|
||||
}
|
||||
for(a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);
|
||||
|
||||
@@ -899,7 +899,7 @@ short keyingset_context_ok_poll (bContext *C, KeyingSet *ks)
|
||||
Object *obact= CTX_data_active_object(C);
|
||||
|
||||
/* if in posemode, check if 'pose-channels' requested for in KeyingSet */
|
||||
if ((obact && obact->pose) && (obact->flag & OB_POSEMODE)) {
|
||||
if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) {
|
||||
/* check for posechannels */
|
||||
|
||||
}
|
||||
@@ -930,7 +930,7 @@ static short modifykey_get_context_v3d_data (bContext *C, ListBase *dsources, Ke
|
||||
|
||||
/* check if the active object is in PoseMode (i.e. only deal with bones) */
|
||||
// TODO: check with the templates to see what we really need to store
|
||||
if ((obact && obact->pose) && (obact->flag & OB_POSEMODE)) {
|
||||
if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) {
|
||||
/* Pose Mode: Selected bones */
|
||||
#if 0
|
||||
//set_pose_keys(ob); /* sets pchan->flag to POSE_KEY if bone selected, and clears if not */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
@@ -144,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);
|
||||
@@ -528,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) {
|
||||
@@ -716,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) {
|
||||
@@ -1106,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;
|
||||
}
|
||||
@@ -1650,7 +1650,7 @@ void pose_activate_flipped_bone(Scene *scene)
|
||||
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) {
|
||||
@@ -2151,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) {
|
||||
|
||||
@@ -628,7 +628,7 @@ static void verify_constraint_name_func (bContext *C, void *con_v, void *name_v)
|
||||
|
||||
/* some commonly used macros in the constraints drawing code */
|
||||
#define is_armature_target(target) (target && target->type==OB_ARMATURE)
|
||||
#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE))
|
||||
#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->mode & OB_MODE_POSE))
|
||||
#define is_geom_target(target) (target && (ELEM(target->type, OB_MESH, OB_LATTICE)) )
|
||||
|
||||
/* Helper function for draw constraint - draws constraint space stuff
|
||||
|
||||
@@ -87,7 +87,7 @@ ListBase *get_active_constraints (Object *ob)
|
||||
if (ob == NULL)
|
||||
return NULL;
|
||||
|
||||
if (ob->flag & OB_POSEMODE) {
|
||||
if (ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan;
|
||||
|
||||
pchan = get_active_posechannel(ob);
|
||||
@@ -1065,7 +1065,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
|
||||
{
|
||||
/* if this constraint is being added to a posechannel, make sure
|
||||
* the constraint gets evaluated in pose-space */
|
||||
if (ob->flag & OB_POSEMODE) {
|
||||
if (ob->mode & OB_MODE_POSE) {
|
||||
con->ownspace = CONSTRAINT_SPACE_POSE;
|
||||
con->flag |= CONSTRAINT_SPACEONCE;
|
||||
}
|
||||
|
||||
@@ -3886,7 +3886,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
|
||||
ED_object_exit_editmode(C, EM_FREEDATA);
|
||||
ED_armature_enter_posemode(C, base);
|
||||
}
|
||||
else if(base->object->flag & OB_POSEMODE)
|
||||
else if(base->object->mode & OB_MODE_POSE)
|
||||
ED_armature_exit_posemode(C, base);
|
||||
else
|
||||
ED_armature_enter_posemode(C, base);
|
||||
@@ -4109,7 +4109,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
|
||||
|
||||
if(obedit==NULL) {
|
||||
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
// XXX pose_special_editmenu();
|
||||
}
|
||||
else if(paint_facesel_test(ob)) {
|
||||
@@ -4174,7 +4174,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
|
||||
else if(ob->mode & OB_MODE_WEIGHT_PAINT) {
|
||||
Object *par= modifiers_isDeformedByArmature(ob);
|
||||
|
||||
if(par && (par->flag & OB_POSEMODE)) {
|
||||
if(par && (par->mode & OB_MODE_POSE)) {
|
||||
nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
|
||||
|
||||
// XXX if(nr==1 || nr==2)
|
||||
@@ -6294,7 +6294,7 @@ static Base *object_add_duplicate_internal(Scene *scene, Base *base, int dupflag
|
||||
int a, didit;
|
||||
|
||||
ob= base->object;
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
; /* nothing? */
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -232,7 +232,7 @@ int ED_operator_posemode(bContext *C)
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
|
||||
if ((obact != obedit) && (obact) && (obact->type==OB_ARMATURE))
|
||||
return (obact->flag & OB_POSEMODE)!=0;
|
||||
return (obact->mode & OB_MODE_POSE)!=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */
|
||||
|
||||
/* verify if active weight group is also active bone */
|
||||
par= modifiers_isDeformedByArmature(ob);
|
||||
if(par && (par->flag & OB_POSEMODE)) {
|
||||
if(par && (par->mode & OB_MODE_POSE)) {
|
||||
bPoseChannel *pchan;
|
||||
for(pchan= par->pose->chanbase.first; pchan; pchan= pchan->next)
|
||||
if(pchan->bone->flag & BONE_ACTIVE)
|
||||
|
||||
@@ -620,7 +620,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
|
||||
|
||||
tenla->name= "Pose";
|
||||
|
||||
if(arm->edbo==NULL && (ob->flag & OB_POSEMODE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself
|
||||
if(arm->edbo==NULL && (ob->mode & OB_MODE_POSE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself
|
||||
int a= 0, const_index= 1000; /* ensure unique id for bone constraints */
|
||||
|
||||
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
|
||||
@@ -887,7 +887,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
|
||||
else {
|
||||
/* do not extend Armature when we have posemode */
|
||||
tselem= TREESTORE(te->parent);
|
||||
if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->flag & OB_POSEMODE);
|
||||
if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE);
|
||||
else {
|
||||
Bone *curBone;
|
||||
for (curBone=arm->bonebase.first; curBone; curBone=curBone->next){
|
||||
@@ -2177,13 +2177,13 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te,
|
||||
if(scene->obedit)
|
||||
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
|
||||
|
||||
if(ob->flag & OB_POSEMODE)
|
||||
if(ob->mode & OB_MODE_POSE)
|
||||
ED_armature_exit_posemode(C, base);
|
||||
else
|
||||
ED_armature_enter_posemode(C, base);
|
||||
}
|
||||
else {
|
||||
if(ob->flag & OB_POSEMODE) return 1;
|
||||
if(ob->mode & OB_MODE_POSE) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2271,7 +2271,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d
|
||||
range= (float)(end - start);
|
||||
|
||||
/* store values */
|
||||
ob->flag &= ~OB_POSEMODE;
|
||||
ob->mode &= ~OB_MODE_POSE;
|
||||
cfrao= CFRA;
|
||||
flago= arm->flag;
|
||||
arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
|
||||
@@ -2308,7 +2308,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d
|
||||
ob->pose= poseo;
|
||||
arm->flag= flago;
|
||||
armature_rebuild_pose(ob, ob->data);
|
||||
ob->flag |= OB_POSEMODE;
|
||||
ob->mode |= OB_MODE_POSE;
|
||||
ob->ipoflag= ipoflago;
|
||||
}
|
||||
|
||||
@@ -2349,7 +2349,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d,
|
||||
if (range == 0) return;
|
||||
|
||||
/* store values */
|
||||
ob->flag &= ~OB_POSEMODE;
|
||||
ob->mode &= ~OB_MODE_POSE;
|
||||
cfrao= CFRA;
|
||||
flago= arm->flag;
|
||||
arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
|
||||
@@ -2388,7 +2388,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d,
|
||||
ob->pose= poseo;
|
||||
arm->flag= flago;
|
||||
armature_rebuild_pose(ob, ob->data);
|
||||
ob->flag |= OB_POSEMODE;
|
||||
ob->mode |= OB_MODE_POSE;
|
||||
}
|
||||
|
||||
/* draw ghosts around current frame
|
||||
@@ -2415,7 +2415,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
|
||||
range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */
|
||||
|
||||
/* store values */
|
||||
ob->flag &= ~OB_POSEMODE;
|
||||
ob->mode &= ~OB_MODE_POSE;
|
||||
cfrao= CFRA;
|
||||
actframe= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0);
|
||||
flago= arm->flag;
|
||||
@@ -2474,7 +2474,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
|
||||
ob->pose= poseo;
|
||||
arm->flag= flago;
|
||||
armature_rebuild_pose(ob, ob->data);
|
||||
ob->flag |= OB_POSEMODE;
|
||||
ob->mode |= OB_MODE_POSE;
|
||||
}
|
||||
|
||||
/* ********************************** Armature Drawing - Main ************************* */
|
||||
@@ -2513,10 +2513,10 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
|
||||
/* drawing posemode selection indices or colors only in these cases */
|
||||
if(!(base->flag & OB_FROMDUPLI)) {
|
||||
if(G.f & G_PICKSEL) {
|
||||
if(ob->flag & OB_POSEMODE)
|
||||
if(ob->mode & OB_MODE_POSE)
|
||||
arm->flag |= ARM_POSEMODE;
|
||||
}
|
||||
else if(ob->flag & OB_POSEMODE) {
|
||||
else if(ob->flag & OB_MODE_POSE) {
|
||||
if (arm->ghosttype == ARM_GHOST_RANGE) {
|
||||
draw_ghost_poses_range(scene, v3d, rv3d, base);
|
||||
}
|
||||
@@ -2541,7 +2541,7 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
|
||||
draw_pose_channels(scene, v3d, rv3d, base, dt);
|
||||
arm->flag &= ~ARM_POSEMODE;
|
||||
|
||||
if(ob->flag & OB_POSEMODE)
|
||||
if(ob->mode & OB_MODE_POSE)
|
||||
UI_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
|
||||
}
|
||||
else retval= 1;
|
||||
|
||||
@@ -4778,7 +4778,7 @@ static void drawSolidSelect(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
|
||||
drawDispListwire(&ob->disp);
|
||||
}
|
||||
else if(ob->type==OB_ARMATURE) {
|
||||
if(!(ob->flag & OB_POSEMODE))
|
||||
if(!(ob->mode & OB_MODE_POSE))
|
||||
draw_armature(scene, v3d, rv3d, base, OB_WIRE, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1085,7 +1085,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
|
||||
if(ob->type==OB_MBALL) v3d_editmetaball_buts(block, ob, lim);
|
||||
else v3d_editvertex_buts(C, block, v3d, ob, lim);
|
||||
}
|
||||
else if(ob->flag & OB_POSEMODE) {
|
||||
else if(ob->mode & OB_MODE_POSE) {
|
||||
v3d_posearmature_buts(block, v3d, ob, lim);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -798,7 +798,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(ob->pose && (ob->flag & OB_POSEMODE)) {
|
||||
else if(ob->pose && (ob->mode & OB_MODE_POSE)) {
|
||||
bPoseChannel *pchan;
|
||||
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||
if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
|
||||
|
||||
@@ -958,7 +958,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
|
||||
for(base=scene->base.first; base; base= base->next) {
|
||||
if(TESTBASELIB(v3d, base)) {
|
||||
if(base->object->type==OB_ARMATURE)
|
||||
if(base->object->flag & OB_POSEMODE)
|
||||
if(base->object->mode & OB_MODE_POSE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -970,7 +970,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
|
||||
if(obedit) {
|
||||
ok = minmax_verts(obedit, min, max); /* only selected */
|
||||
}
|
||||
else if(ob && (ob->flag & OB_POSEMODE)) {
|
||||
else if(ob && (ob->mode & OB_MODE_POSE)) {
|
||||
if(ob->pose) {
|
||||
bArmature *arm= ob->data;
|
||||
bPoseChannel *pchan;
|
||||
@@ -2200,7 +2200,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
|
||||
rv3d->view = 0;
|
||||
//printf("passing here \n");
|
||||
//
|
||||
if (scene->obedit==NULL && ob && !(ob->flag & OB_POSEMODE)) {
|
||||
if (scene->obedit==NULL && ob && !(ob->mode & OB_MODE_POSE)) {
|
||||
use_sel = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3597,7 +3597,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o
|
||||
xco+= xmax;
|
||||
}
|
||||
else {
|
||||
if (ob && (ob->flag & OB_POSEMODE)) {
|
||||
if (ob && (ob->mode & OB_MODE_POSE)) {
|
||||
xmax= GetButStringLength("Pose");
|
||||
uiDefMenuBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,yco, xmax-3, 20, "");
|
||||
xco+= xmax;
|
||||
@@ -3655,7 +3655,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
|
||||
v3d->modeselect = V3D_OBJECTMODE_SEL;
|
||||
|
||||
if (obedit) v3d->modeselect = V3D_EDITMODE_SEL;
|
||||
else if(ob && (ob->flag & OB_POSEMODE)) v3d->modeselect = V3D_POSEMODE_SEL;
|
||||
else if(ob && (ob->mode & OB_MODE_POSE)) v3d->modeselect = V3D_POSEMODE_SEL;
|
||||
else if (ob && (ob->mode & OB_MODE_SCULPT)) v3d->modeselect = V3D_SCULPTMODE_SEL;
|
||||
else if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) v3d->modeselect = V3D_WEIGHTPAINTMODE_SEL;
|
||||
else if (ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->modeselect = V3D_VERTEXPAINTMODE_SEL;
|
||||
@@ -3667,7 +3667,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
|
||||
|
||||
/* not sure what the v3d->flag is useful for now... modeselect is confusing */
|
||||
if(obedit) v3d->flag |= V3D_EDITMODE;
|
||||
if(ob && (ob->flag & OB_POSEMODE)) v3d->flag |= V3D_POSEMODE;
|
||||
if(ob && (ob->mode & OB_MODE_POSE)) v3d->flag |= V3D_POSEMODE;
|
||||
if(ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->flag |= V3D_VERTEXPAINT;
|
||||
if(ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) v3d->flag |= V3D_WEIGHTPAINT;
|
||||
if(ob && (ob->mode & OB_MODE_TEXTURE_PAINT)) v3d->flag |= V3D_TEXTUREPAINT;
|
||||
@@ -3882,7 +3882,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
|
||||
|
||||
uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE, xco,yco,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (Ctrl Click for anim)");
|
||||
|
||||
if (ob && (ob->flag & OB_POSEMODE)) {
|
||||
if (ob && (ob->mode & OB_MODE_POSE)) {
|
||||
xco+= XIC;
|
||||
uiBlockBeginAlign(block);
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short mo
|
||||
else ED_base_object_select(base, BA_DESELECT);
|
||||
base->object->flag= base->flag;
|
||||
}
|
||||
if(base->object->flag & OB_POSEMODE) {
|
||||
if(base->object->mode & OB_MODE_POSE) {
|
||||
do_lasso_select_pose(vc, mcords, moves, select);
|
||||
}
|
||||
}
|
||||
@@ -1457,7 +1457,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
|
||||
int bone_only;
|
||||
int totobj= MAXPICKBUF; // XXX solve later
|
||||
|
||||
if((ob) && (ob->flag & OB_POSEMODE))
|
||||
if((ob) && (ob->mode & OB_MODE_POSE))
|
||||
bone_only= 1;
|
||||
else
|
||||
bone_only= 0;
|
||||
|
||||
@@ -482,7 +482,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op)
|
||||
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
|
||||
ob= base->object;
|
||||
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan;
|
||||
bArmature *arm= ob->data;
|
||||
|
||||
@@ -609,7 +609,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *op)
|
||||
else {
|
||||
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
|
||||
ob= base->object;
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan;
|
||||
bArmature *arm= ob->data;
|
||||
float cursp[3];
|
||||
@@ -775,7 +775,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *op)
|
||||
else {
|
||||
Object *ob= OBACT;
|
||||
|
||||
if(ob && (ob->flag & OB_POSEMODE)) {
|
||||
if(ob && (ob->mode & OB_MODE_POSE)) {
|
||||
bArmature *arm= ob->data;
|
||||
bPoseChannel *pchan;
|
||||
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
|
||||
@@ -935,7 +935,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op)
|
||||
|
||||
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
|
||||
ob= base->object;
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan;
|
||||
bArmature *arm= ob->data;
|
||||
|
||||
@@ -1004,7 +1004,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op)
|
||||
|
||||
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
|
||||
ob= base->object;
|
||||
if(ob->flag & OB_POSEMODE) {
|
||||
if(ob->mode & OB_MODE_POSE) {
|
||||
bPoseChannel *pchan;
|
||||
bArmature *arm= ob->data;
|
||||
|
||||
|
||||
@@ -917,7 +917,7 @@ static short pose_grab_with_ik(Object *ob)
|
||||
Bone *bonec;
|
||||
short tot_ik= 0;
|
||||
|
||||
if ((ob==NULL) || (ob->pose==NULL) || (ob->flag & OB_POSEMODE)==0)
|
||||
if ((ob==NULL) || (ob->pose==NULL) || (ob->mode & OB_MODE_POSE)==0)
|
||||
return 0;
|
||||
|
||||
arm = ob->data;
|
||||
@@ -5234,7 +5234,7 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
t->poseobj = ob; /* <- tsk tsk, this is going to give issues one day */
|
||||
}
|
||||
}
|
||||
else if (ob && (ob->flag & OB_POSEMODE)) {
|
||||
else if (ob && (ob->mode & OB_MODE_POSE)) {
|
||||
// XXX this is currently limited to active armature only...
|
||||
// XXX active-layer checking isn't done as that should probably be checked through context instead
|
||||
createTransPose(C, t, ob);
|
||||
@@ -5245,7 +5245,7 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
{
|
||||
if(ob_armature->type==OB_ARMATURE)
|
||||
{
|
||||
if(ob_armature->flag & OB_POSEMODE)
|
||||
if(ob_armature->mode & OB_MODE_POSE)
|
||||
{
|
||||
createTransPose(C, t, ob_armature);
|
||||
break;
|
||||
|
||||
@@ -338,7 +338,7 @@ int calc_manipulator_stats(const bContext *C)
|
||||
Mat4MulVecfl(obedit->obmat, scene->twmax);
|
||||
}
|
||||
}
|
||||
else if(ob && (ob->flag & OB_POSEMODE)) {
|
||||
else if(ob && (ob->mode & OB_MODE_POSE)) {
|
||||
bPoseChannel *pchan;
|
||||
int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
|
||||
|
||||
@@ -412,7 +412,7 @@ int calc_manipulator_stats(const bContext *C)
|
||||
switch(v3d->twmode) {
|
||||
|
||||
case V3D_MANIP_NORMAL:
|
||||
if(obedit || ob->flag & OB_POSEMODE) {
|
||||
if(obedit || ob->mode & OB_MODE_POSE) {
|
||||
float mat[3][3];
|
||||
int type;
|
||||
|
||||
@@ -1415,7 +1415,7 @@ void BIF_draw_manipulator(const bContext *C)
|
||||
rv3d->twmat[3][2]= (scene->twmin[2] + scene->twmax[2])/2.0f;
|
||||
if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) {
|
||||
Object *ob= OBACT;
|
||||
if(ob && !(ob->flag & OB_POSEMODE))
|
||||
if(ob && !(ob->mode & OB_MODE_POSE))
|
||||
VECCOPY(rv3d->twmat[3], ob->obmat[3]);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -87,7 +87,7 @@ void BIF_manageTransformOrientation(bContext *C, int confirm, int set) {
|
||||
else if (obedit->type == OB_ARMATURE)
|
||||
index = manageBoneSpace(C, confirm, set);
|
||||
}
|
||||
else if (ob && (ob->flag & OB_POSEMODE)) {
|
||||
else if (ob && (ob->mode & OB_MODE_POSE)) {
|
||||
index = manageBoneSpace(C, confirm, set);
|
||||
}
|
||||
else {
|
||||
@@ -487,7 +487,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
|
||||
break;
|
||||
|
||||
case V3D_MANIP_NORMAL:
|
||||
if(obedit || ob->flag & OB_POSEMODE) {
|
||||
if(obedit || ob->mode & OB_MODE_POSE) {
|
||||
float mat[3][3];
|
||||
int type;
|
||||
|
||||
@@ -864,7 +864,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
|
||||
Mat3MulVecfl(mat, plane);
|
||||
}
|
||||
}
|
||||
else if(ob && (ob->flag & OB_POSEMODE))
|
||||
else if(ob && (ob->mode & OB_MODE_POSE))
|
||||
{
|
||||
bArmature *arm= ob->data;
|
||||
bPoseChannel *pchan;
|
||||
|
||||
@@ -402,7 +402,6 @@ extern Object workob;
|
||||
#define OB_DONE 1024
|
||||
#define OB_RADIO 2048
|
||||
#define OB_FROMGROUP 4096
|
||||
#define OB_POSEMODE 8192
|
||||
|
||||
/* ob->recalc (flag bits!) */
|
||||
#define OB_RECALC_OB 1
|
||||
@@ -519,6 +518,7 @@ extern Object workob;
|
||||
#define OB_MODE_WEIGHT_PAINT 8
|
||||
#define OB_MODE_TEXTURE_PAINT 16
|
||||
#define OB_MODE_PARTICLE_EDIT 32
|
||||
#define OB_MODE_POSE 64
|
||||
|
||||
/* ob->softflag in DNA_object_force.h */
|
||||
|
||||
|
||||
@@ -976,6 +976,7 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
{OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", 0, "Weight Paint", ""},
|
||||
{OB_MODE_WEIGHT_PAINT, "TEXTURE_PAINT", 0, "Texture Paint", ""},
|
||||
{OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", 0, "Particle Edit", ""},
|
||||
{OB_MODE_POSE, "POSE", 0, "Pose", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
static EnumPropertyItem empty_drawtype_items[] = {
|
||||
@@ -1470,11 +1471,6 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
RNA_def_property_struct_type(prop, "Pose");
|
||||
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
|
||||
|
||||
prop= RNA_def_property(srna, "pose_mode", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode.");
|
||||
|
||||
/* shape keys */
|
||||
|
||||
prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
|
||||
|
||||
Reference in New Issue
Block a user