THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/09/2009 at 15:02, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R11.5
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
This is very odd. Same code works in R8-R11 (and everywhere inbetween on both systems, 32-bit and 64-bit) but in R11.5, the tags disappear as if InsertTag() is failing. Anything need to be different?
> // Sort Polygon/Point Selection tags on Figure/Prop \> //\*---------------------------------------------------------------------------\* \> void IPPSortSelections(BaseDocument\* doc, BaseObject\* baseObject, BaseTag\* ptag) \> //\*---------------------------------------------------------------------------\* \> { \> // Separate material and bodypart selections \> AutoAlloc<AtomArray> aa; \> if (!aa) return; \> BaseTag\* tag; \> LONG cnt, i; \> // - Fill array with Material polygon selection tags \> for (tag = baseObject->GetFirstTag(); tag; tag = tag->GetNext()) \> { \> if (tag->IsInstanceOf(Tpolygonselection) && tag->GetName().FindLast(".mtl", &cnt;)) \> aa->Append(tag); \> } \> cnt = aa->GetCount(); \> for (i = 0L; i != cnt; ++i) \> { \> tag = static_cast<BaseTag\*>(aa->GetIndex(i)); \> doc->AddUndo(UNDO_CHANGE, tag); \> tag->Remove(); \> tag->InsertBefore(ptag); \> } \> aa->Flush(); \> // - Fill array with Bodypart polygon selection tags \> for (tag = baseObject->GetFirstTag(); tag; tag = tag->GetNext()) \> { \> if (tag->IsInstanceOf(Tpolygonselection) && !tag->GetName().FindLast(".mtl", &cnt;)) \> aa->Append(tag); \> } \> cnt = aa->GetCount(); \> for (i = cnt-1L; i >= 0L; --i) \> { \> tag = static_cast<BaseTag\*>(aa->GetIndex(i)); \> doc->AddUndo(UNDO_CHANGE, tag); \> tag->Remove(); \> baseObject->InsertTag(tag, ptag); \> } \> aa->Flush(); \> // - Fill array with Bodypart point selection tags \> for (tag = baseObject->GetFirstTag(); tag; tag = tag->GetNext()) \> { \> if (tag->IsInstanceOf(Tpointselection)) \> aa->Append(tag); \> } \> cnt = aa->GetCount(); \> for (i = cnt-1L; i >= 0L; --i) \> { \> tag = static_cast<BaseTag\*>(aa->GetIndex(i)); \> doc->AddUndo(UNDO_CHANGE, tag); \> tag->Remove(); \> baseObject->InsertTag(tag, ptag); \> } \> }
ETA: This is Cinema 4D R11.514 Demo. Have not yet had a chance to test in the non-demo version and no complaints (yet).