ExecutionInterface Manual

内容表

关于

maxon::ExecutionInterface is a template for a job that is executed on Cinema 4D startup.

注意
A maxon::ExecutionInterface is often used together with Configuration Variables to perform a task based on a given command line argument.
警告
The jobs defined with the ExecutionInterface are started as soon as all components of the MAXON API are loaded. At this point Cinema 4D itself and the classic API may not yet be available. So it is not advised to use any component of the classic API in this context.

用法

A new class is created based on the maxon::ExecutionInterface template. In this new class one must implement the function call operator "()" to define the code that should be executed.

// This example shows a simple implementation of a custom class based on ExecutionInterface.
class RegisterHelloWorldExecution : public maxon::ExecutionInterface <RegisterHelloWorldExecution> { public : maxon::Result<void> operator ()() { iferr_scope ;

// after Cinema has started, this text is printed to the console DiagnosticOutput ( "Hello World!" );

return maxon::OK ; } };

The new class must then be added to the maxon::ExecutionJobs registry:

// This example shows how a custom class based on ExecutionInterface is added to the ExecutionJobs registry. MAXON_DECLARATION_REGISTER (maxon::ExecutionJobs, "net.maxonexample.execution.helloworld" ) { return NewObj (RegisterHelloWorldExecution); }

The code defined in the function call operator will then be executed after Cinema 4D has started and loaded all resources.

注意
The jobs registered at ExecutionJobs are executed in alphanumerical order based on their IDs.

延伸阅读

MAXON_DECLARATION_REGISTER
#define MAXON_DECLARATION_REGISTER(...)
定义: module.h:872
maxon::OK
return OK
定义: apibase.h:2532
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
定义: debugdiagnostics.h:166
maxon::JobInterfaceTemplate
定义: job.h:1053
maxon::Result< void >
iferr_scope
#define iferr_scope
定义: resultbase.h:1343
NewObj
#define NewObj(T,...)
定义: newobj.h:108

Copyright  © 2014-2025 乐数软件    

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