Published Objects Implementation

内容表

关于

A published object can be implemented in a source code file within a plugin. This way the implementation can be kept private.

Implementation

The implementation of a published object is defined with the MAXON_DECLARATION_REGISTER attribute. It associates the given published object with the object created within the registration function.

注意
The registration function is called on Cinema 4D startup.
警告
If a published object is defined multiple times, all definitions will be discarded.
// This example shows the implementation of a published object. // Within the scope of MAXON_DECLARATION_REGISTER() the // published object is created and handed over to the program.
MAXON_DECLARATION_REGISTER (Carbon) { // create object SimpleAtom atom;

// configure object atom._protonCnt = 6; atom._neutronCnt = 6; atom._electronCnt = 6;

// return the object return atom; }

The implementation of an interface is registered and shared as a published object using the MAXON_COMPONENT_OBJECT_REGISTER attribute. See 接口实现 .

延伸阅读

MAXON_DECLARATION_REGISTER
#define MAXON_DECLARATION_REGISTER(...)
定义: module.h:872

Copyright  © 2014-2025 乐数软件    

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