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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Storing Dynamic Lists/Arrays/vectors/etc..

    SDK Help
    0
    14
    1.1k
    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

      On 17/04/2014 at 15:15, xxxxxxxx wrote:

      What the heck is a "BlockArray" !Confused[URL-REMOVED]
      Is that one really available in R13?

      The only undocumented array in R13 I knew about is GeTempDynArray

      -ScottA


      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

        On 17/04/2014 at 16:34, xxxxxxxx wrote:

        Ah excuse me, the c4d_misc/ stuff (including BaseArray, BlockArray, HashMap, etc.) was introduced
        with R14. I think in R13 you should stick to the Ge~ Arrays (but they are damn slow. Maybe use the
        STL containers then).

        Here's a benchmark Jack did some time ago: https://developers.maxon.net/forum/topic/7185/8213_storing-objects-in-a-list&PID=34166#34166

        Best,
        -Niklas

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

          On 17/04/2014 at 16:51, xxxxxxxx wrote:

          NP.
          I just wanted to make sure I wasn't missing something.

          -ScottA

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

            On 18/04/2014 at 04:10, xxxxxxxx wrote:

            Ah excuse me, the c4d_misc/ stuff (including BaseArray, BlockArray, HashMap, etc.) was introduced
            with R14. I think in R13 you should stick to the Ge~ Arrays (but they are damn slow. Maybe use the
            STL containers then).

            Another way is to copy  c4d_misc/ from R14 to R13 SDK and then use there.
            I have tried this and it was working at least with BaseArray.

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

              On 18/04/2014 at 06:37, xxxxxxxx wrote:

              Thanks a lot for the info Niklas.  I`ll look into using write()/read() and using hyperfile..

              I was in the process of moving all my class variables into BaseContainers as this seems to be the advised way to do it, when i hit a wall with my std::vectors - so i assume i just keep those as class level variables.

              Same really with the ToArray() function of BaseSelect which creates a UCHAR pointer to an internal array.  I found with this there was no way to move it inside my BaseContainer and had trouble storing the pointers inside a standard array or vector ( probably as UCHAR is c4d not std ).

              I`ll have a look at using BaseArray..

              Originally posted by xxxxxxxx

              Another way is to copy  c4d_misc/ from R14 to R13 SDK and then use there.
              I have tried this and it was working at least with BaseArray.

              So does that mean plugins created that way using BaseArray will run in any R13?  Im working with R14 but would be interested to know if i use BaseArray in that way if itll run on R13..

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

                On 18/04/2014 at 09:53, xxxxxxxx wrote:

                Remo can you please explain further?
                I can't figure out what you're talking about.

                c4d_misc is a folder found in: resource\_api. Not in the cinema4dsdk files.
                If I copy the c4d_misc folder into the R13 resource\_api folder VS can't find it.
                If I copy the c4d_misc folder into the R13 cinema4dsdk source folder VS can't find it.

                Plus. Aren't the types different in R14 from R13?
                Can you please clarify how you're adding "c4d_misc" to the R13 SDK?

                -ScottA

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

                  On 20/04/2014 at 04:39, xxxxxxxx wrote:

                  Copy c4d_misc
                  from ..\CINEMA_4D_R14\resource\_api
                  to     ..\CINEMA_4D_R13\resource\_api

                  Add c4d_misc path to your R13 solution, just look how it is already done in R14 solution/project.
                  Add all the files from c4d_misc to you solution/project.

                  > Plus. Aren't the types different in R14 from R13?
                  No, but R15 have new types/names.

                  This does not work with R12 sadly.

                  By the way BaseSelect has "compressed" representation so use it until you really need an array.
                  BaseConteiner is well for not too may different values, but if you wan to store 100000 values of the same type then it will be slow and consume a lot of memory.
                  std::vector or c4d_misc::BaseArray should be used in such cases.
                  For std::vector one could create custom allocator that uses C4D memory system by the way.

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

                    On 20/04/2014 at 08:10, xxxxxxxx wrote:

                    Thanks anyway.
                    But I just can't get it to work. I need more detailed instructions on how to add it to the project.
                    I've tried everything I can think of. But it refuses to compile.
                    I keep getting errors like this: defaultallocator.h line 59 can't find allocator...blah,blah,blah.

                    I tried to add the misctest.cpp file to my R13 cinema4dsdk project this morning to see if that would help.
                    Not only did it not work. But it also messed up the project and now I'm getting "no such file "c4d.h".
                    Now I have to figure out how to fix that. 😠

                    -ScottA

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

                      On 20/04/2014 at 08:34, xxxxxxxx wrote:

                      Wouldn`t you have to recompile the API lib file?

                      Only other thing i can think of is adding the R14 property sheets..

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

                        On 20/04/2014 at 11:53, xxxxxxxx wrote:

                        Just try to mimic R14 API settings in R13 for c4d_misc.
                        I can not remember what exactly need to be done but it was pretty straightforward.
                        One problem that I could think about would be Visual Studio version, I have used VS2012.
                        VS2010 could not work.

                        Add all the files from c4d_misc to the "_api" solution just like this.
                        Source Files -> c4d_misc -> debugglobals.cpp

                        Compiles here fine using VS2012.

                        > Wouldn`t you have to recompile the API lib file?
                        Of course you will need to do this.

                        > Only other thing i can think of is adding the R14 property sheets..
                        This should be not necessary.

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

                          On 20/04/2014 at 12:48, xxxxxxxx wrote:

                          Thanks anyway. But it's not working for me.
                          I need to see someone do it in a video from start to finish to see what I'm doing wrong.
                          *But that's too much trouble. And I don't really need it that badly. GeArrays work fine for me in R13 anyway.

                          If I really want to play around with BaseArray. I can use my R14 or R15 demos and compile and use the SDK in them to play with it.

                          Have a Happy Easter guys,
                          -SocttA

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