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

    Methods in older versions

    SDK Help
    0
    6
    583
    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 26/05/2016 at 07:01, xxxxxxxx wrote:

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

      ---------
      Hello.

      Currently, I use R17 to develop my plugin.
      Nevertheless, I use some methods (GetGUID, ~ inverse matrix) that are not supported in Older C4D versions (e.g. R12). Is there anything I can do other than implementing these methods myself or dropping the functionality for previous versions ?

      Thank you very much for your time.

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

        On 26/05/2016 at 08:18, xxxxxxxx wrote:

        Not 100% sure about R12, but I would be surprised if it didnt contain a matrix inverse implementation.

        /*!

           \* Invert a Matrix. The Cinema 4D API has changed the operator
        
           \* to invert a matrix in R15 and this is what this function handles.
        
           \*/
        
          inline Matrix invert_matrix(const Matrix& mat)
        
          {
        
            #if API_VERSION < 15000
        
              return !mat;
        
            #else
        
              return ~mat;
        
            #endif
        
          }
        

        It's usually simpler to develop with pre-R15 versions due to the name changes and then use the Legacy API mode in R15 and R16. Usually,
        plugins compiled with older versions will also load in newer ones.
        If however you need to recompile for R17 in that case, you need to
        copy the legacy header or write one by yourself.

        Since you started in R17 it might be easier to just write a "legacy header"
        for the reverse  to support pre R15 API. It's not always doable just by
        preprocessor defintitions so sometimes you need to write different code
        for differen versions. Especiallyy if you want to use maxon::BaseArray
        or maxon::HashSet etc. in older versions.

        -Niklas

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

          On 27/05/2016 at 03:27, xxxxxxxx wrote:

          Hi,

          for the most I agree with Niklas.

          We discourage the use of the legacy header in R17. It got removed for a reason. And I think, you are better of maintaining your own legacy header, where you know, what you are doing and have complete control of.

          In R12 matrix inversion was done with the ! operator, just like in R13 and R14, if I'm not mistaken.

          And also keep in mind, that we can support only the latest SDKs. So you may be on your own with those old APIs.

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

            On 31/05/2016 at 06:44, xxxxxxxx wrote:

            Howdy,

            Just out of curiosity, what was the reasoning behind that and similar changes that were made?

            I've created many of my own wrapper functions to stay compatible with earlier versions, as Nicklas posted, but I like to keep the function names simpler like: MInv(), VNorm(), VDot(), VCross(), etc.

            Adios,
            Cactus Dan

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

              On 31/05/2016 at 23:25, xxxxxxxx wrote:

              Well, we can't really discuss any details here, but if you are following the company blog, you can probably guess, there's a lot of stuff going on under the hood. These changes were one of the consequences.

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

                On 01/06/2016 at 05:13, xxxxxxxx wrote:

                Personally I'm happy with the naming changes, it increases the quality of the API by so much IMHO.

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