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
    • Login
    1. Maxon Developers Forum
    2. yaya
    Y
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 53
    • Best 1
    • Controversial 0
    • Groups 0

    yaya

    @yaya

    1
    Reputation
    19
    Profile views
    53
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location Ukraine

    yaya Unfollow Follow

    Best posts made by yaya

    • RE: Replace Plugins in a Running Cinema 4D Instance

      Oh! Forget guys my message above!

      The calling of Python code from C++ plugin in @kbar 's advice does the trick! 🙂

      If someone from the future who will read this thread will need the code example, I just use the code snippet from here: https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_python.html

      and feed to it this code:

      // call it from somewhere
      String code = "import c4d\nimport maxon\nimport os    ";
              code+= "\n\nprint(f'This is simple message')";
              code += "\nos.rename('C:/Code/sdk/plugins/myPlugin/myPlugin.xdl64', 'C:/Code/sdk/plugins/myPlugin/old_myPlugin.old')"; 
              
      ExecutePythonScript(code, GetActiveDocument());
      

      😄

      posted in Cinema 4D SDK
      Y
      yaya

    Latest posts made by yaya

    • RE: Plugin does not appear in Expression on client's Cinema 4D

      Oh, you've edited your previous message! Thanks! I will try it.

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      I know what is projectdefitnion.txt. I just do not understand how to use the line: AdditionalLibraryDirectories.Win64.Debug =../../curl 🙂
      And do I need to launch again the buildsdk23.bat right after each time I change this file.
      I have not added the static curl library in my project yet.

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      @ferdinand thank you for you answer.
      I was thinking that:

      • if at the beginning (when I just started to add the curl and openSSL to a code) the code in the VS 2019 worked fine. But after making a build the plugin does not loaded in Cinema, throwing an error about missing dlls.

      But, if I managed to fix it just via:

      • adding few dlls (libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll)
      • to Windows/System32 and by editing system variables...

      ...But in this case the plugin does not work on the client's side, because of:

      • clients do not have that dlls on their side,

      Then:

      • I can "simply" make the plugin work on the client's side just (somehow) adding missing dlls => to a plugin's res/libs and shipping them with the plugin.

      I was thinking it is easy to do. But if you say that it is not (or as I understand), then I will try your solution. Which seems harder for me because my lack of knowledges.
      F.e. I did not understood how to set up an exact path in the projectdefitnion.txt via that command. If f.e. I have this text in the projectdefitnion.txt:

      Platform=Win64;OSX
      Type=Solution
      Solution=\
      	plugins/cinema4dsdk;\
      	plugins/maxonsdk.module;\
      	plugins/microsdk;\
      	plugins/ragdoll
      

      where the last line means the root folder of my plugin.
      And if I need to include "curl" folder via your line:

      AdditionalLibraryDirectories.Win64.Debug  =../../curl
      AdditionalDependencies.Win64.Debug =libcurl_a_debug.lib
      AdditionalIncludeDirectories=../../curl
      

      where "curl" is a folder exactly in "ragdoll" and the "libcurl_a_debug.lib" is a file directly in the "curl"
      So how to edit the line accordingly? I mean all that "../..." :

      AdditionalLibraryDirectories.Win64.Debug  =../../curl
      
      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      @ferdinand Yes, I will not ship the debug version of dlls. It is just for testing.
      But are you sure that your that you wrote me right? Your hint is about the linking of static library but libcurl_a_debug.lib does not work for me.
      Or did you mean that if I do as you described above it, the error 1>LINK : fatal error LNK1104: cannot open file 'curl/libcurl_a_debug.lib'. - will disappear? Then thank you about this solution, in this case I will need to get back again to a static library (which I already have deleted 😄 )
      But what about the linking dlls to make libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll linked from res/libs during Cinema 4D startup (and for shipping first two to clients)? Is there some option for this?

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      I've managed to reproduce the problem: the Cinema does not load the plugin (r23 and 2025).
      To do it, I not only deleted libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll from Windows/System32. It was enough for r23. For 2025 I was needed also to delete the variable from a PATH to Windows/System32.
      Then I've tried to build the static lib of curl. I was thinking that this way will be better. I will not explain all the details, but it didn't - it just finished every build with:

      1>LINK : fatal error LNK1104: cannot open file 'curl/libcurl_a_debug.lib'.
      

      And nothing helped to fix that.
      So I decided to return to the dynamic libraries. Actually I do not mind to supply the above dlls with my plugin.
      I have reverted the binding to the dynamic version of curl and openSSL. Also I have added libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll to *plugin root/res/libs (not so hoping plugin will start to take them from there).
      And I've delete the variable from a PATH (Windows/System32) to make sure it won't catch on these dlls from the System32.
      Now I am making the build and it finishes with the success. And when I am starting the r23 - of course there is no plugin.
      Yes, -g_console says:

      WARNING: Error loading file:///H:/Code/r23/sdk/plugins/firstplugin/ragdoll.xdl64: Could not load dll because of
        Could not load libcrypto-3-x64.dll due to Windows System Error #126: The specified module could not be found. [win_dll.cpp(304)].
        Could not load libcurl-d.dll due to Windows System Error #126: The specified module could not be found. [win_dll.cpp(304)].. (file:///H:/Code/r23/sdk/plugins/firstplugin/ragdoll.xdl64) [win_dll.cpp(324)]
        Cause: Windows System Error #126: The specified module could not be found. [win_dll.cpp(318)] [general.cpp(401)]
      

      Expected. The same problem which clients have.
      (And yes, if I will back libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll to the System32, then my plugin appears in Expression)

      So right now I need somehow to fix it so the plugin catch on libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll not from my Windows/System32 but from *res/libs.

      How to do it?
      DeepSeek gives me a hint that I can use

      void SetDllSearchPath() {
          // Set the DLL search path to the res/libs folder
          SetDllDirectory(L"res\\libs");
      }
      
      // Call this function during plugin initialization
      SetDllSearchPath();
      

      But I am not sure is it right?
      If it is not, then how to achieve this with maybe the other correct way?

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      Actually I am not fully correct: the plugin now does not loading in C4D r23 and C4D 2024. But still appears in C4D 2025 😄
      Frustrating...

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      Hmm, after delete libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll from Windows/System32 I can't reproduce the problem on my side ("Error loading file:// Could not load libcurl.dll ...Could not load libcrypto-3-x64.dll"). The plugin still loads...
      I understand that it is my problem, and you do not provide help with 3rd party libraries.
      Just was dreaming that I will fix everything quickly.
      Just delete libcurl.dll, libcrypto-3-x64.dll, libcurl-d.dll from Windows/System32 (where I've put them before), check if the same problem appears (the plugin does not loading), then put these files into res/libs.
      But it turned out that I delete files, but the plugin still loads 😄

      I'll dig further...

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      @ferdinand hmm, now I think I understand.
      Actually I had a problem last week with including these libcurl.dll and libcrypto-3-x64.dll into my VS2019 project. Even adding these .lib linking into the additional lib derectories and additional dependancies, I think I got the same error you quote above : Could not load libcurl.dll, libcrypto-3-x64.dll.
      And only the manually adding these tow dlls into Windows/System32 fixed that problems.

      So now after your explanation I understand that I did not make everything correctly.

      The question is now: how to properly add the
      \curl_x64-windows\debug\lib
      \openssl_x64-windows\debug\lib
      libcurl-d.lib
      libcrypto.lib
      into a project (do not shipping the exact .dlls with a plugin to clients)?...

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      @Havremunken thanks for the idea. I've sent to the customer the little debug version to check the log when the plugin are registered by Cinema 4D at a startup process. Will wait what he will answer me.

      @ferdinand thank you for your answer. Yes, I use these dlls in my plugin. And yes, I've added them just in last update (which means that exactly the plugin instance with these dlls does not work on the client's side).
      But what is confusing me - this absolutely the same plugin version loads on my side.
      Plugin ID is unique. It did not caused any problems for years.
      Sorry, I've not fully understood you: you are confirming that your Cinema 4D does not load the plugin too?
      Then how it can be that the absolutely the same plugin file works on my side, but does not work on yours (and client's)?
      PS. In some reason I can't perform adding of -g_console like you show. It says "the wrong folder".

      @ferdinand said in Plugin does not appear in Expression on client's Cinema 4D:

      your plugin package seems to simply miss these DLLs, as neither libcurl.dll nor libcrypto-3-x64.dll are native Windows libraries.

      I was thinking that during the build the Visual Studio will add all the required code from these dlls to a binary. So I was wrong and now have to fix it?... If yes, then what exactly should I perform?

      posted in Cinema 4D SDK
      Y
      yaya
    • RE: Plugin does not appear in Expression on client's Cinema 4D

      @Havremunken I have a logging for a licensing system. And in the debugging we can see the process of plugin initialization (of course testing it on the developer's side).
      But on my side the plugin initializes as expected.
      Client has some rare problem which I cannot even understand a possible root.

      posted in Cinema 4D SDK
      Y
      yaya