One visit to studio orange, and voila a todo list!
authorTon Roosendaal <ton@blender.org>
Thu, 17 Nov 2005 18:01:07 +0000 (18:01 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 17 Nov 2005 18:01:07 +0000 (18:01 +0000)
- bug: posemode, bones were drawing names and axes even when hidden
- bug: using softbody guides actually worked on themselves, causing
  an infinite loop
- feature: when a pose/bone is completely locked for transform, a grab
  will change into rotate by default.

source/blender/blenkernel/BKE_effect.h
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/softbody.c
source/blender/makesdna/DNA_object_types.h
source/blender/src/drawarmature.c
source/blender/src/transform_conversions.c

index 9ebafdff3e474ed92b06aba55ff2c921dd95400f..c68d4b8b10e57f33c61945ac3f1398ffc7f1abb1 100644 (file)
@@ -57,7 +57,7 @@ void build_particle_system(struct Object *ob);
 /* particle deflector */
 #define PE_WIND_AS_SPEED 0x00000001
 
-struct ListBase *pdInitEffectors(unsigned int layer);
+struct ListBase *pdInitEffectors(struct Object *ob);
 void                   pdEndEffectors(struct ListBase *lb);
 void                   pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags);
 
index dd759ea035baa5d2e4c6f3568cb6872bbe23416d..021f0c7dc63d10ec35f1ddeed2fe0f9e5dbc5940 100644 (file)
@@ -324,18 +324,19 @@ typedef struct pEffectorCache {
 
 
 /* returns ListBase handle with objects taking part in the effecting */
-ListBase *pdInitEffectors(unsigned int layer)
+ListBase *pdInitEffectors(Object *obsrc)
 {
        static ListBase listb={NULL, NULL};
+       unsigned int layer= obsrc->lay;
        Base *base;
 
        for(base = G.scene->base.first; base; base= base->next) {
-               if( (base->lay & layer) && base->object->pd) {
+               if( (base->lay & layer) && base->object->pd && base->object!=obsrc) {
                        Object *ob= base->object;
                        PartDeflect *pd= ob->pd;
                        
                        if(pd->forcefield == PFIELD_GUIDE) {
-                               if(ob->type==OB_CURVE) {
+                               if(ob->type==OB_CURVE && obsrc->type==OB_MESH) {        /* guides only do mesh particles */
                                        Curve *cu= ob->data;
                                        if(cu->flag & CU_PATH) {
                                                if(cu->path==NULL || cu->path->data==NULL)
@@ -1647,7 +1648,7 @@ void build_particle_system(Object *ob)
        }
        
        /* get the effectors */
-       effectorbase= pdInitEffectors(ob->lay);
+       effectorbase= pdInitEffectors(ob);
        
        /* init geometry, return is 6 x float * me->totvert in size */
        vertexcosnos= (VeNoCo *)mesh_get_mapped_verts_nors(ob);
index 418751839ec661d7a47157bbb4a39e0623c783af..e45368a1f4a689b1be4e255b4ea30d6abf0e5059 100644 (file)
@@ -542,7 +542,7 @@ static void softbody_calc_forces(Object *ob, float forcetime)
        
        /* check! */
        do_deflector= is_there_deflection(ob->lay);
-       do_effector= pdInitEffectors(ob->lay);
+       do_effector= pdInitEffectors(ob);
        
        iks  = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
        bproot= sb->bpoint; /* need this for proper spring addressing */
index 4a9a4bf1784cddfb2a76db35bfb5d138d2da48a8..1d16015a628e63c2be77b196fd7de5c1ae96028a 100644 (file)
@@ -393,6 +393,7 @@ extern Object workob;
 #define OB_LOCK_LOCX   1
 #define OB_LOCK_LOCY   2
 #define OB_LOCK_LOCZ   4
+#define OB_LOCK_LOC            7
 #define OB_LOCK_ROTX   8
 #define OB_LOCK_ROTY   16
 #define OB_LOCK_ROTZ   32
index fc02d18c655ce6029932ea786381cd7b4062ef50..8834fa525146309aae3d4f33dd237bf022a58938 100644 (file)
@@ -1467,27 +1467,28 @@ static void draw_pose_channels(Base *base, int dt)
                        if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
                        
                        for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
-                       
-                               if (arm->flag & (ARM_EDITMODE|ARM_POSEMODE)) {
-                                       bone= pchan->bone;
-                                       if(bone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI);
-                                       else BIF_ThemeColor(TH_TEXT);
-                               }
-                               else if(dt > OB_WIRE) BIF_ThemeColor(TH_TEXT);
-                               
-                               if (arm->flag & ARM_DRAWNAMES){
-                                       VecMidf(vec, pchan->pose_head, pchan->pose_tail);
-                                       glRasterPos3fv(vec);
-                                       BMF_DrawString(G.font, " ");
-                                       BMF_DrawString(G.font, pchan->name);
-                               }                               
-                               /*      Draw additional axes */
-                               if( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ){
-                                       glPushMatrix();
-                                       glMultMatrixf(pchan->pose_mat);
-                                       glTranslatef(0.0f, pchan->bone->length, 0.0f);
-                                       drawaxes(0.25f*pchan->bone->length);
-                                       glPopMatrix();
+                               if((pchan->bone->flag & BONE_HIDDEN_P)==0) {
+                                       if (arm->flag & (ARM_EDITMODE|ARM_POSEMODE)) {
+                                               bone= pchan->bone;
+                                               if(bone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI);
+                                               else BIF_ThemeColor(TH_TEXT);
+                                       }
+                                       else if(dt > OB_WIRE) BIF_ThemeColor(TH_TEXT);
+                                       
+                                       if (arm->flag & ARM_DRAWNAMES){
+                                               VecMidf(vec, pchan->pose_head, pchan->pose_tail);
+                                               glRasterPos3fv(vec);
+                                               BMF_DrawString(G.font, " ");
+                                               BMF_DrawString(G.font, pchan->name);
+                                       }                               
+                                       /*      Draw additional axes */
+                                       if( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ){
+                                               glPushMatrix();
+                                               glMultMatrixf(pchan->pose_mat);
+                                               glTranslatef(0.0f, pchan->bone->length, 0.0f);
+                                               drawaxes(0.25f*pchan->bone->length);
+                                               glPopMatrix();
+                                       }
                                }
                        }
                        
index 4d5489486d9d3d7b7ee04bd2e9dd879c99862de5..4cadac896277cef394a60443e662cbfc7472a4f1 100755 (executable)
@@ -642,10 +642,11 @@ static void set_pose_transflags(TransInfo *t, Object *ob)
                        t->total++;
                        
                        if(t->mode==TFM_TRANSLATION) {
-                               if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
-                                       if( has_targetless_ik(pchan)==NULL ) {
+                               if( has_targetless_ik(pchan)==NULL ) {
+                                       if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED))
+                                               t->mode= TFM_ROTATION;
+                                       else if((pchan->protectflag & OB_LOCK_LOC)==OB_LOCK_LOC)
                                                t->mode= TFM_ROTATION;
-                                       }
                                }
                        }
                }