Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Q: GeDynamicArray

    SDK Help
    0
    4
    348
    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
      Helper
      last edited by

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

      On 11/12/2006 at 21:03, xxxxxxxx wrote:

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

      ---------
      I'm having difficulties understanding exactly how the GeDynamicArray template class works.
      I need to create null objects for each particle being born into the scene. Once they are born I then need to record their positon througout the scene's time. GeDynamicArray seems like a perfect candidate for this. I'm not sure if I am allocating the dynamic array correctly, being that my plugin now crashes after adding this in there. Any examples on how to allocate the array and place the null object in there would be very helpful.
      As always thanks in advance for any help.
      Josh

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

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

        On 12/12/2006 at 02:42, xxxxxxxx wrote:

        You basically just tell the GeDynamicArray what type it will be and then use some of the functions to fill it or use the overloaded operators. Here a modifed Execute function to create a dummy Null and store the pointer in the GeDynamicArray and the read the first index in the GeDynamicArray to print the name of the object.

          
        Bool MenuTest::Execute(BaseDocument *doc)  
        {  
             GeDynamicArray<BaseObject*>myarray;  
             AutoAlloc<BaseObject> mynull(Onull);  
             if(!mynull) return FALSE;  
          
             mynull->SetName("mynull");  
          
             myarray.Push(mynull);  
          
             GePrint(myarray[0]->GetName());  
          
             return TRUE;  
        }  
        

        cheers,
        Matthias

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

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

          On 07/01/2009 at 06:42, xxxxxxxx wrote:

          Just a tad late to the party here. 😉

          In your example, Matthias, you AutoAlloc 'mynull' and Push it into the GeDynamicArray. I take it that it works similarly to the way one can create a local class instance in a function and Push it into a std::vector? That is, mynull is copied and appended, right?

          You guys really need an example of GeDynamicArray. I thought one had been added, but there is nothing in cinema4dsdk. C++ is a mess - I'm almost ready to go back to Java. 😄

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

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

            On 07/01/2009 at 11:21, xxxxxxxx wrote:

            Nevermind. I see that if you don't gNew the class and then Push(), bye-bye. It's working though. 🙂

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