Commit: d347a2d9d1349813be961a3650170bd527aa1d44
Author: Lukas Tönne
Date:   Wed Jul 30 08:25:35 2014 +0200
Branches: hair_system
https://developer.blender.org/rBd347a2d9d1349813be961a3650170bd527aa1d44

Use particle systems on the same object for "copy from particles" operator.

This allows using the same geometry reference for hair roots.

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

M       source/blender/editors/physics/hair_ops.c

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

diff --git a/source/blender/editors/physics/hair_ops.c 
b/source/blender/editors/physics/hair_ops.c
index 0fe0b95..ac1b4f2 100644
--- a/source/blender/editors/physics/hair_ops.c
+++ b/source/blender/editors/physics/hair_ops.c
@@ -122,7 +122,7 @@ void HAIR_OT_reset_to_rest_location(wmOperatorType *ot)
 
 /************************ copy hair data from old particles 
*********************/
 
-static void hair_copy_from_particles_psys(Object *ob, HairSystem *hsys, Object 
*UNUSED(pob), ParticleSystem *psys)
+static void hair_copy_from_particles_psys(Object *ob, HairSystem *hsys, 
ParticleSystem *psys)
 {
        HairCurve *hairs;
        int tothairs;
@@ -158,21 +158,16 @@ static void hair_copy_from_particles_psys(Object *ob, 
HairSystem *hsys, Object *
 static int hair_copy_from_particles_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Object *ob;
+       ParticleSystem *psys;
        HairSystem *hsys;
        ED_hair_get(C, &ob, &hsys);
        
-       CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
-               Object *pob = base->object;
-               ParticleSystem *psys;
+       for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+               if (psys->part->type != PART_HAIR)
+                       continue;
                
-               for (psys = pob->particlesystem.first; psys; psys = psys->next) 
{
-                       if (psys->part->type != PART_HAIR)
-                               continue;
-                       
-                       hair_copy_from_particles_psys(ob, hsys, pob, psys);
-               }
+               hair_copy_from_particles_psys(ob, hsys, psys);
        }
-       CTX_DATA_END;
        
        WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
        return OPERATOR_FINISHED;

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

Reply via email to