diff options
Diffstat (limited to 'intern/cycles/render/attribute.cpp')
-rw-r--r-- | intern/cycles/render/attribute.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 6816f8ca3f3..8c77687d9cc 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -535,9 +535,23 @@ void AttributeSet::resize(bool reserve_only) } } -void AttributeSet::clear() +void AttributeSet::clear(bool preserve_voxel_data) { - attributes.clear(); + if(preserve_voxel_data) { + list<Attribute>::iterator it; + + for(it = attributes.begin(); it != attributes.end();) { + if(it->element == ATTR_ELEMENT_VOXEL || it->std == ATTR_STD_GENERATED_TRANSFORM) { + it++; + } + else { + attributes.erase(it++); + } + } + } + else { + attributes.clear(); + } } /* AttributeRequest */ |