2.5/Posemode:
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 16 Aug 2009 03:24:23 +0000 (03:24 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 16 Aug 2009 03:24:23 +0000 (03:24 +0000)
* 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.

25 files changed:
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseobject.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/editconstraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/intern/rna_object.c

index 41cf5122103eb3ad309aff14f750d6ca781cb674..9ffd3aa704fc5287c52bbe2aafd30916a240929a 100644 (file)
@@ -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";
index 8e889859317a4a65a90e140da19d4e5a215a8bea..71271e77adfe20ff02f892e2caabf62bae51cb00 100644 (file)
@@ -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 */
index 7e0e74430fcb02a1c661e0c099eff4d272130ce0..e5163d317e7b8538290d6d9b3cada2f91e29a3f8 100644 (file)
@@ -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]);
index ffc93340f8c065945509eb4c2ae338ce87194a6a..5bd37ba78319eb356cb3636f49068573d5e9f7ff 100644 (file)
@@ -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 */
index 07da42e4cbb1b1d9b7e8213db4ba7ae05c1c1547..632f037679f49f48e1ae1a5f2fce437523617cc4 100644 (file)
@@ -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);
index af419664ffcea3bbf87a3ab4871ef645c909bfd3..5b378878f91e108a26e45677525672b1681fb34b 100644 (file)
@@ -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) {
index 08a8fab42e94df69826896fc8f7a4aea45b0f549..6eaf7c3e1777213a84fd81a10c5951d88bf05979 100644 (file)
@@ -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 
index 9e8205e58abf76195b74a79b9ddf19755b6caee5..23b3caf8e268a81f0a8f784fae48cb1a8306fbbf 100644 (file)
@@ -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;
                        }
index eb4150feb0c9178a7381534c316b487bf45ea2a1..302c4c1bdce977eace6549e0d6c63bfc34a568f0 100644 (file)
@@ -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 {
index b8980d86fdcba60e0831a81ddcf658402867c9e7..9453c7ffe098916378dda89adde9e57ffdd1af49 100644 (file)
@@ -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;
 }
index 8419c3fd1887b48010b3126469f262d271568ea9..bbc68a6bd0a856417ed11295b6b4b554c2d99bc1 100644 (file)
@@ -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)
index de4d6f90bcdeca0cff45fee7014e862060d76ad4..33119317a6da246d837e834fa7dcba6eeea95e90 100644 (file)
@@ -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;
 }
index 1f8314f9aae55f12b20009dcd4d813762b3fc208..4daa470b4dcfe23156e357e2cfe43a0930d060b7 100644 (file)
@@ -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;
index 3b1a689872a34f986a74261627a4e9766d37674d..548e348316953199e0b95de6698683460bbd2a58 100644 (file)
@@ -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);
        }
 
index cecb99eb72bdaf8b7a02b44602505c147d68ce11..9b05f5b25b25bfb0766df402c82bde046445f874 100644 (file)
@@ -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 {
index a084adce1bff281a55afc6305d2cc0790d672594..11cab58e094e6e658b718090147f377f6598e8ef 100644 (file)
@@ -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)) {
index ec8cc22074dcf93e3e597925422023b8bdaa89e2..5ef64274e72702df86b716dc6bf6887acac06712 100644 (file)
@@ -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;
        }
 
index 76257bba45ed50160548c63fa818b809d8427a8d..2d6a3600f247da446a91ea43d67b2d4099fe47cd 100644 (file)
@@ -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);
                        
index f35fceebd6d80c28876eaff5b4176acf95c1de60..a3785b3621e28e28e1eaf42abd876b1a26c7f038 100644 (file)
@@ -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;
index fba8d13c6a5408b0850b896eeec0c69c7e2b3cc5..335bc2c9e563def2727b8259e2b8d03cbbeafe06 100644 (file)
@@ -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;
                                
index a8e769cc0d04fabf66be7d897f2411180d8f1786..57a77ae75b82206ded26d3d86947aa20b0452829 100644 (file)
@@ -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;
index 2a8c88720d58739f774419d1cc157f47c6636a33..37fd79e38e1450c8dfdf7d341ce44d4dc5053359 100644 (file)
@@ -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;
index 1cfbac887313cc9a57adf3aee19da2630db78cfa..8f9d6108e37a9080e53a9fb56ada4882ded56c0b 100644 (file)
@@ -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;
index b4d299a7aa10ee351f02aced25e1c5cef23800a8..5c821b532fbca04b402e91b25543c56b02b0f7c4 100644 (file)
@@ -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 */
 
index 01cf7a77e194db2aa9a1dd5bd9326f302563e028..105d08f237ff13bdabc92d4e2e9ff6f5b8ac3f87 100644 (file)
@@ -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);