Cycles: Add utility function to remove given attribute

This commit is contained in:
Sergey Sharybin 2017-08-25 22:51:44 +02:00
parent 4782000fd5
commit 552d15c976
2 changed files with 12 additions and 0 deletions

@ -502,6 +502,16 @@ Attribute *AttributeSet::find(AttributeRequest& req)
return find(req.std);
}
void AttributeSet::remove(Attribute *attribute)
{
if(attribute->std == ATTR_STD_NONE) {
remove(attribute->name);
}
else {
remove(attribute->std);
}
}
void AttributeSet::resize(bool reserve_only)
{
foreach(Attribute& attr, attributes) {

@ -120,6 +120,8 @@ public:
Attribute *find(AttributeRequest& req);
void remove(Attribute *attribute);
void resize(bool reserve_only = false);
void clear();
};