Encountering Issues with Generating Hash Suffix for Preferences Directory in C4D
-
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.pyWhen 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.
Any assistance or insights would be greatly appreciated. Thank you!
-
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. -
@m_adam m_adam resolved the issue perfectly. Thanks for the great support!