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

    Use GetDataInstance - Dont use GetDataInstance?

    Scheduled Pinned Locked Moved PYTHON Development
    14 Posts 0 Posters 1.2k 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 16/04/2012 at 12:42, xxxxxxxx wrote:

      It all helps to fill in the blanks  - cheers for the pointers (no pun intended)

      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 16/04/2012 at 13:13, xxxxxxxx wrote:

        @Sebastian: Interesting, thank you! I think this enlightens my knowledge a little more. I was always
        wondering how, just for example, the Dynamics tag interacts with the Cloner object (as it doesn't
        seem to be possible by modifieng the cache directly). I guess that is the way the information is being
        exchanged between the Cloner and the Tag (using Get~()/SetParameter())? Please correct me if I'm
        wrong.

        Thanks,
        Niklas

        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 16/04/2012 at 14:26, xxxxxxxx wrote:

          Thanks Sebastian for the info.

          So using GetDataInstance() is no problem (other than future compatibility) when:
          - Creating an object from scratch (point by point) with my own functions, AND,
          - I only use my own parameters (no includes), AND,
          - I need the fastest possible speed for calculations.

          Right?

          (I have a few of those "ABC can't bigger than XYZ when…" but they are
          taken care of post reading the container into the functions.)

          Cheers
          Lennart

          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 17/04/2012 at 13:46, xxxxxxxx wrote:

            Topic-push 'cause offc. SDK guys often only see the top post.

            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/04/2012 at 01:37, xxxxxxxx wrote:

                
              So using GetDataInstance() is no problem (other than future compatibility) when:   
              - Creating an object from scratch (point by point) with my own functions, AND,   
              - I only use my own parameters (no includes), AND,   
              - I need the fastest possible speed for calculations.   
                
              Right?   
              

              I would use BaseList2D.__setitem__ to be on the safe side.

              Cheers, 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 18/04/2012 at 04:29, xxxxxxxx wrote:

                Thanks again. So, sorry to be ignorant (not understanding).

                When you say " BaseList2D.__getitem/__setitem__" that is the same as using:

                  
                def Init(self,op)   
                     op[c4d.MY_ID] = 123   
                     return True   
                  
                def Execute(self…. etc)   
                     myvalue = op[c4d.MY_ID]   
                

                ?
                In other words, exactly the way how to get/set from/to the AM for any object.

                Cheers
                Lennart

                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/04/2012 at 04:36, xxxxxxxx wrote:

                  yes, the bracket syntax is the snytax to call __setitem__ and __getitem__. it is explained in the
                  GetParameter thread.

                  https://developers.maxon.net/forum/topic/5284/5286_please-use-getparametersetparameter

                  hadn't we this discussion already a week ago on cgtalk ?

                  http://forums.cgsociety.org/showpost.php?p=7294996&postcount=28

                  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/04/2012 at 04:45, xxxxxxxx wrote:

                    I'm asking because I have a follow up of that and that it is still
                    a recommendation only, that's way.

                    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/04/2012 at 13:00, xxxxxxxx wrote:

                      littledevil, I'm not trying to be thick or anything,
                      my concern is that while __getitem/setitem__ is recommended now,
                      Sebastian wrote that:
                      "overriding GetDParameter/SetDParamter, this is not possible in Python yet".

                      Which means , for me, that instead of re write a year worth of plugins now,
                      to __set/getitem__ and then only to find out that GetDParameter/SetDParamter
                      is a recommended way.
                      As much as making tools are rewarded/needed, I rather do work that brings
                      food on my table than code. That's all.

                      Cheers
                      Lennart

                      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/04/2012 at 13:22, xxxxxxxx wrote:

                        well,

                        i am neither very experienced, nor i have the techincal background to understand fully why we
                        are supposed to use Get/setParameter. I am just following the thread where Rick Barret states,
                        that the bracket syntax aka setitem / getitem is the correct way in python and the equivalent to
                        the c++ Get/SetParameter syntax.

                        the wrong way in python would be to use GetDatainstance and then set the values via Set Type (),
                        just as in c++. if i have understood something wrong with your concerns, forgive my lousy english 
                        please 😉

                        ps : that you are not able to overwrite Get/SetParameter, is only a problem if you are not storing 
                        your plugins data within the plugins bc, or am i mistaken here ?

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