[Bf-blender-cvs] [552d15c9769] master: Cycles: Add utility function to remove given attribute
Sergey Sharybin
noreply at git.blender.org
Wed Oct 11 10:46:59 CEST 2017
Commit: 552d15c97698ac4270c462385a9b111f6e8329c3
Author: Sergey Sharybin
Date: Fri Aug 25 22:51:44 2017 +0200
Branches: master
https://developer.blender.org/rB552d15c97698ac4270c462385a9b111f6e8329c3
Cycles: Add utility function to remove given attribute
===================================================================
M intern/cycles/render/attribute.cpp
M intern/cycles/render/attribute.h
===================================================================
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp
index e157a385904..9dff18691cd 100644
--- a/intern/cycles/render/attribute.cpp
+++ b/intern/cycles/render/attribute.cpp
@@ -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) {
diff --git a/intern/cycles/render/attribute.h b/intern/cycles/render/attribute.h
index a64eb6542d5..d15ee401a72 100644
--- a/intern/cycles/render/attribute.h
+++ b/intern/cycles/render/attribute.h
@@ -120,6 +120,8 @@ public:
Attribute *find(AttributeRequest& req);
+ void remove(Attribute *attribute);
+
void resize(bool reserve_only = false);
void clear();
};
More information about the Bf-blender-cvs
mailing list