Orange; merger with bf-blender.
authorTon Roosendaal <ton@blender.org>
Tue, 3 Jan 2006 21:43:31 +0000 (21:43 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 3 Jan 2006 21:43:31 +0000 (21:43 +0000)
(Merging is *not* fun work, especially not with bugfixes in main branch
for code that got cleaned up in the other! Poor Hos... :)

26 files changed:
1  2 
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenloader/intern/readfile.c
source/blender/include/BIF_editarmature.h
source/blender/include/BIF_meshtools.h
source/blender/include/BIF_space.h
source/blender/python/api2_2x/Armature.c
source/blender/python/api2_2x/Object.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/texture.c
source/blender/src/buttons_editing.c
source/blender/src/buttons_shading.c
source/blender/src/drawobject.c
source/blender/src/drawoops.c
source/blender/src/edit.c
source/blender/src/editarmature.c
source/blender/src/editmesh.c
source/blender/src/editmesh_mods.c
source/blender/src/editmesh_tools.c
source/blender/src/editobject.c
source/blender/src/header_ipo.c
source/blender/src/header_view3d.c
source/blender/src/meshtools.c
source/blender/src/renderwin.c
source/blender/src/space.c
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h

index 090c1c718846100121b1001c29b5309ae71dace7,7f5f6fbaddfd7d5c2f6eb839bdb63de07769da7e..ae187c0e0f7f81543e194a35a7addae6d92d4673
@@@ -1546,91 -1502,6 +1546,99 @@@ static int exists_channel(Object *ob, c
        return 0;
  }
  
-       else if(ob->constraints.first) ob->recalc |= OB_RECALC_OB;
 +static void dag_object_time_update_flags(Object *ob)
 +{
 +      
 +      if(ob->ipo) ob->recalc |= OB_RECALC_OB;
++      else if(ob->constraints.first) {
++              bConstraint *con;
++              for (con = ob->constraints.first; con; con=con->next){
++                      if (constraint_has_target(con)) {
++                              ob->recalc |= OB_RECALC_OB;
++                              break;
++                      }
++              }
++      }
 +      else if(ob->scriptlink.totscript) ob->recalc |= OB_RECALC_OB;
 +      else if(ob->parent) {
 +              /* motion path or bone child */
 +              if(ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB;
 +      }
 +      
 +      if(ob->action || ob->nlastrips.first) {
 +              /* since actions now are mixed, we set the recalcs on the safe side */
 +              ob->recalc |= OB_RECALC_OB;
 +              if(ob->type==OB_ARMATURE)
 +                      ob->recalc |= OB_RECALC_DATA;
 +              else if(exists_channel(ob, "Shape"))
 +                      ob->recalc |= OB_RECALC_DATA;
 +              else if(ob->dup_group) {
 +                      bActionStrip *strip;
 +                      /* this case is for groups with nla, whilst nla target has no action or nla */
 +                      for(strip= ob->nlastrips.first; strip; strip= strip->next) {
 +                              if(strip->object)
 +                                      strip->object->recalc |= OB_RECALC;
 +                      }
 +              }
 +      }
 +      else if(modifiers_isSoftbodyEnabled(ob)) ob->recalc |= OB_RECALC_DATA;
 +      else if(object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
 +      else {
 +              Mesh *me;
 +              Curve *cu;
 +              Lattice *lt;
 +              
 +              switch(ob->type) {
 +                      case OB_MESH:
 +                              me= ob->data;
 +                              if(me->key) {
 +                                      if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
 +                                              ob->recalc |= OB_RECALC_DATA;
 +                                              ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
 +                                      }
 +                              }
 +                              else if(ob->effect.first) {
 +                                      Effect *eff= ob->effect.first;
 +                                      PartEff *paf= give_parteff(ob);
 +                                      
 +                                      if(eff->type==EFF_WAVE) 
 +                                              ob->recalc |= OB_RECALC_DATA;
 +                                      if(paf && paf->keys==NULL)
 +                                              ob->recalc |= OB_RECALC_DATA;
 +                              }
 +                              if((ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings)) {
 +                                      // fluidsimSettings might not be initialized during load...
 +                                      if(ob->fluidsimSettings->type & OB_FLUIDSIM_DOMAIN) {
 +                                              ob->recalc |= OB_RECALC_DATA; // NT
 +                                      }
 +                              }
 +                              break;
 +                      case OB_CURVE:
 +                      case OB_SURF:
 +                              cu= ob->data;
 +                              if(cu->key) {
 +                                      if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
 +                                              ob->recalc |= OB_RECALC_DATA;
 +                                              ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
 +                                      }
 +                              }
 +                                      break;
 +                      case OB_LATTICE:
 +                              lt= ob->data;
 +                              if(lt->key) {
 +                                      if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
 +                                              ob->recalc |= OB_RECALC_DATA;
 +                                              ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
 +                                      }
 +                              }
 +                                      break;
 +                      case OB_MBALL:
 +                              if(ob->transflag & OB_DUPLI) ob->recalc |= OB_RECALC_DATA;
 +                              break;
 +              }
 +      }               
 +}
 +
  /* flag all objects that need recalc, for changes in time for example */
  void DAG_scene_update_flags(Scene *sce, unsigned int lay)
  {
index 970d0306fd67ee22349bde2b7c00a814b3846e45,96737509092c14c6bb62e23a5267b8739ea554aa..5095cc428364f202bdf92832ab05e83f142a130b
@@@ -5221,12 -5084,11 +5221,7 @@@ static void do_versions(FileData *fd, L
                                ma->strand_sta= ma->strand_end= 1.0f;
                                ma->mode |= MA_TANGENT_STR;
                        }
 -                      /* remove this test before 2.41! pad is set to denote check was done */
 -                      if(ma->pad==0) {
 -                              if(ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
 -                              ma->pad= 1;
 -                      }
 +                      if(ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
-                       /* orange stuff, so should be done for 2.40 too */
-                       if(ma->layers.first==NULL) {
-                               ma->ml_flag= ML_RENDER;
-                       }
                }
        }
        
index 8df5e7255a5e8cc38e5643bfecff9ef21ce94a6c,a0ee42081bd897ef46a05bfa9cb7d515fae00f83..e926d41faf141e3cd13b1abb27daf98631836cda
@@@ -34,9 -34,8 +34,9 @@@
  #define BIF_MESHTOOLS_H
  
  struct Object;
 +struct EditVert;
  
- extern void join_mesh(void);
+ extern int join_mesh(void);
  
  extern void fasterdraw(void);
  extern void slowerdraw(void);
index 7970ed5e41ddd0b3eb52ed94da1aff6675a060b4,189adc0a20ae563bec70616d86c2a7f9906c74d9..8213192a2ae2e90d23aa920aae9ddba78f173940
@@@ -114,7 -114,9 +114,8 @@@ extern       void newspace(struct ScrAr
  extern       void set_rects_butspace(struct SpaceButs *buts);
  extern       void test_butspace(void);
  extern       void start_game(void);
 -extern                 void select_group_menu(void);
 +extern                 void select_grouped(short nr);
+ extern                 void join_menu(void);
 -extern                 void select_group(short nr);
  
  extern                void BIF_undo_push(char *str);
  extern                void BIF_undo(void);
index f74a0a176e4f16fdc036956ab808bb624ab92036,2a011448db5cc5a19a30450a9f0c3cd6e88fabb4..af945ea09c060fe4a3e1ea41c99b982adfff40aa
@@@ -62,20 -59,20 +62,24 @@@ struct rctf
  #include "BKE_curve.h"
  #include "BKE_global.h"
  #include "BKE_main.h"
 -#include "BIF_editview.h"
+ #include "BKE_scene.h"
 +
  #include "BSE_editipo.h"
  #include "BSE_edit.h"
 +
  #include "BIF_space.h"
 -#include "DNA_oops_types.h" 
 +#include "BIF_editview.h"
+ #include "BIF_drawscene.h"
+ #include "BIF_meshtools.h"
+ #include "BIF_editarmature.h"
 +
  #include "BLI_arithb.h"
  #include "BLI_blenlib.h"
 +
  #include "BDR_editobject.h"
 -#include "BDR_editcurve.h"
 +
  #include "MEM_guardedalloc.h"
 +
  #include "mydevice.h"
  #include "blendef.h"
  #include "Scene.h"
index 518ab581efc938b647678d3d2307e411a6ffe394,9ea621fdfceaabd0ec66df0d3d0244bd942095fd..b3d053b3f34ac603564c71bb8641a0663bd1b199
@@@ -1667,28 -1720,23 +1712,37 @@@ void do_material_tex(ShadeInput *shi
                                                fact= Tnor*tex->norfac;
                                                if(fact>1.0) fact= 1.0; else if(fact<-1.0) fact= -1.0;
                                                facm= 1.0- fact;
 -                                              shi->vn[0]= facm*shi->vn[0] + fact*texres.nor[0];
 -                                              shi->vn[1]= facm*shi->vn[1] + fact*texres.nor[1];
 -                                              shi->vn[2]= facm*shi->vn[2] + fact*texres.nor[2];
 +                                              if(shi->mat->mode & MA_TANGENT_V) {
 +                                                      shi->tang[0]= facm*shi->tang[0] + fact*texres.nor[0];
 +                                                      shi->tang[1]= facm*shi->tang[1] + fact*texres.nor[1];
 +                                                      shi->tang[2]= facm*shi->tang[2] + fact*texres.nor[2];
 +                                              }
 +                                              else {
 +                                                      shi->vn[0]= facm*shi->vn[0] + fact*texres.nor[0];
 +                                                      shi->vn[1]= facm*shi->vn[1] + fact*texres.nor[1];
 +                                                      shi->vn[2]= facm*shi->vn[2] + fact*texres.nor[2];
 +                                              }
                                        }
                                        else {
 -                                              float nor[3], dot;
 -                                              
 -                                              /* prevent bump to become negative normal */
 -                                              nor[0]= Tnor*tex->norfac*texres.nor[0];
 -                                              nor[1]= Tnor*tex->norfac*texres.nor[1];
 -                                              nor[2]= Tnor*tex->norfac*texres.nor[2];
 -                                              
 -                                              dot= 0.5f + 0.5f*INPR(nor, shi->vn);
 +                                              if(shi->mat->mode & MA_TANGENT_V) {
 +                                                      shi->tang[0]+= Tnor*tex->norfac*texres.nor[0];
 +                                                      shi->tang[1]+= Tnor*tex->norfac*texres.nor[1];
 +                                                      shi->tang[2]+= Tnor*tex->norfac*texres.nor[2];
 +                                              }
 +                                              else {
-                                                       shi->vn[0]+= Tnor*tex->norfac*texres.nor[0];
-                                                       shi->vn[1]+= Tnor*tex->norfac*texres.nor[1];
-                                                       shi->vn[2]+= Tnor*tex->norfac*texres.nor[2];
++                                                      float nor[3], dot;
+                                               
 -                                              shi->vn[0]+= dot*nor[0];
 -                                              shi->vn[1]+= dot*nor[1];
 -                                              shi->vn[2]+= dot*nor[2];
++                                                      /* prevent bump to become negative normal */
++                                                      nor[0]= Tnor*tex->norfac*texres.nor[0];
++                                                      nor[1]= Tnor*tex->norfac*texres.nor[1];
++                                                      nor[2]= Tnor*tex->norfac*texres.nor[2];
++                                                      
++                                                      dot= 0.5f + 0.5f*INPR(nor, shi->vn);
++                                                      
++                                                      shi->vn[0]+= dot*nor[0];
++                                                      shi->vn[1]+= dot*nor[1];
++                                                      shi->vn[2]+= dot*nor[2];
 +                                              }
                                        }                                       
                                        Normalise(shi->vn);
                                        
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b2b091f572b2f52dc17270768d29a15e85ed0bf1,3325d78eb13b387b412cd67ea568bb89808ebdc1..4fdc764bc763b516219421ee7ec8ea93fcd47c6a
@@@ -621,10 -595,60 +621,30 @@@ static void select_grouped_menu(void
        nr= pupmenu(str);
        MEM_freeN(str);
        
 -      select_group(nr);
 +      select_grouped(nr);
  }
  
+ void join_menu(void)
+ {
+       Object *ob= OBACT;
+       if (ob && !G.obedit) {
+               if(ob->type == OB_MESH) {
+                       if(okee("Join selected meshes")==0) return;
+                       join_mesh();
+               } else if(ob->type == OB_CURVE) {
+                       if(okee("Join selected curves")==0) return;
+                       join_curve(OB_CURVE);
+               } else if(ob->type == OB_SURF) {
+                       if(okee("Join selected NURBS")==0) return;
+                       join_curve(OB_SURF);
+               } else if(ob->type == OB_ARMATURE) {
+                       /*      Make sure the user wants to continue*/
+                       if(okee("Join selected armatures")==0) return;
+                       join_armature ();
+               }
+       }
+ }
  
 -void select_group(short nr)
 -{
 -      Base *base;
 -
 -      if(nr==4) {
 -              base= FIRSTBASE;
 -              while(base) {
 -                      if (base->lay & OBACT->lay) {
 -                              base->flag |= SELECT;
 -                              base->object->flag |= SELECT;
 -                      }
 -                      base= base->next;
 -              }               
 -      }
 -      else if(nr==2) select_children(OBACT, 0);
 -      else if(nr==1) select_children(OBACT, 1);
 -      else if(nr==3) select_parent();
 -      
 -      countall();
 -      allqueue(REDRAWVIEW3D, 0);
 -      allqueue(REDRAWBUTSOBJECT, 0);
 -      allspace(REMAKEIPO, 0);
 -      allqueue(REDRAWIPO, 0);
 -}
 -
 -
 -
 -
 -
 -
  static unsigned short convert_for_nonumpad(unsigned short event)
  {
        if (event>=ZEROKEY && event<=NINEKEY) {