Machines Manual

About

A maxon::MachineInterface interface represents either the local machine (running Cinema 4D) or a machine connected via RPC. Typically one accesses the local machine to obtain specific interfaces.

MachinesInterface

maxon::MachinesInterface gives access to the local or connected machines:

// This example lists all connected machines including the local machine.
for (auto machine : machines)
{
const maxon::DataDictionary machineInfo = machine.GetMachineInfo() iferr_return;
const maxon::String computerName = machineInfo.Get(maxon::MACHINEINFO::COMPUTERNAME) iferr_return;
DiagnosticOutput("Machine @", computerName);
}
Definition: basearray.h:415
static MAXON_METHOD Result< void > GetRPCMachines(WritableArrayInterface< MachineRef > &machines)
Definition: string.h:1237
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
#define iferr_return
Definition: resultbase.h:1524

MachineInterface

A maxon::MachineInterface represents the local machine or a connected machine.

The connection state is stored as maxon::MACHINESTATE.

General information on the machine can be obtained with:

// This example prints various infos on the local machine to the console.
const maxon::MachineRef localMachine = maxon::MachinesInterface::GetLocal();
const maxon::DataDictionary machineInfo = localMachine.GetMachineInfo() iferr_return;
const maxon::String computerName = machineInfo.Get(maxon::MACHINEINFO::COMPUTERNAME) iferr_return;
const maxon::String osVersion = machineInfo.Get(maxon::MACHINEINFO::OSVERSION) iferr_return;
const maxon::String uid = localMachine.GetUniqueId();
DiagnosticOutput("Machine @ (@) running @", computerName, uid, osVersion);
static MAXON_METHOD MachineRef GetLocal()

A maxon::MachineInterface gives access to various interfaces:

The maxon::MachineInterface provides this observable:

  • ObservableMessageReceived: Called when the machine receives a message.

Further Reading