Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    SelectionChanger Problem

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 185 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post