Draw manager: Add support for cached particle edit paths
Before it was only supporting hair strand paths editing.
This commit is contained in:
@@ -174,6 +174,10 @@ static void ensure_seg_pt_count(ParticleSystem *psys, ParticleBatchCache *cache)
|
||||
if (psys->edit != NULL && psys->edit->pathcache != NULL) {
|
||||
count_cache_segment_keys(
|
||||
psys->edit->pathcache, psys->totpart, cache);
|
||||
}
|
||||
else if (psys->pointcache != NULL && psys->pointcache->edit != NULL) {
|
||||
count_cache_segment_keys(
|
||||
psys->pointcache->edit->pathcache, psys->totpart, cache);
|
||||
} else {
|
||||
if (psys->pathcache &&
|
||||
(!psys->childcache || (psys->part->draw & PART_DRAW_PARENT)))
|
||||
@@ -435,14 +439,26 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys,
|
||||
}
|
||||
|
||||
if (psys->edit != NULL && psys->edit->pathcache != NULL) {
|
||||
/* Edit mode strands for hair editing. */
|
||||
curr_point = particle_batch_cache_fill_segments(
|
||||
psys, psmd, psys->edit->pathcache, PARTICLE_SOURCE_PARENT,
|
||||
0, 0, psys->totpart,
|
||||
num_uv_layers, mtfaces, uv_id, &parent_uvs,
|
||||
&elb, &attr_id, cache);
|
||||
}
|
||||
else if (psys->pointcache != NULL && psys->pointcache->edit != NULL) {
|
||||
/* Edit mode for particle paths. */
|
||||
curr_point = particle_batch_cache_fill_segments(
|
||||
psys, psmd, psys->pointcache->edit->pathcache,
|
||||
PARTICLE_SOURCE_PARENT,
|
||||
0, 0, psys->totpart,
|
||||
num_uv_layers, mtfaces, uv_id, &parent_uvs,
|
||||
&elb, &attr_id, cache);
|
||||
}
|
||||
else {
|
||||
if (psys->pathcache && (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) {
|
||||
if ((psys->pathcache != NULL) &&
|
||||
(!psys->childcache || (psys->part->draw & PART_DRAW_PARENT)))
|
||||
{
|
||||
curr_point = particle_batch_cache_fill_segments(
|
||||
psys, psmd, psys->pathcache, PARTICLE_SOURCE_PARENT,
|
||||
0, 0, psys->totpart,
|
||||
|
||||
Reference in New Issue
Block a user