The HDK porting guide doesn't describe any methodology for doing what the old GB_Detail::mergeGroup() and GB_Detail::mergeGroups() functions used to do. And there don't seem to be any equivalent functions. How do we now copy/merge groups from one Detail to another (GA_ElementGroup::copyMembership() only seems to work between groups within the same Detail).
Thanks!
H12 HDK equivalent to GB_Detail::mergeGroup() functions?
3046 8 0- jrcooper
- Member
- 59 posts
- Joined: April 2006
- Offline
- Ondrej
- Staff
- 1072 posts
- Joined: July 2005
- Offline
Those missing methods are an oversight, unnoticed because our internal code didn't make use of them.
It's hairy enough that I'll add those methods back, but in the meantime you could use something like the following.
GA_PrimitiveGroup *dest_group = newPrimitiveGroup(src_group->getName(), src_group->getInternal());
if (src_group->getOrdered())
dest_group->makeOrdered();
const GA_IndexMap &dest_map = dest_group->getIndexMap();
const GA_IndexMap &src_map = src_group->getIndexMap();
for (GA_Iterator it(GA_Range(*src_range); !it.atEnd(); it.advance())
{
dest_group->addOffset(dest_map.offsetFromIndex(src_map.indexFromOffset(it.getOffset()));
}
It's hairy enough that I'll add those methods back, but in the meantime you could use something like the following.
GA_PrimitiveGroup *dest_group = newPrimitiveGroup(src_group->getName(), src_group->getInternal());
if (src_group->getOrdered())
dest_group->makeOrdered();
const GA_IndexMap &dest_map = dest_group->getIndexMap();
const GA_IndexMap &src_map = src_group->getIndexMap();
for (GA_Iterator it(GA_Range(*src_range); !it.atEnd(); it.advance())
{
dest_group->addOffset(dest_map.offsetFromIndex(src_map.indexFromOffset(it.getOffset()));
}
- jrcooper
- Member
- 59 posts
- Joined: April 2006
- Offline
- Ondrej
- Staff
- 1072 posts
- Joined: July 2005
- Offline
- jrcooper
- Member
- 59 posts
- Joined: April 2006
- Offline
- Ondrej
- Staff
- 1072 posts
- Joined: July 2005
- Offline
- Ondrej
- Staff
- 1072 posts
- Joined: July 2005
- Offline
- jrcooper
- Member
- 59 posts
- Joined: April 2006
- Offline
Awesome!
Will the new build include the mergeGroup() functions as well? There were originally three in the mergeGroup* family of functions, so to speak:
GB_Detail::mergeGroup(const GB_Detail&, const GB_PointGroup&, int);
GB_Detail::mergeGroup(const GB_Detail&, const GB_PrimitiveGroup&, int);
GB_Detail::mergeGroups(const GB_Detail&, int);
The first two are actually more important to me for my SOP than the third.
Will the new build include the mergeGroup() functions as well? There were originally three in the mergeGroup* family of functions, so to speak:
GB_Detail::mergeGroup(const GB_Detail&, const GB_PointGroup&, int);
GB_Detail::mergeGroup(const GB_Detail&, const GB_PrimitiveGroup&, int);
GB_Detail::mergeGroups(const GB_Detail&, int);
The first two are actually more important to me for my SOP than the third.
- Ondrej
- Staff
- 1072 posts
- Joined: July 2005
- Offline
-
- Quick Links