Commit: 4401500cac4d3ff6e29d8ba4cbc476df49d88424
Author: Martin Felke
Date:   Sun Jan 11 17:35:46 2015 +0100
Branches: fracture_modifier
https://developer.blender.org/rB4401500cac4d3ff6e29d8ba4cbc476df49d88424

Merge remote-tracking branch 'refs/remotes/origin/master' into fracture_modifier

Conflicts:
        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_util.c

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



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

diff --cc source/blender/editors/space_outliner/outliner_draw.c
index d510cf0,a963f42..ca265cc
--- 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_Fracture:
 +                                              UI_icon_draw(x, y, 
ICON_MOD_EXPLODE); break;
                                        /* Default */
                                        case eModifierType_None:
                                        case eModifierType_ShapeKey:
diff --cc source/blender/makesdna/DNA_modifier_types.h
index 9514903,b1e9fd2..dcb054f
--- 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_Fracture          = 49,
+       eModifierType_DataTransfer      = 49,
++      eModifierType_Fracture          = 50,
        NUM_MODIFIER_TYPES
  } ModifierType;
  
@@@ -1400,102 -1367,48 +1401,145 @@@ enum 
        MOD_WIREFRAME_CREASE        = (1 << 5),
  };
  
 +enum {
 +      MOD_FRACTURE_BISECT_FAST      = (1 << 0),
 +      MOD_FRACTURE_BISECT_FAST_FILL = (1 << 1),
 +      MOD_FRACTURE_BOOLEAN          = (1 << 2),
 +      MOD_FRACTURE_BISECT_FILL      = (1 << 3),
 +      MOD_FRACTURE_BISECT           = (1 << 4),
 +};
 +
 +enum {
 +      MOD_FRACTURE_OWN_VERTS       = (1 << 0),
 +      MOD_FRACTURE_OWN_PARTICLES   = (1 << 1),
 +      MOD_FRACTURE_EXTRA_VERTS     = (1 << 2),
 +      MOD_FRACTURE_EXTRA_PARTICLES = (1 << 3),
 +      MOD_FRACTURE_GREASEPENCIL    = (1 << 4),
 +      MOD_FRACTURE_UNIFORM         = (1 << 5),
 +};
 +
 +enum {
 +      MOD_FRACTURE_SPLINTER_X      = (1 << 0),
 +      MOD_FRACTURE_SPLINTER_Y      = (1 << 1),
 +      MOD_FRACTURE_SPLINTER_Z      = (1 << 2),
 +};
 +
 +typedef struct FractureModifierData {
 +      ModifierData modifier;
 +      struct FracMesh *frac_mesh; /* store only the current fracmesh here 
first, later maybe an entire history...*/
 +      struct DerivedMesh *dm;
 +      struct Group *extra_group;
 +      struct Group *dm_group;
 +      struct BMesh *visible_mesh;
 +      struct DerivedMesh *visible_mesh_cached;
 +      ListBase meshIslands, meshConstraints;
 +      ListBase islandShards;
 +      char thresh_defgrp_name[64];  /* MAX_VGROUP_NAME */
 +      char ground_defgrp_name[64];  /* MAX_VGROUP_NAME */
 +      char inner_defgrp_name[64];  /* MAX_VGROUP_NAME */
 +      struct KDTree *nor_tree; /* store original vertices here (coords), to 
find them later and reuse their normals */
 +      struct Material *inner_material;
 +      struct GHash *face_pairs;
 +
 +      /* values */
 +      int frac_algorithm;
 +      int shard_count;
 +      int shard_id;
 +      int point_source;
 +      int point_seed;
 +      int percentage;
 +      int cluster_count;
 +
 +      int constraint_limit;
 +      int solver_iterations_override;
 +      int cluster_solver_iterations_override;
 +      int breaking_percentage;
 +      int cluster_breaking_percentage;
 +      int splinter_axis;
 +
 +      float breaking_angle;
 +      float breaking_distance;
 +      float cluster_breaking_angle;
 +      float cluster_breaking_distance;
 +      float origmat[4][4];
 +      float breaking_threshold;
 +      float cluster_breaking_threshold;
 +      float contact_dist, autohide_dist;
 +      float splinter_length;
 +      float nor_range;
 +
 +      /* flags */
 +      int refresh;
 +      int refresh_constraints;
 +      int refresh_autohide;
 +
 +      int use_constraints;
 +      int use_mass_dependent_thresholds;
 +      int use_particle_birth_coordinates;
 +      int use_breaking;
 +      int use_smooth;
 +
 +      int shards_to_islands;
 +      int execute_threaded;
 +      int fix_normals;
 +      int auto_execute;
 +
 +      int breaking_distance_weighted;
 +      int breaking_angle_weighted;
 +      int breaking_percentage_weighted;
 +
 +      /* internal flags */
 +      int use_experimental;
 +      int explo_shared;
 +      int refresh_images;
 +
 +      /* internal values */
 +      float max_vol;
 +
 +      //char pad[4];
 +} FractureModifierData;
  
+ 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,
+ };
+ 
+ 
  #endif  /* __DNA_MODIFIER_TYPES_H__ */
diff --cc source/blender/makesrna/intern/rna_modifier.c
index 081f06e,9780c45..ae0d7e6
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@@ -44,11 -43,15 +44,16 @@@
  #include "BLF_translation.h"
  
  #include "BKE_animsys.h"
