SelectionChanger Problem



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/11/2009 at 05:21, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   11.5 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Hello All,
    ia have some problem wiht SelectionChanger Class.
    here my code:

    if ( mode == Mpoints || mode == Mpolygons)
                   {
                        for (LONG r = 0 ; r < maa->GetCount() ; r++)
                        {
                             if (((BaseObject* )maa->GetIndex(r))->GetType() == Opolygon)
                             {
                                  AutoAlloc<Modeling>pmod;
                                  pmod->InitObject((maa->GetIndex(r)));
                                  BaseSelect * ps;
                                  
                                  if (mode == Mpoints) ps = ((PointObject* )maa->GetIndex(r))->GetPointS();

    else if (mode == Mpolygons)
                                  {
                                       BaseSelect * bs = ((PolygonObject* )maa->GetIndex(r))->GetPolygonS();
                                       AutoAlloc<SelectionChanger>sch;
                                       sch->InitFromSelection(bs,Mpolygons,NULL);
                                       ps = sch->GetPointS();
                                  }

    LONG seg=0,a,b,i;

    while (ps->GetRange(seg++,&a;,&b;))
                                  {
                                       if (ps->GetCount() == 0) break;
                                       for (i=a; i<=b; ++i)
                                       {
                                            Vector currentpos;
                                            pmod->GetPoint(((BaseObject* )maa->GetIndex(r)),i,¤tpos);
                                            pmod->SetPoint(((BaseObject* )maa->GetIndex(r)),i,(currentpos+(end-start)));
                                       }
                                  }

    doc->AddUndo(UNDO_CHANGE,(maa->GetIndex(r)));
                                  pmod->Commit(((BaseObject* )maa->GetIndex(r)));
                                  EventAdd();
                             }
                        }
                        AtomArray::Free(maa);
                   }

    in case mode is == Mpolygon i have an infinite loop and BaseSelect * ps is NULL..
    Thanks in advance
    Franz



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/11/2009 at 05:28, xxxxxxxx wrote:

    Nevermind, my code problem.

    solved !
    Franz


Log in to reply