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

    Access to BaseList parameters

    Scheduled Pinned Locked Moved SDK Help
    12 Posts 0 Posters 869 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 19/11/2008 at 08:56, xxxxxxxx wrote:

      Use GetDataInstance() as often as you can as setting and getting values from it is faster than the other methods.

      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 19/11/2008 at 09:02, xxxxxxxx wrote:

        Howdy,

        Ah, I've been trying to learn more about C and C++ programming, and I'm assuming it's faster because you're working with pointers instead of the actual data?

        Adios,
        Cactus Dan

        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 19/11/2008 at 09:58, xxxxxxxx wrote:

          Howdy Dan,

          well, that really fully depends on how and where the pointer is used. It´s not necessarily faster, actually using a reference should generally be faster than a pointer (e.g. when passing a reference there are less constructor calls than for a pointer). But of course this also depends on compiler optimisation etc. There is no real convention.

          In this case however, I am simply following an advice from a C4D developer who once told me that using GetDataInstance() is indeed faster. 🙂

          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 19/11/2008 at 11:17, xxxxxxxx wrote:

            The one reason it would be faster is that you are getting the memory pointer to the actual BaseContainer and not a copy (which requires time to allocate and populate with the same data). Every time you send a class (on the stack) instead of a reference or a pointer, you are incurring this creation/duplication fee in time.

            Also, not to be too disparaging to the Cinema 4D developers, #define should be replaced with const variable declarations in every possible instance. enums are better though and they get credit for using them extensively.

            The book to read is "Effective C++ - Third Edition" by Scott Meyers.

            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 19/11/2008 at 11:37, xxxxxxxx wrote:

              Also make sure to consult the docs before you assume anything. For example, regarding BaseDraw (circa v9.603) :
              Note: Parameters must only be accessed using GetParameter()/SetParameter(), not using the container. A list of parameters can be found in the convenience GetParameterData() function.

              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 19/11/2008 at 12:37, xxxxxxxx wrote:

                Howdy,

                > Quote: Originally posted by kuroyume0161 on 19 November 2008
                >
                > * * *
                >
                > The one reason it would be faster is that you are getting the memory
                > pointer to the actual BaseContainer and not a copy (which requires time
                > to allocate and populate with the same data). Every time you send a class
                > (on the stack) instead of a reference or a pointer, you are incurring this
                > creation/duplication fee in time.
                >
                >
                > * * *

                Yes, that was what I was assuming.

                I've been learning C and C++ from these training videos:
                http://www.softwaretrainingtutorials.com/cprogramming.php
                http://www.softwaretrainingtutorials.com/c-plus-plus.php

                I just finished the part about pointers in the C tutorial and I'm moving on to structures. 🐵

                Adios,
                Cactus Dan

                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 19/11/2008 at 22:40, xxxxxxxx wrote:

                  Hi!

                  Wow, thanks for all of your answers. In my case the problem is, that I don't get all of the settings-parameters.

                  When I call GetDataInstance and check the type of the ID element 908 (this is the color value on the common tab which you can activate for each object) the return value is 0. When I do the same on GetParameter, I get that the element is of type Vector.

                  > <code>
                  > BaseObject* dl = BaseObject::Alloc(Ocube);
                  >      GePrint(LongToString(dl->GetDataInstance()->GetType(907)));//returns DA_NIL (type id: 0)
                  >      
                  >      GeData t;
                  >      dl->GetParameter(DescID(907), t, 0);
                  >      GePrint(LongToString(t.GetType()));//returns DA_LONG (type id: 15)
                  > </code>

                  ID 907 is the elemnt in the Basic Tab -> "Use Color:"
                  Bye,

                  Sebastian

                  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 20/11/2008 at 07:05, xxxxxxxx wrote:

                    Howdy,

                    All of those color parameters are in an ObjectColorProperties structure. Use BaseObject::GetColorProperties() and BaseObject::SetColorProperties() to work with those parameters. ;o)

                    Adios,
                    Cactus Dan

                    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 20/11/2008 at 10:17, xxxxxxxx wrote:

                      To add here, some things seem to have everything as parameters and are not accessible by the BaseContainer. Already mentioned was BaseDraw. The same goes for BaseChannels as well.

                      Some of this discovering whether to use GetDataInstance() or GetParameter() will be trial and error. Start with the BaseContainer and if that doesn't work then it probably has another access methodology.

                      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 20/11/2008 at 10:29, xxxxxxxx wrote:

                        Hi!

                        Okay, seems I have no other chance as try and error. Last point which I wanted to know:

                        User datas can only be changed, set and added by using (BaseObject* )->GetDynamicDescription(), correct?

                        Thanks, Shawni..

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