resonanz Posted August 25, 2015 Share Posted August 25, 2015 (edited) If I have a point attribute of type array, how can I get that array and store the values in a UT_FloatArray? I tried the following but somehow it does not work. GA_ROHandleFA distH(gdp, GA_ATTRIB_POINT, "dist"); UT_FloatArray distances; for(GA_Iterator it(gdp->getPointRange()); !it.atEnd(); it.advance()) { GA_Offset offset = it.getOffset(); distances = distH(offset); } Thanks in advance! Edited August 26, 2015 by resonanz Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted August 26, 2015 Share Posted August 26, 2015 Well its usually best to say why something doesn't work, so someone can have a starting point to figure out the problem. From what I see though, you're assigning a float value to UT_FloatArray. A float is not a UT_FloatArray. Your attempting to make UT_FloatArray == float, when what you want to is store the float inside the array object. distances.append(distH(offset)); should solve that problem. Quote Link to comment Share on other sites More sharing options...
resonanz Posted August 26, 2015 Author Share Posted August 26, 2015 You are right! Sorry about that! The problem is that GA_ROHandleFA is a handle for an array not a float like in your example. I did check if the handle is valid and it is but as soon as I try to get the array from the attribute with distH(offset) I get the following error message: "error C2064: term does not evaluate to a function taking 1 arguments". The thing is that I have no idea what other argument(s) I should use instead. Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted August 26, 2015 Share Posted August 26, 2015 Oh okay, yea that makes sense. UT_Fpreal32Array distances; distH.get(offset, distances); Quote Link to comment Share on other sites More sharing options...
resonanz Posted August 26, 2015 Author Share Posted August 26, 2015 Perfect that´s it! Thanks a lot! 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.