This creates a new curves object with the name of the particle system.
The generated curves match the current evaluated state of the active hair particle system.
Attachment information is not transferred currently, because it's not obvious how that should be transferred when there are modifiers before the particle system modifier (and we don't have the curve deformation system not in master yet).
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
Simpler than I expected! I guess bringing the child hairs into the conversion might make it a bit more complex.
| source/blender/editors/curves/intern/curves_ops.cc | ||
|---|---|---|
| 341 | I don't really care here given the nature of this code, but where we care about performance I've usually been resizing once and using the new offsets array but keeping the point count the same, then resizing again with the final point count. | |
Comment Actions
The round trip curves->particles->curves works well for me too. Looks good.
| source/blender/editors/curves/intern/curves_ops.cc | ||
|---|---|---|
| 323 | I think it's a bit nicer to return bke::CurvesGeometry by value: static bke::CurvesGeometry particles_to_curves(Object &object, ParticleSystem &psys)
{
ParticleSettings &settings = *psys.part;
if (psys.part->type != PART_HAIR) {
return {};
}
...
bke::CurvesGeometry curves(points_num, curves_num);
...
return curves;
}
...
bke::CurvesGeometry::wrap(curves_id->geometry) = particles_to_curves(*ob_from_eval, *psys_eval); | |
| 408 | ob_new->dtx |= OB_DRAWBOUNDOX; /* TODO: remove once there is actual drawing. */ | |
Comment Actions
- Merge branch 'master' into convert-hair-to-curves
- ignore hair particles with no segments
- cleanup