operator renaming for more consistent word ordering (_add/_remmove shold be last...
[blender-staging.git] / source / blender / editors / physics / particle_object.c
index d763c0500d2902daa9d7735f8dcfd99f7af459bd..ce740a53db8144cd573f66b7a28830b8f0504468 100644 (file)
@@ -37,7 +37,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_windowmanager_types.h"
 
 #include "DNA_scene_types.h"
 #include "DNA_windowmanager_types.h"
 
-#include "BLI_arithb.h"
+#include "BLI_math.h"
 #include "BLI_listbase.h"
 
 #include "BKE_context.h"
 #include "BLI_listbase.h"
 
 #include "BKE_context.h"
@@ -69,7 +69,7 @@ static int particle_system_add_exec(bContext *C, wmOperator *op)
        if(!scene || !ob)
                return OPERATOR_CANCELLED;
 
        if(!scene || !ob)
                return OPERATOR_CANCELLED;
 
-       object_add_particle_system(scene, ob);
+       object_add_particle_system(scene, ob, NULL);
        WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
        
        return OPERATOR_FINISHED;
        WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
        
        return OPERATOR_FINISHED;
@@ -266,11 +266,11 @@ static int remove_particle_target_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
 
-void PARTICLE_OT_remove_target(wmOperatorType *ot)
+void PARTICLE_OT_target_remove(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name= "Remove Particle Target";
 {
        /* identifiers */
        ot->name= "Remove Particle Target";
-       ot->idname= "PARTICLE_OT_remove_target";
+       ot->idname= "PARTICLE_OT_target_remove";
        ot->description="Remove the selected particle target.";
        
        /* api callbacks */
        ot->description="Remove the selected particle target.";
        
        /* api callbacks */
@@ -548,7 +548,7 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
                psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
 
                for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
                psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
 
                for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
-                       Mat4MulVecfl(hairmat,key->co);
+                       mul_m4_v3(hairmat,key->co);
                        
                        if(ekey) {
                                ekey->flag &= ~PEK_USE_WCO;
                        
                        if(ekey) {
                                ekey->flag &= ~PEK_USE_WCO;
@@ -638,7 +638,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
 
        /* convert to global coordinates */
        for (i=0; i<numverts; i++)
 
        /* convert to global coordinates */
        for (i=0; i<numverts; i++)
-               Mat4MulVecfl (ob->obmat, CDDM_get_vert(dm, i)->co);
+               mul_m4_v3(ob->obmat, CDDM_get_vert(dm, i)->co);
 
        bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
 
 
        bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
 
@@ -657,21 +657,21 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
 
                mface = CDDM_get_face(dm,nearest.index);
 
 
                mface = CDDM_get_face(dm,nearest.index);
 
-               VecCopyf(v[0], CDDM_get_vert(dm,mface->v1)->co);
-               VecCopyf(v[1], CDDM_get_vert(dm,mface->v2)->co);
-               VecCopyf(v[2], CDDM_get_vert(dm,mface->v3)->co);
+               copy_v3_v3(v[0], CDDM_get_vert(dm,mface->v1)->co);
+               copy_v3_v3(v[1], CDDM_get_vert(dm,mface->v2)->co);
+               copy_v3_v3(v[2], CDDM_get_vert(dm,mface->v3)->co);
                if(mface->v4) {
                if(mface->v4) {
-                       VecCopyf(v[3], CDDM_get_vert(dm,mface->v4)->co);
-                       MeanValueWeights(v, 4, nearest.co, pa->fuv);
+                       copy_v3_v3(v[3], CDDM_get_vert(dm,mface->v4)->co);
+                       interp_weights_poly_v3( pa->fuv,v, 4, nearest.co);
                }
                else
                }
                else
-                       MeanValueWeights(v, 3, nearest.co, pa->fuv);
+                       interp_weights_poly_v3( pa->fuv,v, 3, nearest.co);
 
                pa->num = nearest.index;
                pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL);
                
                psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
 
                pa->num = nearest.index;
                pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL);
                
                psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
-               Mat4Invert(imat,hairmat);
+               invert_m4_m4(imat,hairmat);
 
                VECSUB(vec, nearest.co, key->co);
 
 
                VECSUB(vec, nearest.co, key->co);
 
@@ -682,7 +682,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
 
                for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
                        VECADD(key->co, key->co, vec);
 
                for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
                        VECADD(key->co, key->co, vec);
-                       Mat4MulVecfl(imat,key->co);
+                       mul_m4_v3(imat,key->co);
 
                        if(ekey) {
                                ekey->flag |= PEK_USE_WCO;
 
                        if(ekey) {
                                ekey->flag |= PEK_USE_WCO;