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
    • Register
    • Login
    1. Maxon Developers Forum
    2. Filip
    3. Best
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 49
    • Best 5
    • Controversial 0
    • Groups 0

    Best posts made by Filip

    • RE: Viewport render and camera FOV

      Hi again,
      Thanks for your input! I have found the solution now:

      The issue was not the camera field of view, but how I calculated the bounds of the viewplane (image plane). C4d fits the aspect ratio of the final render resolution into the size of the viewport in a specific way, that I reverse engineered. Here is the code for my solution, in case anyone else has the same problem:

      double f=double(resolution[1])/double(resolution[0]);
      double f2 =double(renderdata_resolution[1])/double(renderdata_resolution[0]);
      double c = f2 / f;
      
      double screen_window[4];
      screen_window[0] = -1*c;
      screen_window[1]=-f*c;
      screen_window[2] = 1*c;
      screen_window[3]=f*c;
      

      In the above code, "resolution" is the resolution, in pixels, of the viewport and "renderdata_resolution" is the resolution we would have if rendering to the picture viewer.

      /Filip

      posted in Cinema 4D SDK
      F
      Filip
    • SDK for node based materials, status?

      Hi!
      Are there any news on the SDK for node based materials? I'm interested in the following:

      • accessing all the nodes in a given material, as well as their connections.
        -creating my own custom nodes.

      Are these things possible with the current SDK?

      Cheers
      /Filip

      posted in Cinema 4D SDK r21 sdk
      F
      Filip
    • RE: Custom register plugin

      @WickedP said in Custom register plugin:

      I have a dialog plugin with a graphical interface. I'd like to be able to register plugins for my plugin, so that I can build them separately if needed, or perhaps so others in the future may be able to.

      Hi WickedP!
      We are doing something similar in the 3delightForCinema4D renderer plugin. (source available here: https://gitlab.com/3Delight/3delight-for-cinema-4d/. We have a custom plugin system, separate from the normal c4d one, that allows 3rd party modules to add functionality to our plugin.

      This is handled via the "PluginMessage" function. When c4d has loaded, our plugin sends a special message to all other plugins, and passes along a pointer to a "pluginmanager" structure. Other plugins can then respond to this message, and register their plugins via the pluginmanager. You can see how this works in our source code. Some hints on where to look:

      The "API" for our plugin system consists of a few header files, describing the supported plugin types (called "hooks" and "translators"):

      https://gitlab.com/3Delight/3delight-for-cinema-4d/-/tree/master/3Delight/API/include

      Here is the main file of the module that manages plugin loading: https://gitlab.com/3Delight/3delight-for-cinema-4d/-/blob/master/3Delight/source/main.cpp

      The "PluginMessage" function in this file is where the message to load custom plugins is sent (in response to "C4DPL_STARTACTIVITY".

      Here is the main file of an example separate module that registers a number of plugins:
      https://gitlab.com/3Delight/3delight-for-cinema-4d/-/blob/master/3Delight Geometry/source/main.cpp

      I hope this description is somewhat clear. We have found it to be a really straightforward but powerful way of designing a custom plugin system for c4d! Let me know if you have any questions.

      Best regards
      /Filip

      posted in Cinema 4D SDK
      F
      Filip
    • RE: Copying/Pasting GvNodes?

      "PS: There are also the copy buffer methods on GvNodeMaster if you want to preserve connections, copy multiple nodes at once etc.:"
      -That looks like it might be exactly what I need! Thanks a lot!

      posted in Cinema 4D SDK
      F
      Filip
    • RE: GvNodeMaster::Execute() returns error

      @ferdinand said in GvNodeMaster::Execute() returns error:

      Since you do your own stuff, this could for example fail in the DL_TERMINAL node you implemented in addition to some of the init stuff going wrong.

      I have confirmed that the error seems to come from my own GvOperatorData()-plugins (shader nodes). When I delete all my own nodes in the graph and only use the build in c4d xpresso nodes, then GvNodeMaster updates correctly. I will look into this, but now I know where to look! We can mark this as solved for now.

      "I can of course also just have a look at it, but I will not be able to run your project to see and tell you why it fails exactly"
      At this stage, I was just looking for general feedback on how and when the Execute() function was supposed to work correctly, i.e., if it needed to be called in a special context or similar. This is also why I did not post detailed code initially. I don´t fully agree that detailed code is always needed to discuss an issue, even if it of course sometimes helps in clarifying things! Anyway, thanks a lot for the good support, it is really helpful and I appreciate the availability of this forum - it really helps!

      Best regards
      /Filip

      posted in Cinema 4D SDK
      F
      Filip