Commit: 6cd3ebfc9fa4838a74192f2e5cc82b5d5d2e6fe7
Author: Lukas Tönne
Date:   Fri Jan 16 12:50:11 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB6cd3ebfc9fa4838a74192f2e5cc82b5d5d2e6fe7

Merge branch 'master' into alembic_pointcache

Conflicts:
        release/scripts/addons
        source/blender/blenkernel/intern/pointcache.c
        source/blender/blenloader/intern/versioning_270.c
        source/blender/editors/space_outliner/outliner_draw.c
        source/blender/makesdna/DNA_modifier_types.h
        source/blender/makesrna/intern/rna_modifier.c
        source/blender/modifiers/MOD_modifiertypes.h
        source/blender/modifiers/intern/MOD_collision.c
        source/blender/modifiers/intern/MOD_util.c

===================================================================



===================================================================

diff --cc build_files/scons/tools/Blender.py
index d9e80a1,eb2e57a..1ab3635
mode 100755,100644..100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
diff --cc source/blender/blenkernel/CMakeLists.txt
index 353a389,c71595e..328c465
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -36,8 -36,8 +36,9 @@@ set(IN
        ../bmesh
        ../modifiers
        ../nodes
 +      ../pointcache
        ../render/extern/include
+       ../../../intern/ghost
        ../../../intern/guardedalloc
        ../../../intern/glew-mx
        ../../../intern/iksolver/extern
diff --cc source/blender/blenkernel/intern/pointcache.c
index c2f71d7,19ed49c..7530147
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@@ -2493,41 -2568,50 +2493,48 @@@ void BKE_ptcache_id_clear(PTCacheID *pi
        case PTCACHE_CLEAR_ALL:
        case PTCACHE_CLEAR_BEFORE:
        case PTCACHE_CLEAR_AFTER:
 -              if (pid->cache->flag & PTCACHE_DISK_CACHE) {
 -                      ptcache_path(pid, path);
 -                      
 -                      dir = opendir(path);
 -                      if (dir==NULL)
 -                              return;
 -                      
 -                      len = ptcache_filename(pid, filename, cfra, 0, 0); /* 
no path */
 -                      /* append underscore terminator to ensure we don't 
match similar names
 -                       * from objects whose names start with the same prefix
 -                       */
 -                      if (len < sizeof(filename) - 2) {
 -                              BLI_strncpy(filename + len, "_", 
sizeof(filename) - 2 - len);
 -                              len += 1;
 -                      }
 -                      
 -                      BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, 
pid->stack_index);
 +              ptcache_path(pid->cache, pid->ob, path);
 +              
-               len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
-               
 +              dir = opendir(path);
 +              if (dir==NULL)
 +                      return;
+                       
 -                      while ((de = readdir(dir)) != NULL) {
 -                              if (strstr(de->d_name, ext)) { /* do we have 
the right extension?*/
 -                                      if (strncmp(filename, de->d_name, len ) 
== 0) { /* do we have the right prefix */
 -                                              if (mode == PTCACHE_CLEAR_ALL) {
 -                                                      pid->cache->last_exact 
= MIN2(pid->cache->startframe, 0);
 -                                                      
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
 -                                                      BLI_delete(path_full, 
false, false);
 -                                              }
 -                                              else {
 -                                                      /* read the number of 
the file */
 -                                                      unsigned int frame, 
len2 = (int)strlen(de->d_name);
 -                                                      char num[7];
 -
 -                                                      if (len2 > 15) { /* 
could crash if trying to copy a string out of this range*/
 -                                                              
BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num));
 -                                                              frame = 
atoi(num);
++              len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
++              /* append underscore terminator to ensure we don't match 
similar names
++               * from objects whose names start with the same prefix
++               */
++              if (len < sizeof(filename) - 2) {
++                      BLI_strncpy(filename + len, "_", sizeof(filename) - 2 - 
len);
++                      len += 1;
++              }
 +              
 +              BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, 
pid->stack_index);
 +              
 +              while ((de = readdir(dir)) != NULL) {
 +                      if (strstr(de->d_name, ext)) { /* do we have the right 
extension?*/
 +                              if (strncmp(filename, de->d_name, len ) == 0) { 
/* do we have the right prefix */
 +                                      if (mode == PTCACHE_CLEAR_ALL) {
 +                                              pid->cache->state.last_exact = 
MIN2(pid->cache->startframe, 0);
 +                                              BLI_join_dirfile(path_full, 
sizeof(path_full), path, de->d_name);
 +                                              BLI_delete(path_full, false, 
false);
 +                                      }
 +                                      else {
 +                                              /* read the number of the file 
*/
 +                                              unsigned int frame, len2 = 
(int)strlen(de->d_name);
 +                                              char num[7];
 +                                              
 +                                              if (len2 > 15) { /* could crash 
if trying to copy a string out of this range*/
 +                                                      BLI_strncpy(num, 
de->d_name + (strlen(de->d_name) - 15), sizeof(num));
 +                                                      frame = atoi(num);
 +                                                      
 +                                                      if ((mode == 
PTCACHE_CLEAR_BEFORE && frame < cfra) ||
 +                                                          (mode == 
PTCACHE_CLEAR_AFTER && frame > cfra))
 +                                                      {
                                                                
 -                                                              if ((mode == 
PTCACHE_CLEAR_BEFORE && frame < cfra) ||
 -                                                                  (mode == 
PTCACHE_CLEAR_AFTER && frame > cfra))
 -                                                              {
 -                                                                      
 -                                                                      
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
 -                                                                      
BLI_delete(path_full, false, false);
 -                                                                      if 
(pid->cache->cached_frames && frame >=sta && frame <= end)
 -                                                                              
pid->cache->cached_frames[frame-sta] = 0;
 -                                                              }
 +                                                              
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
 +                                                              
BLI_delete(path_full, false, false);
 +                                                              if 
(pid->cache->state.cached_frames && frame >=sta && frame <= end)
 +                                                                      
pid->cache->state.cached_frames[frame-sta] = 0;
                                                        }
                                                }
                                        }
diff --cc source/blender/blenloader/intern/versioning_270.c
index 37ad216,e6e4375..0ff953e
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -54,14 -49,11 +54,12 @@@
  
  #include "DNA_genfile.h"
  
- #include "BLI_blenlib.h"
- #include "BLI_math.h"
- 
  #include "BKE_main.h"
  #include "BKE_node.h"
 +#include "BKE_pointcache.h"
  
  #include "BLI_math.h"
+ #include "BLI_listbase.h"
  #include "BLI_string.h"
  
  #include "BLO_readfile.h"
@@@ -465,51 -435,27 +463,74 @@@ void blo_do_versions_270(FileData *fd, 
                        }
                }
        }
 +      
 +      /* memcache has been removed, clear BAKED flags to enforce rebaking */
 +      if (!PTCACHE_DO_VERSIONS(main)) {
 +              Object *ob;
 +              Scene *sce;
 +              for (ob = main->object.first; ob; ob = ob->id.next) {
 +                      ModifierData *md;
 +                      ParticleSystem *psys;
 +                      for (md = ob->modifiers.first; md; md = md->next) {
 +                              if (md->type == eModifierType_Fluidsim) {
 +                                      FluidsimModifierData *fluidmd = 
(FluidsimModifierData *)md;
 +                                      do_versions_pointcache(&ob->id, 
fluidmd->point_cache);
 +                              }
 +                              else if (md->type == eModifierType_Smoke) {
 +                                      SmokeModifierData *smd = 
(SmokeModifierData *)md;
 +                                      if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
 +                                              do_versions_pointcache(&ob->id, 
smd->domain->point_cache[0]);
 +                                      }
 +                              }
 +                              else if (md->type == eModifierType_Cloth) {
 +                                      ClothModifierData *clmd = 
(ClothModifierData *) md;
 +                                      do_versions_pointcache(&ob->id, 
clmd->point_cache);
 +                              }
 +                              else if (md->type == 
eModifierType_DynamicPaint) {
 +                                      DynamicPaintModifierData *pmd = 
(DynamicPaintModifierData *)md;
 +                                      if (pmd->canvas) {
 +                                              DynamicPaintSurface *surface;
 +                                              for 
(surface=pmd->canvas->surfaces.first; surface; surface=surface->next)
 +                                                      
do_versions_pointcache(&ob->id, surface->pointcache);
 +                                      }
 +                              }
 +                      }
 +                      
 +                      if (ob->soft) {
 +                              do_versions_pointcache(&ob->id, 
ob->soft->pointcache);
 +                      }
 +                      
 +                      for (psys = ob->particlesystem.first; psys; psys = 
psys->next) {
 +                              do_versions_pointcache(&ob->id, 
psys->pointcache);
 +                      }
 +              }
 +              for (sce = main->scene.first; sce; sce = sce->id.next) {
 +                      RigidBodyWorld *rbw = sce->rigidbody_world;
 +                      if (rbw)
 +                              do_versions_pointcache(&sce->id, 
rbw->pointcache);
 +              }
 +      }
+ 
+       if (!MAIN_VERSION_ATLEAST(main, 273, 1)) {
+ #define       BRUSH_RAKE (1 << 7)
+ #define BRUSH_RANDOM_ROTATION (1 << 25)
+ 
+               Brush *br;
+ 
+               for (br = main->brush.first; br; br = br->id.next) {
+                       if (br->flag & BRUSH_RAKE) {
+                               br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
+                               br->mask_mtex.brush_angle_mode |= 
MTEX_ANGLE_RAKE;
+                       }
+                       else if (br->flag & BRUSH_RANDOM_ROTATION) {
+                               br->mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
+                               br->mask_mtex.brush_angle_mode |= 
MTEX_ANGLE_RANDOM;
+                       }
+                       br->mtex.random_angle = 2.0f * M_PI;
+                       br->mask_mtex.random_angle = 2.0f * M_PI;
+               }
+ 
+ #undef BRUSH_RAKE
+ #undef BRUSH_RANDOM_ROTATION
+       }
  }
diff --cc source/blender/editors/space_outliner/outliner_draw.c
index 61c4fe3,a963f42..9bc043b3
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@@ -1018,8 -1018,8 +1018,10 @@@ static void tselem_draw_icon(uiBlock *b
                                                UI_icon_draw(x, y, 
ICON_MOD_WIREFRAME); break;
                                        case eModifierType_LaplacianDeform:
                                                UI_icon_draw(x, y, 
ICON_MOD_MESHDEFORM); break;  /* XXX, needs own icon */
+                                       case eModifierType_DataTransfer:
+                                               UI_icon_draw(x, y, 
ICON_MOD_DATA_TRANSFER); break;
 +                                      case eModifierType_PointCache:
 +                                              UI_icon_draw(x, y, 
ICON_MOD_MESHDEFORM); break;  /* XXX, needs own icon */
                                        /* Default */
                                        case eModifierType_None:
                                        case eModifierType_ShapeKey:
diff --cc source/blender/makesdna/DNA_modifier_types.h
index 5ab82f8,b1e9fd2..7b1a9bb
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@@ -82,7 -82,7 +82,8 @@@ typedef enum ModifierType 
        eModifierType_MeshCache         = 46,
        eModifierType_LaplacianDeform   = 47,
        eModifierType_Wireframe         = 48,
-       eModifierType_PointCache        = 49,
+       eModifierType_DataTransfer      = 49,
++      eModifierType_PointCache        = 50,
        NUM_MODIFIER_TYPES
  } ModifierType;
  
@@@ -1367,19 -1367,48 +1368,62 @@@ enum 
        MOD_WIREFRAME_CREASE        = (1 << 5),
  };
  
+ 
+ typedef struct DataTransferModifierData {
+       ModifierData modifier;
+ 
+       struct Object *ob_source;
+ 
+       int data_types;  /* See DT_TYPE_ enum in ED_object.h */
+ 
+       /* See MREMAP_MODE_ enum in BKE_mesh_mapping.h */
+       int vmap_mode;
+       int emap_mode;
+       int lmap_mode;
+       int pmap_mode;
+ 
+       float map_max_distance;
+       float map_ray_radius;
+       float islands_precision;
+ 
+       int pad_i1;
+ 
+       int layers_select_src[4];  /* DT_MULTILAYER_INDEX_MAX; See 
DT_FROMLAYERS_ enum in ED_object.h */
+       int layers_select_dst[4];  /* DT_MULTILAYER_INDEX_MAX; See DT_TOLAYERS_ 
enum in ED_object.h */
+ 
+       int mix_mode;  /* See CDT_MIX_ enum in BKE_customdata.h */
+       float mix_factor;
+       char defgrp_name[64];  /* MAX_VGROUP_NAME */
+ 
+       int flags;
+ } DataTransferModifierData;
+ 
+ /* DataTransferModifierData.flags */
+ enum {
+       MOD_DATATRANSFER_OBSRC_TRANSFORM  = 1 << 0,
+       MOD_DATATRANSFER_MAP_MAXDIST      = 1 << 1,
+       MOD_DATATRANSFER_INVERT_VGROUP    = 1 << 2,
+ 
+       /* Only for UI really. */
+       MOD_DATATRANSFER_USE_VERT         = 1 << 28,
+       MOD_DATATRANSFER_USE_EDGE         = 1 << 29,
+       MOD_DATATRANSFER_USE_LOOP         = 1 << 30,
+       MOD_DATATRANSFER_USE_POLY         = 1 << 31,
+ };
+ 
 +/* point cache modifier */
 +typedef struct PointCacheModifierData {
 +      ModifierData m

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to