[Bf-blender-cvs] [97178ee43c0] hair_guides_grooming: Use edit data so that hair is updated while editing groom objects.
Lukas Tönne
noreply at git.blender.org
Sun May 27 08:43:19 CEST 2018
Commit: 97178ee43c07f6a424dbae0eb25cf03f121c9b04
Author: Lukas Tönne
Date: Sun May 27 07:42:41 2018 +0100
Branches: hair_guides_grooming
https://developer.blender.org/rB97178ee43c07f6a424dbae0eb25cf03f121c9b04
Use edit data so that hair is updated while editing groom objects.
===================================================================
M source/blender/blenkernel/intern/groom.c
===================================================================
diff --git a/source/blender/blenkernel/intern/groom.c b/source/blender/blenkernel/intern/groom.c
index c6bc3c53b4d..5ec60332a91 100644
--- a/source/blender/blenkernel/intern/groom.c
+++ b/source/blender/blenkernel/intern/groom.c
@@ -686,17 +686,18 @@ void BKE_groom_hair_distribute(Groom *groom, unsigned int seed, int hair_count)
void BKE_groom_hair_update_guide_curves(Groom *groom)
{
struct HairSystem *hsys = groom->hair_system;
+ const ListBase *bundles = groom->editgroom ? &groom->editgroom->bundles : &groom->bundles;
/* Count guides for all regions combined */
int totguides = 0;
- for (const GroomBundle *bundle = groom->bundles.first; bundle; bundle = bundle->next)
+ for (const GroomBundle *bundle = bundles->first; bundle; bundle = bundle->next)
{
totguides += bundle->totguides;
}
/* First declare all guide curves and lengths */
BKE_hair_guide_curves_begin(hsys, totguides);
- for (const GroomBundle *bundle = groom->bundles.first; bundle; bundle = bundle->next)
+ for (const GroomBundle *bundle = bundles->first; bundle; bundle = bundle->next)
{
const int curvesize = bundle->curvesize;
for (int i = 0; i < bundle->totguides; ++i)
@@ -707,7 +708,7 @@ void BKE_groom_hair_update_guide_curves(Groom *groom)
BKE_hair_guide_curves_end(hsys);
int idx = 0;
- for (const GroomBundle *bundle = groom->bundles.first; bundle; bundle = bundle->next)
+ for (const GroomBundle *bundle = bundles->first; bundle; bundle = bundle->next)
{
const int shapesize = bundle->numshapeverts;
const int curvesize = bundle->curvesize;
More information about the Bf-blender-cvs
mailing list