lisux Posted May 2, 2014 Share Posted May 2, 2014 (edited) Let's say I have two attributes, P and P1. P is the usual position attribute and P1 is a clone of the former one. So I do my stuff on P1 and I want to copy them back to P. Is there any easy way in the HDK to do this? At the moment I am just doing a loop through all the point, initiate the handlers for the attributes and doing the get/set to copy values from one to the other. But I was wondering if there is a more general solution, something like passing two GA_Attribute*, and copy one into another no matter the attribute type. Thanks Edited May 2, 2014 by lisux Quote Link to comment Share on other sites More sharing options...
graham Posted May 2, 2014 Share Posted May 2, 2014 You can use GA_AIFCopyData to do this. It should properly share the data since it's basically the same data referenced by 2 names. Something like this (I think). const GA_AIFCopyData *copy; GA_Attribute *pattr, *p1attr; // Attach attrs copy = p1attr->getAIFCopyData(); copy->copy(*pattr, gdp->getPointRange(), *p1attr, gdp->getPointRange()); Quote Link to comment Share on other sites More sharing options...
lisux Posted May 2, 2014 Author Share Posted May 2, 2014 Cool, thanks Graham I'll give it a try. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.