Paste Code
Paste Blends
Paste Images
Index: release/scripts/ui/properties_physics_common.py
===================================================================
--- release/scripts/ui/properties_physics_common.py (revision 33442)
+++ release/scripts/ui/properties_physics_common.py (working copy)
@@ -204,6 +204,10 @@
col.prop(field, "z_direction", text="")
col.prop(field, "use_min_distance", text="Use Minimum")
col.prop(field, "use_max_distance", text="Use Maximum")
+ if field.type == 'VORTEX':
+ col.prop(field, "use_rotation", text="Use Rotation")
+
+

col = split.column()
col.prop(field, "falloff_power", text="Power")
Index: source/blender/blenkernel/intern/effect.c
===================================================================
--- source/blender/blenkernel/intern/effect.c (revision 33442)
+++ source/blender/blenkernel/intern/effect.c (working copy)
@@ -651,7 +651,15 @@
//}

VECCOPY(efd->loc, state.co);
- VECCOPY(efd->nor, state.vel);
+
+ if (eff->pd->flag & PFIELD_USEROT) {
+ efd->nor[0] = state.rot[1];
+ efd->nor[1] = state.rot[3]; /* flip y for z in order to get a better visual rotation axis */
+ efd->nor[2] = state.rot[2];
+ }else {
+ VECCOPY(efd->nor, state.vel);
+ }
+
if(real_velocity) {
VECCOPY(efd->vel, state.vel);
}
Index: source/blender/makesdna/DNA_object_force.h
===================================================================
--- source/blender/makesdna/DNA_object_force.h (revision 33442)
+++ source/blender/makesdna/DNA_object_force.h (working copy)
@@ -335,6 +335,7 @@
#define PFIELD_DO_LOCATION (1<<14)
#define PFIELD_DO_ROTATION (1<<15)
#define PFIELD_GUIDE_PATH_WEIGHT (1<<16) /* apply curve weights */
+#define PFIELD_USEROT (1<<17) /* use rotation as the vortex vector*/

/* pd->falloff */
#define PFIELD_FALL_SPHERE 0
Index: source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- source/blender/makesrna/intern/rna_object_force.c (revision 33442)
+++ source/blender/makesrna/intern/rna_object_force.c (working copy)
@@ -1232,6 +1232,11 @@
RNA_def_property_ui_text(prop, "Use Max", "Use a maximum distance for the field to work");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");

+ prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEROT);
+ RNA_def_property_ui_text(prop, "Use Rot", "Use the rotation vector as the vortex vector");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
prop= RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMINR);
RNA_def_property_ui_text(prop, "Use Min", "Use a minimum radial distance for the field's fall-off");
  1. Index: release/scripts/ui/properties_physics_common.py
  2. ===================================================================
  3. --- release/scripts/ui/properties_physics_common.py     (revision 33442)
  4. +++ release/scripts/ui/properties_physics_common.py     (working copy)
  5. @@ -204,6 +204,10 @@
  6.      col.prop(field, "z_direction", text="")
  7.      col.prop(field, "use_min_distance", text="Use Minimum")
  8.      col.prop(field, "use_max_distance", text="Use Maximum")
  9. +    if  field.type == 'VORTEX':
  10. +        col.prop(field, "use_rotation", text="Use Rotation")
  11. +    
  12. +    
  13.  
  14.      col = split.column()
  15.      col.prop(field, "falloff_power", text="Power")
  16. Index: source/blender/blenkernel/intern/effect.c
  17. ===================================================================
  18. --- source/blender/blenkernel/intern/effect.c   (revision 33442)
  19. +++ source/blender/blenkernel/intern/effect.c   (working copy)
  20. @@ -651,7 +651,15 @@
  21.                         //}
  22.  
  23.                         VECCOPY(efd->loc, state.co);
  24. -                       VECCOPY(efd->nor, state.vel);
  25. +                      
  26. +                       if (eff->pd->flag & PFIELD_USEROT) {
  27. +                               efd->nor[0] = state.rot[1];
  28. +                               efd->nor[1] = state.rot[3]; /* flip y for z in order to get a better visual rotation axis */
  29. +                               efd->nor[2] = state.rot[2];
  30. +                       }else {
  31. +                               VECCOPY(efd->nor, state.vel);
  32. +                       }
  33. +                      
  34.                         if(real_velocity) {
  35.                                 VECCOPY(efd->vel, state.vel);
  36.                         }
  37. Index: source/blender/makesdna/DNA_object_force.h
  38. ===================================================================
  39. --- source/blender/makesdna/DNA_object_force.h  (revision 33442)
  40. +++ source/blender/makesdna/DNA_object_force.h  (working copy)
  41. @@ -335,6 +335,7 @@
  42.  #define PFIELD_DO_LOCATION             (1<<14)
  43.  #define PFIELD_DO_ROTATION             (1<<15)
  44.  #define PFIELD_GUIDE_PATH_WEIGHT (1<<16)       /* apply curve weights */
  45. +#define PFIELD_USEROT                  (1<<17)     /* use rotation as the vortex vector*/
  46.  
  47.  /* pd->falloff */
  48.  #define PFIELD_FALL_SPHERE             0
  49. Index: source/blender/makesrna/intern/rna_object_force.c
  50. ===================================================================
  51. --- source/blender/makesrna/intern/rna_object_force.c   (revision 33442)
  52. +++ source/blender/makesrna/intern/rna_object_force.c   (working copy)
  53. @@ -1232,6 +1232,11 @@
  54.         RNA_def_property_ui_text(prop, "Use Max", "Use a maximum distance for the field to work");
  55.         RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
  56.         
  57. +       prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
  58. +       RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEROT);
  59. +       RNA_def_property_ui_text(prop, "Use Rot", "Use the rotation vector as the vortex vector");
  60. +       RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
  61. +       
  62.         prop= RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE);
  63.         RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMINR);
  64.         RNA_def_property_ui_text(prop, "Use Min", "Use a minimum radial distance for the field's fall-off");
  65.  
go to heaven