Methods in older versions



  • 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.



  • 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



  • 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.



  • 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



  • 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.



  • 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.


Log in to reply