Open Search
    Resource Files Manual

    About

    Resource files are used to define the settings of dialogs and parameter descriptions. Resource files are:

    • header files that define IDs
    • *.res files that define the actual dialog or parameter description
    • *.str files that define strings for the given language

    Every Cinema 4D installation contains the resource files of Cinema 4D's modules and core in the "resource/modules" folder. These resource files can be used as a reference.

    Resources must be loaded before they can be used. They are typically loaded on start-up with the given GeResource instance.

    // This example loads the plugin's resources when
    // C4DPL_INIT_SYS is sent to PluginMessage().
    {
    // don't start plugin without resource
    if (g_resource.Init() == false)
    return false;
    return true;
    }
    #define C4DPL_INIT_SYS
    Initialize system.
    Definition: c4d_plugin.h:27
    GeResource g_resource
    Global resources for Cinema 4D.

    See Plugin Messages.

    GeDialog Resources

    GeDialog resource files define the layout and properties of dialog gadgets. The layout of a dialog is defined by implementing GeDialog::CreateLayout(). Within this function one can use GeDialog::LoadDialogResource() to load a resource file with the given ID (see GeDialog Manual).

    For detailed information see Dialog Layout and Dialog Resource

    // This example loads a dialog layout from a resource file and edits it.
    Bool CreateLayout()
    {
    // call default CreateLayout()
    if (!GeDialog::CreateLayout())
    return false;
    // load dialog from resource file
    if (!LoadDialogResource(DLG_CUSTOM_DIALOG, nullptr, 0))
    return false;
    // set a different title
    this->SetTitle("New Title"_s);
    // disable a GUI element
    this->Enable(IDC_CUSTOM_CHECKBOX, false);
    return true;
    }
    maxon::Bool Bool
    Definition: ge_sys_math.h:46

    Parameter Description Resources

    Description resources define the parameters of NodeData based plugins that are displayed in the Attribute Manager. The name of the resource files associated with a given plugin is defined with the "Register" function that is used to register the plugin itself. See Registration.

    NodeData based plugins typically must have dummy resource files, even if the parameter description is created dynamically. The description can be defined dynamically by implementing NodeData::GetDDescription() (see NodeData::GetDDescription() Manual). Within that function one can load a registered description using Description::LoadDescription().

    The loaded *.res files are parsed and the descriptions are stored using description parameters (see Description Settings Manual). A parameter description is interpreted and displayed by the DescriptionCustomGui GUI element.

    For detailed information see Description Resource.

    Further Reading