资源文件手册
Resource files are used to define the settings of dialogs and parameter descriptions. Resource files are:
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(). case C4DPL_INIT_SYS : { // don't start plugin without resource if ( g_resource . Init () == false ) return false ; return true ; }见 插件函数手册 .
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 手册 ).
For detailed information see 对话框布局 and Dialog Resource
// This example loads a dialog layout from a resource file and edits it.// 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 ; }
描述 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 配准 .
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() (见 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 .