This is the USD file content:
#usda 1.0
(
defaultPrim = "attribs"
)
def "attribs"{
custom string someString = "test"
custom float someFloat = 1
}
This is how I have to copy the attributes, which is not so ideal:
string attributes[] = usd_attribnames(0, @primpath); for(int i = 0; i < len(attributes); i++) { string attribName = attributes[i]; string attribType = usd_attribtypename(0, @primpath, attribName); string copiedAttribName = attribName + "Copy"; usd_addattrib(0, @primpath, copiedAttribName, attribType); if(attribType == "float") { float attribVal = usd_attrib(0, @primpath, attribName); usd_setattrib(0, @primpath, copiedAttribName, attribVal); } else if (attribType == "string") { string attribVal = usd_attrib(0, @primpath, attribName); usd_setattrib(0, @primpath, copiedAttribName, attribVal); } // THIS RESULTS IN AN ERROR //usd_setattrib(0, @primpath, copiedAttribName, usd_attrib(0, @primpath, attribName)); }
Is there some way I can just copy all the attributes without having to specify their type first?