+ #include "BKE_object_data_transfer.h"
+ #include "BKE_DerivedMesh.h"
  #include "BKE_dynamicpaint.h"
+ #include "BKE_mesh_mapping.h"
+ #include "BKE_mesh_remap.h"
  #include "BKE_multires.h"
  #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
 +#include "BKE_rigidbody.h"
  
+ #include "RNA_access.h"
  #include "RNA_define.h"
  #include "RNA_enum_types.h"
  
@@@ -250,8 -355,8 +360,10 @@@ static StructRNA *rna_Modifier_refine(s
                        return &RNA_LaplacianDeformModifier;
                case eModifierType_Wireframe:
                        return &RNA_WireframeModifier;
+               case eModifierType_DataTransfer:
+                       return &RNA_DataTransferModifier;
 +              case eModifierType_Fracture:
 +                      return &RNA_FractureModifier;
                /* Default */
                case eModifierType_None:
                case eModifierType_ShapeKey:
@@@ -3864,290 -4072,251 +4237,535 @@@ static void rna_def_modifier_wireframe(
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
  }
  
+ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
+ {
+       StructRNA *srna;
+       PropertyRNA *prop;
+ 
+       static EnumPropertyItem DT_layer_vert_items[] = {
+ #if 0  /* XXX When SkinModifier is enabled, it seems to erase its own 
CD_MVERT_SKIN layer from final DM :( */
+               {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin 
weights"},
+ #endif
+               {DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", 
"Transfer bevel weights"},
+               {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem DT_layer_vert_vgroup_items[] = {
+               {DT_TYPE_MDEFORMVERT, "VGROUP_WEIGHTS", 0, "Vertex Group(s)", 
"Transfer active or all vertex groups"},
+               {0, NULL, 0, NULL, NULL}
+       };
+ #if 0  /* XXX For now, would like to finish/merge work from 2014 gsoc first. 
*/
+       static EnumPropertyItem DT_layer_vert_shapekey_items[] = {
+               {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer 
active or all shape keys"},
+               {0, NULL, 0, NULL, NULL}
+       };
+ #endif
+ 
+       static EnumPropertyItem DT_layer_edge_items[] = {
+               {DT_TYPE_SHARP_EDGE, "SHARP_EDGE", 0, "Sharp", "Transfer sharp 
mark"},
+               {DT_TYPE_SEAM, "SEAM", 0, "UV Seam", "Transfer UV seam mark"},
+               {DT_TYPE_CREASE, "CREASE", 0, "Subsurf Crease", "Transfer 
crease values"},
+               {DT_TYPE_BWEIGHT_EDGE, "BEVEL_WEIGHT_EDGE", 0, "Bevel Weight", 
"Transfer bevel weights"},
+               {DT_TYPE_FREESTYLE_EDGE, "FREESTYLE_EDGE", 0, "Freestyle Mark", 
"Transfer Freestyle edge mark"},
+               {0, NULL, 0, NULL, NULL}
+       };
+ 
+       static EnumPropertyItem DT_layer_loop_items[] = {
+               {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem DT_layer_loop_vcol_items[] = {
+               {DT_TYPE_VCOL, "VCOL", 0, "VCol", "Vertex (face corners) 
colors"},
+               {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem DT_layer_loop_uv_items[] = {
+               {DT_TYPE_UV, "UV", 0, "UVs", "Transfer UV layers"},
+               {0, NULL, 0, NULL, NULL}
+       };
+ 
+       static EnumPropertyItem DT_layer_poly_items[] = {
+               {DT_TYPE_SHARP_FACE, "SMOOTH", 0, "Smooth", "Transfer 
flat/smooth mark"},
+               {DT_TYPE_FREESTYLE_FACE, "FREESTYLE_FACE", 0, "Freestyle Mark", 
"Transfer Freestyle face mark"},
+               {0, NULL, 0, NULL, NULL}
+       };
+ 
+       srna = RNA_def_struct(brna, "DataTransferModifier", "Modifier");
+       RNA_def_struct_ui_text(srna, "Data Transfer Modifier", "Modifier 
transferring some data from a source mesh");
+       RNA_def_struct_sdna(srna, "DataTransferModifierData");
+       RNA_def_struct_ui_icon(srna, ICON_MOD_DATA_TRANSFER);
+ 
+       prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "ob_source");
+       RNA_def_property_ui_text(prop, "Source Object", "Object to transfer 
data from");
+       RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
+       RNA_def_property_pointer_funcs(prop, NULL, 
"rna_DataTransferModifier_ob_source_set", NULL, "rna_Mesh_object_poll");
+       RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
+ 
+       prop = RNA_def_boolean(srna, "use_object_transform", true, "Object 
Transform",
+                              "Evaluate source and destination meshes in their 
respective object spaces");
+       RNA_def_property_boolean_sdna(prop, NULL, "flags", 
MOD_DATATRANSFER_OBSRC_TRANSFORM);
+       RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ 
+       /* Generic, UI-only data types toggles. */
+       prop = RNA_def_boolean(srna, "use_vert_data", false, "Vertex Data", 
"Enable vertex data transfer");
+       RNA_def_property_boolean_sdna(prop, NULL, "flags", 
MOD_DATATRANSFER_USE_VERT);
+       RNA_def_property_update(prop, 0, 
"rna_DataTransferModifier_use_data_update");
+ 
+       prop = RNA_def_boolean(srna, "use_edge_data", false, "Edge Data", 
"Enable edge data transfer");
+       RNA_def_property_boolean_sdna(

@@ 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