Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. Filip
    3. Best
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    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 •
    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 •
    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 •