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

    AtomArray to BaseObject

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 163 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 12/06/2009 at 12:53, xxxxxxxx wrote:

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

      ---------
      Hi there,
      i have managed to create an AtomArray which holds all objects in the scene, now i want filter away the the lights out, create a new Document and copy the Objects from the list to that new doc.

      > `

        
      \>  sceneObjects->FilterObject(Olight,NULL,FALSE);  
      \>  BaseDocument *doc3 = BaseDocument::Alloc();  
      \>  if (!doc3) goto Ende;  
      \>  BaseObject *newParent = BaseObject::Alloc(Onull);  
      \>  newParent->SetName(objName);  
      \>  doc3->InsertObject(newParent,NULL,NULL,FALSE);  
      \>  for(int i=0;i<sceneObjects->GetCount();i++)  
      \>  {                               
      \>  doc3->InsertObject(static_cast<BaseObject*>(sceneObjects->GetIndex(i)),newParent,NULL,TRUE);  
      \>  }  
      \>  
      

      `

      anyway, the line in the loop where i try to insert the objects simply switches cinema away, not even a crash message appears 🙂

      what am i doing wrong there? i guess something very basic?

      thanks,
      Ello

      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 12/06/2009 at 13:16, xxxxxxxx wrote:

        ok, i managed it to work , at least somehow:

        > <code>
        >
        >> <code>
        >>
        >>> <code>
        >>>
        >>>> `

          
        \>  oc3->InsertObject(static_cast<BaseObject*>(sceneObjects->GetIndex(i)->GetClone(0L,NULL)),newParent,NULL,TRUE);  
        \>  
        

        `
        >>>
        >>> </code>
        >>
        >> </code>
        >
        > </code>

        but now if the base document looks for example like this:
        parent
        -object1
        -object2

        the target looks like this:

        newParent
        -object1
        -object2
        -parent
        --object1
        --object2

        something still wents wrong and now i really dont have a clue what it is??

        anyone has a hint?

        and to make it more strange the light objects are still there. seems the Filter doesnt work...
        edit: i guess its better to filter manually by using GetType(), but why are those duplications happening? ok, i think because the parent gets copied with the childs?? gonna test 🙂

        thanks,
        ello

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