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");
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");
|