Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Register
    • Login

    Encountering Issues with Generating Hash Suffix for Preferences Directory in C4D

    Cinema 4D SDK
    python
    2
    3
    439
    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.
    • moghurtM
      moghurt
      last edited by

      Hello everyone,

      I am experiencing some issues while generating the directory for the Cinema 4D preferences folder. I referenced the code from Maxon's official Github repository, 'cinema4d_py_sdk_extended/scripts/01_foundations/retrieves_temp_folder_r17.py'.
      https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/ba0daf1711ef0065f6587bf08b8aaec6c48dc96f/scripts/01_foundations/retrieves_temp_folder_r17.py

      When I use this method and input the directory 'C:\Program Files\MAXON\Cinema 4D 2023', the result I get is 'C:\Users\Mcyog\AppData\Roaming\MAXON\Cinema 4D 2023_76175CB', where the hash suffix is '76175CB', a 7-digit number. However, the correct result should be '076175CB'.

      I have tried other directories and they all output the correct hash suffix. Only the directory 'C:\Program Files\MAXON\Cinema 4D 2023' has this issue.

      Interestingly, when Cinema 4D automatically generates preferences, it creates the correct 8-digit hash suffix '076175CB' for this directory. I would like to know if the method from Github needs to be updated, and I need a way to retrieve the preferences without starting Cinema 4D, as this seems to be the only solution.
      CRCbug.gif

      Any assistance or insights would be greatly appreciated. Thank you!

      1 Reply Last reply Reply Quote 1
      • M
        m_adam
        last edited by m_adam

        Hi @moghurt good, catch I fixed it on Github.

        To fix it, edit line 64 from

        return format(crc ^ 0xffffffff, 'x').upper()
        

        To

        return format(crc ^ 0xffffffff, '08x').upper()
        

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        moghurtM 1 Reply Last reply Reply Quote 0
        • moghurtM
          moghurt @m_adam
          last edited by

          @m_adam m_adam resolved the issue perfectly. Thanks for the great support!

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