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

    Check if the current C4D version is >= R16 Version

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 343 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

      On 12/10/2016 at 15:38, xxxxxxxx wrote:

      Hello,

      I wrote this script to check if the current version of Cinema 4D is greater or equal to R16.
      can I improve this script or there is a better way of doing this?

      import c4d  
        
      def main() :  
        if int(str(c4d.GetC4DVersion())[:2]) >= 16 :  
            print "Greater than or equal to R16"  
        else :  
            print "Older than R16"  
        
      if __name__=='__main__':  
        main()
      

      Thanks

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

        On 12/10/2016 at 16:15, xxxxxxxx wrote:

        The number you get with GetC4DVersion() is the Cinema 4D version number multiplied by 1000.
        So your check can be optimized like this:

        if c4d.GetC4DVersion() >= 16000:
          # ...
        

        Best,
        Niklas

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

          On 12/10/2016 at 16:22, xxxxxxxx wrote:

          Thank you, I had not thought about that.
          Best

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