资源文件手册

内容表

关于

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().

case C4DPL_INIT_SYS : { // don't start plugin without resource if ( g_resource . Init () == false ) return false ; return true ; }

插件函数手册 .

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 手册 ).

For detailed information see 对话框布局 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 ; }

Parameter Description Resources

描述 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 .

延伸阅读

GeResource::Init
Bool Init()
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
g_resource
GeResource g_resource
Global resources for Cinema 4D.
C4DPL_INIT_SYS
#define C4DPL_INIT_SYS
Initialize system.
定义: c4d_plugin.h:28
GeDialog::CreateLayout
virtual Bool CreateLayout(void)

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1