### Start NetworkUdpServerInterface Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_network_udp_server_interface Starts the UDP server. This method initiates the server's listening process. It returns an error if the server is already running or if socket setup fails. Successful startup enables the server to receive incoming packets. ```cpp MAXON_METHOD Result Start(); ``` -------------------------------- ### Start UDP Server with Callback (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_maxonapi_udp This C++ code snippet demonstrates how to initialize and start a UDP server using the `maxon::NetworkUdpInterface`. It requires an `AioServiceRef` and defines a callback function (`UDPCallback`) to handle incoming data. The server listens on a specified port (1000 in this example). ```cpp // create AioServiceRef g_ioService = maxon::AioServiceRef::Create() iferr_return; g_ioService.Start() iferr_return; // create and start server auto localAddr = maxon::NetworkIpAddrPort(maxon::WILDCARD_IPV4_ADDRESS, 1000); g_udpServer = maxon::NetworkUdpInterface::CreateUdpServer(localAddr, UDPCallback, g_ioService) iferr_return; g_udpServer.Start() iferr_return; ``` -------------------------------- ### Parameter Access Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_resource_toollensdistortion Parameters are accessed using C4DAtom::GetParameter() and C4DAtom::SetParameter(). Refer to the 'Getting Started' guide for more details. ```APIDOC ## Parameter Access ### Description Parameters are accessed with C4DAtom::GetParameter()/ C4DAtom::SetParameter(). See page_maxonapi_getting_started_foundations_cinema_parameters. ### Method Not applicable (Code Snippet) ### Endpoint Not applicable (Code Snippet) ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Invoke Example Command with Data Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_maxonapi_command Demonstrates how to create, set data for, and invoke the 'EXAMPLE' command using Maxon API C++. It also shows how to retrieve the result. ```cpp // create data maxon::CommandDataRef data = maxon::CommandDataClasses::EXAMPLEDATA().Create() iferr_return; data.Set(0, maxon::Int32(100)) iferr_return; data.Set(1, maxon::Int32(200)) iferr_return; // invoke command const auto command = maxon::CommandClasses::EXAMPLE(); const maxon::COMMANDRESULT res = data.Invoke(command, false) iferr_return; if (res != maxon::COMMANDRESULT::OK) return maxon::OK; // get result const maxon::Int32 resultValue = data.Get(2) iferr_return; DiagnosticOutput("Result: @", resultValue); ``` -------------------------------- ### Start() Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_network_zero_conf_browser_interface Registers and starts the ZeroConf browser. It's recommended to set up signals before starting. ```APIDOC ## Start() ### Description Registers and starts the ZeroConf browser. Ensure that signals (ObservableDetect, ObservableResolved) are set up before starting the browser. ### Method MAXON_METHOD Result ### Endpoint N/A ### Parameters None ### Request Example None ### Response - **Result** - Indicates the success or failure of the operation. ### Response Example None ### Error Handling None ``` -------------------------------- ### Parameter Access Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_resource_ocharacterbase Parameters are accessed using C4DAtom::GetParameter() and C4DAtom::SetParameter(). Refer to the Maxon API Getting Started guide for foundational concepts. ```APIDOC ## Parameter Access ### Description Parameters are accessed with C4DAtom::GetParameter()/ C4DAtom::SetParameter(). See page_maxonapi_getting_started_foundations_cinema_parameters. ### Method N/A (Code Snippet) ### Endpoint N/A (Code Snippet) ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Parameter Access Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_resource_dmodeling Parameters are accessed using the C4DAtom::GetParameter() and C4DAtom::SetParameter() methods. Refer to the 'Getting Started' guide for more details on foundations and Cinema parameters. ```APIDOC ## Parameter Access ### Description This section outlines how to access and manipulate parameters within the Maxon API using provided C++ methods. ### Method `C4DAtom::GetParameter()` / `C4DAtom::SetParameter()` ### Endpoint N/A (C++ API) ### Parameters N/A (C++ API methods) ### Request Example ```cpp // Example of getting a parameter BaseContainer bc; C4DAtom* atom = ...; // Get your atom object maxon::Bool enabled; atom->GetParameter(SNAP_SETTINGS_ENABLED, bc, DESCFLAGS_GET); // Example of setting a parameter atom->SetParameter(SNAP_SETTINGS_ENABLED, bc, DESCFLAGS_SET); ``` ### Response #### Success Response Parameters are retrieved or set directly via the C++ methods. #### Response Example N/A (C++ API) ``` -------------------------------- ### Create New Solution with Plugin (projectdefinition.txt) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_getting_started_sdk_win This configuration snippet demonstrates how to create a new, independent solution containing only a custom plugin, 'myplugin'. It specifies the target platforms and lists only the plugin project in the 'Solution' directive. This approach is suitable for a clean working environment without the SDK examples. ```text // The platforms this solution is targeting - can be [Win64;OSX;Linux]. Platform=Win64;OSX;Linux // The type of this definition, a solution. Type=Solution // The plugin projects that are part of this solution. Each of them will be compiled into its own // binary and corresponds to a folder in /plugins/, each with its own projectdefinition.txt file. Solution=\ plugins/myplugin ``` -------------------------------- ### Get GUID Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_base_override_group Retrieves the Globally Unique Identifier (GUID) of an object. ```APIDOC ## GetGUID ### Description Returns the unique 64-bit identifier for this object. ### Method `UInt64` ### Request Example ```cpp UInt64 guid = GetGUID(); ``` ``` -------------------------------- ### Create New Solution with a Single Plugin Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_getting_started_sdk_osx This configuration demonstrates how to create a new solution containing only a specific plugin. It defines the target platforms and lists only the desired plugin directory. ```text // The platforms this solution is targeting - can be [Win64;OSX;Linux]. Platform=Win64;OSX;Linux // The type of this definition, a solution. Type=Solution // The plugin projects that are part of this solution. Each of them will be compiled into its own // binary and corresponds to a folder in /plugins/, each with its own projectdefinition.txt file. Solution= plugins/myplugin ``` -------------------------------- ### StartWebServer Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_network_web_socket_server_interface Starts a new web server instance on a specified network address and port. It can optionally wait until the server is listening and check for a requested protocol during the handshake. ```APIDOC ## POST /websites/developers_maxon_net_cpp_2024_5_1/StartWebServer ### Description Starts a new web server using the given port. The function can optionally wait until the listener is open and verify a requested protocol during the handshake. ### Method POST ### Endpoint /websites/developers_maxon_net_cpp_2024_5_1/StartWebServer ### Parameters #### Query Parameters - **_addressAndPort_** (NetworkIpAddrPort) - Required - The network address and port to listen on. - **_waitForListener_** (Bool) - Optional - If true, the function waits until the listener is open. Otherwise, it returns immediately. - **_requestedProtocol_** (String) - Optional - The protocol to check within the handshake. This will be compared to the "sec-websocket-protocol" property of the incoming HTTP header. ### Response #### Success Response (200) - **Result** (void) - OK on success. #### Response Example ```json { "status": "OK" } ``` ``` -------------------------------- ### GetStartTime() Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_c_curve Gets the start time of the curve. Returns the BaseTime object representing the curve's start time. ```APIDOC ## GetStartTime() ### Description Gets the start time of the curve. Returns the BaseTime object representing the curve's start time. ### Method `BaseTime GetStartTime() const` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```cpp // Example usage: BaseTime startTime = GetStartTime(); ``` ### Response #### Success Response (200) - **startTime** (BaseTime) - The start time of the curve. #### Response Example ```json { "startTime": "0.0" } ``` ``` -------------------------------- ### Get GUID Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_cloud_object Retrieves the unique GUID of an object. ```APIDOC ## GET /websites/developers_maxon_net_cpp_2024_5_1/GetGUID ### Description Returns the globally unique identifier (GUID) for the current object. This identifier is used for uniquely referencing objects within the system. ### Method GET ### Endpoint /websites/developers_maxon_net_cpp_2024_5_1/GetGUID ### Response #### Success Response (200) - **guid** (UInt64) - The unique GUID of the object. ### Response Example ```json { "guid": 1234567890123456789 } ``` ``` -------------------------------- ### Load Assets into a GUI (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_handbook_assetapi_implement_preset_asset_type Demonstrates how to load preset assets into a custom GUI. It includes type checking, asset loading, casting, and calling the asset type implementation to load the data. Dependencies include maxon::AssetDescription, maxon::Asset, maxon::BasePresetAsset, maxon::PresetLoadArgs, and maxon::AssetTypes. ```cpp maxon::Result DotsGui::LoadAsset(const maxon::AssetDescription& assetDescription) { iferr_scope; // Sort out any asset descriptions that are not of type DotsPresetAsset. if (!assetDescription) return maxon::UnexpectedError(MAXON_SOURCE_LOCATION, "Invalid asset description."_s); if (assetDescription.GetTypeId() != maxon::AssetTypes::DotsPresetAsset().GetId()) return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION, "Received unexpected asset type."_s); // Load the asset and attempt to cast it to a BasePresetAsset. maxon::Asset asset = assetDescription.Load() iferr_return; maxon::BasePresetAsset preset = maxon::Cast(asset); if (!preset) return maxon::UnexpectedError(MAXON_SOURCE_LOCATION, "Failed to cast asset to preset asset."_s); // Prepare the PresetLoadArgs to send to the DotsPresetAssetImpl to load the data. The arguments // will point to #this GUI, so that the DotsPresetAssetImpl can load the asset into it. maxon::PresetLoadArgs dataContainer; dataContainer.SetPointer(this) iferr_return; // Call the dots asset type implementation to load #preset into #this GUI. if (!maxon::AssetTypes::DotsPresetAsset().LoadPreset(preset, dataContainer)) return maxon::UnexpectedError(MAXON_SOURCE_LOCATION, "Could not load asset."_s); return maxon::OK; } ``` -------------------------------- ### Get Preview Start Time (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_material_preview_data Retrieves the start time of the preview. Returns a Float value. ```cpp Float GetPreviewStartTime() ``` -------------------------------- ### Initialize and Start a Simple Web Server (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_maxonapi_webserver This C++ code snippet demonstrates how to initialize and start a simple web server using the maxon::NetworkWebServerInterface. It includes setting the server name, address, and registering a callback for handling incoming requests. Dependencies include maxon::NetworkWebServerClass, maxon::String, maxon::NetworkIpAddrPort, and DiagnosticOutput. ```cpp // This example starts a simple web-server. The behaviour // of the sever is defined with the callback function. // create server instance g_server = maxon::NetworkWebServerClass().Create() iferr_return; const maxon::String name("ExampleServer"); // server name must pass maxon::IsAlphabetic() auto serverAddr = maxon::NetworkIpAddrPort(maxon::WILDCARD_IPV4_ADDRESS, maxon::WILDCARD_IP_PORT); const bool useSSL = false; // start server g_server.Init(useSSL, serverAddr, name) iferr_return; g_server.StartServer(true) iferr_return; DiagnosticOutput("WebServer started on port @", g_server.GetServerPort()); // define behaviour g_server.ObservableHandleRequest(true).AddObserver(WebServerCallback) iferr_return; ``` -------------------------------- ### Get GUID Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_volume_set Retrieves the Globally Unique Identifier (GUID) of an object. ```APIDOC ## GetGUID ### Description Returns the unique identifier for this object, ensuring global uniqueness across different instances and systems. ### Method `UInt64` ### Parameters None ``` -------------------------------- ### HairMaterialData: Get Guide Material Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_hair_material_data-members Retrieves the material identifier for a given hair guide. It can optionally take a previous guide index for context. This method belongs to the HairMaterialData class. ```cpp GetGuideMaterial(Int32 i, Int32 prev=NOTOK) ``` -------------------------------- ### Create Component Instance (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_component_with_base Static methods for creating and initializing component instances. Includes a generic CreateInit for variadic arguments and specific private methods for constructing classes and instances with source location information. ```cpp template static Result< typename Ref::NonConst > CreateInit (ARGS &&... args) static Result< CLS > PrivateConstructClass (MAXON_SOURCE_LOCATION_DECLARATION, Id &cid) static Result< T > PrivateCreateInstance (MAXON_SOURCE_LOCATION_DECLARATION, Id &cid) ``` -------------------------------- ### Get GUID (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_base_object Generates and returns a unique 64-bit identifier (GUID) for any object within a document. This works for both 'real' objects and cached objects, though GUID generation for cache objects may depend on GetUniqueIP(). ```cpp UInt64 GetGUID() const; ``` -------------------------------- ### NetFrameInit() Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_video_post_data Called to set up all the data for a NET frame. This function is run on the server and prepares data for network rendering. ```APIDOC ## POST /websites/developers_maxon_net_cpp_2024_5_1/NetFrameInit ### Description Called to set up all the data for a NET frame. This function is run on the server and prepares data for network rendering. ### Method POST ### Endpoint /websites/developers_maxon_net_cpp_2024_5_1/NetFrameInit ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **node** (BaseVideoPost *) - Required - The BaseVideoPost connected with the VideoPostData instance. - **doc** (BaseDocument *) - Required - The active document. - **job** (RenderJob *) - Required - The render job. - **assignedClients** (Int32) - Required - The initial client count. - **renderData** (const NetRenderData *) - Required - The NET render data. - **frameBmp** (MultipassBitmap *) - Required - The multipass bitmap for storing results. - **bt** (BaseThread *) - Required - The render thread. - **realdepth** (Int32 &) - Output - Assign the real image depth. ### Request Example ```json { "node": "", "doc": "", "job": "", "assignedClients": 4, "renderData": "", "frameBmp": "", "bt": "" } ``` ### Response #### Success Response (200) - **return_value** (Bool) - true if successful, otherwise false. - **realdepth** (Int32) - The real image depth. #### Response Example ```json { "return_value": true, "realdepth": 24 } ``` ``` -------------------------------- ### Invoke MoGraph Setup Command Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_maxonapi_command Illustrates the process of preparing data for and invoking the 'MOGRAPHSETUP' command using Maxon API C++. It includes setting legacy data and retrieving results. ```cpp // prepare mograph data // no object is set; the active object of the given document should be used MoGraphSetupData data; data._doc = doc; data._object = nullptr; const maxon::Int dataIndex = 0; // create data maxon::LegacyCommandDataRef legacyData = maxon::LegacyCommandDataClasses::MOGRAPHSETUPDATA().Create() iferr_return; legacyData.SetLegacyData(data, dataIndex) iferr_return; // invoke command const auto command = maxon::CommandClasses::MOGRAPHSETUP(); const maxon::COMMANDRESULT res = legacyData.Invoke(command, false) iferr_return; if (res != maxon::COMMANDRESULT::OK) return maxon::OK; // get result const MoGraphSetupData result = legacyData.GetLegacyData(dataIndex) iferr_return; result._cloner->SetName("The New Cloner"_s); ``` -------------------------------- ### Accessing Hair Guide Tangent and Transformation Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_hair_guides-members Functions to retrieve tangent vectors at specific points along a hair guide and to get the guide's overall transformation matrix. Essential for understanding guide orientation and deformation. ```cpp Float GetTangent(Int32 guide, Int32 segment, Float t); const Matrix& GetTransformMatrix(); ``` -------------------------------- ### Node Space Initialization (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_manual_nodespaceinterface_impl Demonstrates the Init() method for a Maxon node space implementation. It initializes components, sets node space properties, and registers various callbacks and node types within the provided DataDictionary. ```cpp class ExampleNodeSpaceImpl : public maxon::Component { MAXON_COMPONENT(NORMAL, maxon::nodes::NodeSpaceBaseClass); public: static maxon::Result CreateMaterialGraph(const maxon::nodes::NodesGraphModelRef& graph) { iferr_scope; // Instantiate a node that only has a description, but no process function. maxon::nodes::NodeTemplate userNodeSystem = maxon::nodes::NodesLib::LoadTemplate(maxon::AssetInterface::GetBuiltinRepository(), maxon::Id("net.maxonexample.nodes.docexample.endnode")) iferr_return; maxon::GraphNode userGraphNode = graph.AddChild(maxon::Id("user node instance"), userNodeSystem) iferr_return; return maxon::OK; } static maxon::Result ConfigurePreviewImageRequest(maxon::DataDictionaryObjectRef request) { iferr_scope; request.Set(maxon::nodes::PREVIEWIMAGEREQUEST::PROVIDER, ExampleImageProviderImpl::GetClass()) iferr_return; return maxon::OK; } MAXON_METHOD maxon::Result Init(maxon::DataDictionary spaceData) { iferr_scope; _class = ExampleNodeSystemClassImpl::GetClass().Create() iferr_return; spaceData.Set(maxon::nodes::NODESPACE::CREATEMATERIALGRAPHFUNC, maxon::nodes::NODESPACE::CreateMaterialGraphFunc(CreateMaterialGraph)) iferr_return; // define end-nodes maxon::BaseArray materialEndNodeIds; materialEndNodeIds.Append(maxon::Id("net.maxonexample.nodes.docexample.endnode")) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::MATERIALENDNODEIDS, std::move(materialEndNodeIds)) iferr_return; // define nodes using preview scenes maxon::BaseArray materialPreviewNodeIds; materialPreviewNodeIds.Append(maxon::Id("net.maxonexample.nodes.docexample.endnode")) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::MATERIALPREVIEWIDS, std::move(materialPreviewNodeIds)) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::CONFIGUREPREVIEWIMAGEREQUESTFUNC, maxon::nodes::NODESPACE::ConfigurePreviewImageRequestFunc(ConfigurePreviewImageRequest)) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::NODESYSTEMCLASS, _class) iferr_return; spaceData.Set(maxon::nodes::NODESPACE::IMAGENODEASSETID, maxon::Id()) iferr_return; super.Init(spaceData) iferr_return; return maxon::OK; } private: maxon::nodes::NodeSystemClass _class; }; MAXON_COMPONENT_OBJECT_REGISTER(ExampleNodeSpaceImpl, g_nodeSpaceExampleSpaceID); ``` -------------------------------- ### Get Methods (O) Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_g This section details various 'Get' methods starting with 'O' available in the Maxon C++ SDK, covering functionalities related to offsets, operations, operating systems, and more. ```APIDOC ## Get Methods (O) ### Description This section details various 'Get' methods starting with 'O' available in the Maxon C++ SDK, covering functionalities related to offsets, operations, operating systems, and more. ### Method Various (primarily GET-like operations) ### Endpoint N/A (C++ SDK methods) ### Parameters N/A ### Request Example N/A ### Response Various return types depending on the method. #### Success Response (200) - **Return Type** (Type) - Description of the returned data. #### Response Example ```cpp // Example for GetOffset() CameraObject offset_data = some_object.GetOffset(); // Example for GetOperatingSystem() const Char* os_name = Machine.GetOperatingSystem(); ``` ### API Endpoints #### GetOffset() * **Description**: Retrieves an offset value. * **Return Type**: CameraObject, FieldInput, FieldOutputBlockTemplate< CONSTBLOCK >, TupleStorage< T1 >, TupleStorage< T1, T2 >, TupleStorage< T1, T2, T3 >, TupleStorage< T1, T2, T3, T4 >, TupleStorage< T1, T2, T3, T4, T5 >, TupleStorage< T1, UnitType >, TupleStorageLayout< INDEX, PRE_OFFSET, PRE_MAX_ALIGN >, TupleStorageLayout< INDEX, PRE_OFFSET, PRE_MAX_ALIGN, SZ_ALIGN, REST... >, SculptLayer, SculptLayerData #### GetOffsetFromReal() * **Description**: Retrieves an offset from a real value. * **Return Type**: SplineHelp #### GetOffsetFromUnit() * **Description**: Retrieves an offset from a unit value. * **Return Type**: SplineHelp #### GetOffsetVector() * **Description**: Retrieves an offset as a vector. * **Return Type**: Kerning #### GetOpContainerInstance() * **Description**: Gets an instance of an operator container. * **Return Type**: GvNode #### GetOpenState() * **Description**: Retrieves the open state. * **Return Type**: GvNode #### GetOperatingSystem() * **Description**: Retrieves the name of the operating system. * **Return Type**: Machine, NetLibrary #### GetOperationCountForSearch() * **Description**: Gets the operation count for a search. * **Return Type**: ArrayMap< K, V, SORTED, COMPARE, ARRAY >, ArraySet< T, SORTED, COMPARE, ARRAY >, BurstTrieMap< K, V, GROUP_BITS, BUCKET_SIZE, SORT, POOL >, BurstTrieSet< T, GROUP_BITS, BUCKET_SIZE, SORT, POOL >, HashMap< K, V, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR, ENTRY_ALLOCATOR >, HashSet< T, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR, ENTRY_ALLOCATOR >, HybridMap< K, V, SMALL, LARGE, THRESHOLD, REVERSE_THRESHOLD >, HybridSet< T, SMALL, LARGE, THRESHOLD, REVERSE_THRESHOLD > #### GetOperator() * **Description**: Retrieves an operator. * **Return Type**: TP_MasterSystem #### GetOperatorContainer() * **Description**: Gets the operator container. * **Return Type**: GvNode #### GetOperatorData() * **Description**: Retrieves operator data. * **Return Type**: GvNode #### GetOperatorDescription() * **Description**: Gets the description of an operator. * **Return Type**: GvOperatorData #### GetOperatorID() * **Description**: Retrieves the ID of an operator. * **Return Type**: GvNode, TP_MasterSystem #### GetOpt() * **Description**: Retrieves an optional parameter. * **Return Type**: AttributeTuple< OPT, ARGS > #### GetOptimalPixelFormat() * **Description**: Gets the optimal pixel format. * **Return Type**: ImagePixelBlendInterface #### GetOrAllocClass() * **Description**: Gets or allocates a class. * **Return Type**: ObservableStaticInterface #### GetOrCreate() * **Description**: Gets or creates an object. * **Return Type**: GenericDataTemplate< REFCOUNTED > #### GetOrCreateMTable() * **Description**: Gets or creates a material table. * **Return Type**: ClassInterface #### GetOrDefault() * **Description**: Gets a value or a default if not found. * **Return Type**: BaseRef< T, HANDLER >, ConstDataPtr, Data, DataDictionaryInterface, DataDictionaryObjectInterface, ParameterStorageInterface #### GetOrigin() * **Description**: Retrieves the origin of an object. * **Return Type**: BaseObject, BaseTag, GraphMessageInterface #### GetOriginal() * **Description**: Retrieves the original data. * **Return Type**: NodesGraphHelpersInterface #### GetOriginalEdgePoints() * **Description**: Retrieves the original edge points. * **Return Type**: Modeling #### GetOriginalModificationStamp() * **Description**: Retrieves the original modification stamp. * **Return Type**: NodesGraphHelpersInterface #### GetOriginalObject() * **Description**: Retrieves the original object. * **Return Type**: SculptObject #### GetOriginalPoints() * **Description**: Retrieves the original points. * **Return Type**: BrushDabData #### GetOriginalVertexNormals() * **Description**: Retrieves the original vertex normals. * **Return Type**: BrushDabData #### GetOriginData() * **Description**: Retrieves the origin data. * **Return Type**: AssetLinkInterface #### GetOriginDocumentDirectoryPath() * **Description**: Retrieves the directory path of the origin document. * **Return Type**: NetLibrary, NetRenderData #### GetOriginNgon() * **Description**: Retrieves the origin Ngon. * **Return Type**: Modeling #### GetOriginPoint() * **Description**: Retrieves the origin point. * **Return Type**: Modeling #### GetOrNull() * **Description**: Retrieves a pointer or null if not found. * **Return Type**: ComponentWithBase< C, BASE, INTERFACE, INTERFACES >, ConstDataPtr, Data #### GetOtherHand() * **Description**: Retrieves the other hand. * **Return Type**: GraphEdgeBase< NODE > #### GetOutgoing() * **Description**: Retrieves outgoing connections. * **Return Type**: GvPort #### GetOutPort() * **Description**: Retrieves an output port. * **Return Type**: GvNode #### GetOutPortCount() * **Description**: Gets the number of output ports. * **Return Type**: GvNode #### GetOutPortFirstMainID() * **Description**: Retrieves the main ID of the first output port. * **Return Type**: GvNode #### GetOutPortMainID() * **Description**: Retrieves the main ID of an output port. * **Return Type**: GvNode #### GetOutPortSubID() * **Description**: Retrieves the sub ID of an output port. * **Return Type**: GvNode #### GetOutputs() * **Description**: Retrieves the outputs of a node or function. * **Return Type**: FunctionDataType, GraphNodeFunctions< BASE >, NodeFunctions< BASE > #### GetOutputStream() * **Description**: Retrieves an output stream. * **Return Type**: IoDualInOutputStreamInterface #### GetOutputStreams() * **Description**: Retrieves multiple output streams. * **Return Type**: MediaConverterInterface #### GetOutputUrl() * **Description**: Retrieves the URL of an output. * **Return Type**: MediaOutputUrlInterface #### GetOverrideEnabling() * **Description**: Retrieves the override enabling status. * **Return Type**: TakeData #### GetOverrideGroups() * **Description**: Retrieves the override groups. * **Return Type**: BaseTake #### GetOverrideParam() * **Description**: Retrieves an overridden parameter. * **Return Type**: BaseOverride #### GetOverrideRoot() * **Description**: Retrieves the root of the overrides. * **Return Type**: BaseList2D #### GetOverrides() * **Description**: Retrieves all overrides. * **Return Type**: BaseTake #### GetOwner() * **Description**: Retrieves the owner of an object. * **Return Type**: BiRenderObject, FieldOutputBlockTemplate< CONSTBLOCK >, GvNodeMaster, DirectPortAccess< PORT, OWNER >, IndexedPortAccess< ACCESS >, MappedPortAccess< PORT, OWNER >, FunctionBaseInterface, ObservableBaseInterface #### GetOwnerID() * **Description**: Retrieves the ID of the owner. * **Return Type**: GvNode #### GetOwnerTake() * **Description**: Retrieves the take data of the owner. * **Return Type**: BaseOverride #### GetP() * **Description**: Retrieves a point or position. * **Return Type**: CAMorphNode #### GetP1() * **Description**: Retrieves the first point or position. * **Return Type**: GeColliderEngine #### GetP2() * **Description**: Retrieves the second point or position. * **Return Type**: GeColliderEngine #### GetPackages() * **Description**: Retrieves the packages. * **Return Type**: Package #### GetPackedPixelCount() * **Description**: Gets the number of packed pixels. * **Return Type**: PixelFormatInterface #### GetPaintBitmap() * **Description**: Retrieves the paint bitmap. * **Return Type**: MultipassBitmap #### GetPainterMesh() * **Description**: Retrieves the painter mesh. * **Return Type**: BaseDrawHelp #### GetPaintMaterial() * **Description**: Retrieves the paint material. * **Return Type**: PaintMaterial #### GetPaintMaterialFromTexture() * **Description**: Retrieves paint material from a texture. * **Return Type**: PaintMaterial #### GetPaintTexture() * **Description**: Retrieves the paint texture. * **Return Type**: PaintBitmap #### GetPaintTextureHead() * **Description**: Retrieves the head of the paint texture. * **Return Type**: PaintTexture #### GetPaintTextureOfBaseChannel() * **Description**: Retrieves the paint texture of a base channel. * **Return Type**: PaintTexture #### GetParam() * **Description**: Retrieves a parameter. * **Return Type**: CAMorphNode #### GetParamCount() * **Description**: Gets the number of parameters. * **Return Type**: CAMorphNode #### GetParameter() * **Description**: Retrieves a parameter by name or ID. * **Return Type**: BaseContainer, C4DAtom, CAWeightMgr, CustomDataTypeClass, Description, LayerShaderLayer, MultipassBitmap #### GetParameterData() * **Description**: Retrieves the data of a parameter. * **Return Type**: BaseDraw #### GetParameterDescription() * **Description**: Retrieves the description of a parameter. * **Return Type**: CTrack #### GetParameterI() * **Description**: Retrieves a parameter by index. * **Return Type**: Description #### GetParameterMax() * **Description**: Retrieves the maximum value of a parameter. * **Return Type**: DWGObjectsLib, xCircularCurveData #### GetParameterMin() * **Description**: Retrieves the minimum value of a parameter. * **Return Type**: DWGObjectsLib, xCircularCurveData #### GetParameters() * **Description**: Retrieves all parameters. * **Return Type**: MaterialExportInterface, NodeMaterialExportInterface, Function, MTCharacterBodyPart #### GetParameterTypes() * **Description**: Retrieves the types of parameters. * **Return Type**: DelegateDataType, Function #### GetParametricType() * **Description**: Retrieves the parametric type. * **Return Type**: DataType, DataTypeImpl #### GetParametricTypeType() * **Description**: Retrieves the type of the parametric type. * **Return Type**: DataTypeLib #### GetParent() * **Description**: Retrieves the parent of an object. * **Return Type**: GeListHead, FrameData, GmlGraphInterface, GraphModelInterface, GraphNodeFunctions< BASE >, HierarchyObjectInterface, MultiIndex< INT_TYPE >, NodePathInterface, GNodeFunctions< BASE >, NodeFunctions< BASE >, NodeSystemInterface, PortFunctions< BASE >, TreeMapParent< PARENT, COW >, MTCharacterBodyPart, PaintBitmap #### GetParentBackgroundColor() * **Description**: Retrieves the parent background color. * **Return Type**: GeUserArea #### GetParentCategory() * **Description**: Retrieves the parent category. * **Return Type**: CategoryAssetInterface #### GetParentGroup() * **Description**: Retrieves the parent group. * **Return Type**: CoreNodeInstanceBaseInterface, CoreNodeInstanceInterface, MicroNodeInterface ``` -------------------------------- ### Zero Memory Initialization (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/structmaxon_1_1_is_zero_initialized_3_01_interned_id_01_4 Provides examples of zeroing memory using Maxon's provided functions and constants. This includes g_zeroMemory for general memory blocks and ZERO_MEMORY_SIZE for defining zero memory regions. ```cpp #include // Example using g_zeroMemory void* buffer = malloc(1024); g_zeroMemory(buffer, 1024); // Example using ZERO_MEMORY_SIZE (if applicable in a specific context) // This constant might be used to define a static zero-initialized array or buffer. ``` -------------------------------- ### Get Symbol Position in C++ Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_lexer_interface Returns the starting position of the current symbol within the stream. ```cpp MAXON_METHOD Result GetSymbolPosition() const; ``` -------------------------------- ### Get Root UV Information (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_func_g Retrieves the root UV coordinates for hair guides. ```cpp UV GetRootUV(); ``` -------------------------------- ### Configuration Initialization Macros Source: https://developers.maxon.net/docs/cpp/2024_5_1/pycore__initconfig_8h Macros for initializing configuration structures. ```APIDOC ## Macro Documentation ### _PyStatus_UPDATE_FUNC ```c #define _PyStatus_UPDATE_FUNC(err) ``` ### _PyWideStringList_INIT ```c #define _PyWideStringList_INIT ``` ### _PyPreCmdline_INIT ```c #define _PyPreCmdline_INIT ``` ``` -------------------------------- ### Initialization, Scripting, and UI Messages Source: https://developers.maxon.net/docs/cpp/2024_5_1/globals_m Messages for initial setup, script execution, and user interface interactions. ```APIDOC ## Initialization, Scripting, and UI Messages ### Description Messages related to initial channel setup, invoking script functions, and handling UI elements like item trees and menus. ### Endpoint N/A (Internal SDK messages) ### Parameters N/A ### Request Example N/A ### Response N/A #### Message List: - MSG_INITIALCHANNEL (c4d_baselist.h) - MSG_INVALIDATEHASH (c4d_baselist.h) - MSG_INVOKE_SCRIPT_FUNCTION (c4d_baselist.h) - MSG_ITEMTREE_CALLBACK (customgui_itemtree.h) - MSG_KERNING_GETGUIHELPER (customgui_kerning.h) - MSG_MATERIAL_OVERRIDE (c4d_baselist.h) - MSG_MATERIALDRAGANDDROP (c4d_baselist.h) - MSG_MENUPREPARE (c4d_baselist.h) ``` -------------------------------- ### Get Root Data Information (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_func_g Retrieves the root data associated with hair guides. ```cpp HairGuidesData GetRootData(); ``` -------------------------------- ### Save Assets from a GUI (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_handbook_assetapi_implement_preset_asset_type Provides an example pattern for creating preset assets from data attached to a custom GUI. It involves creating save arguments, specifying asset type and name, and calling the asset creation interface. Dependencies include maxon::PresetSaveArgs, maxon::AssetTypes, and maxon::AssetCreationInterface. ```cpp maxon::Result DotsGui::SaveAsset() { iferr_scope; // Create an instance PresetSaveArgs and point to _data, the instance of DotsData attached to this // GUI, in it. maxon::PresetSaveArgs data(&_data, 0); // The strings for the asset type name and asset name. #SaveBrowserPreset will allow the user to // modify the asset name. const maxon::String typeName = maxon::AssetTypes::DotsPresetAsset().GetName(); const maxon::String assetName("Dots Preset"); // Call #AssetCreationInterface::SaveBrowserPreset for the type #DotsPresetAsset and the prepared // PresetSaveArgs. It will cause the DotsPresetAssetTypeImpl to be called to save the asset with // the given PresetSaveArgs #data wrapping the instance of DotsData of this GUI. maxon::AssetCreationInterface::SaveBrowserPreset(maxon::AssetTypes::DotsPresetAsset(), data, typeName, assetName, false, false, false) iferr_return; return maxon::OK; } ``` -------------------------------- ### GUID and Icon Retrieval in Maxon C++ Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_instance_object-members Functions to get the Globally Unique Identifier (GUID) of a BaseObject and to retrieve icon data. The GetGUID method is const, while GetIcon requires an IconData pointer. ```cpp GetGUID() const| BaseObject| GetIcon(IconData *dat)| BaseList2D| ``` -------------------------------- ### Starting and Managing a Thread with ThreadInterface Source: https://developers.maxon.net/docs/cpp/2024_5_1/classmaxon_1_1_thread_interface Illustrates how to create, start, and manage a thread using the ThreadInterface. Threads are reference-counted and should be created using NewObj() or ThreadRef::Run()/ThreadRef::Create(). The example shows checking the return value and calling Start(). ```cpp ThreadRef thread = MyThread::NewObj(); if (thread) { Result res = thread->Start(THREADPRIORITY::NORMAL); if (res.IsError()) { // Handle error } } ``` -------------------------------- ### BaseBitmap Initialization Source: https://developers.maxon.net/docs/cpp/2024_5_1/page_manual_basebitmap Demonstrates how to initialize a BaseBitmap after creation, either by specifying dimensions or loading from an image file. ```APIDOC ## BaseBitmap Initialization ### Description Initializes a BaseBitmap either by defining its dimensions or by loading an image from a file. ### Methods - **BaseBitmap::Init(width, height, depth)**: Initializes the BaseBitmap with specified dimensions and bit depth. - **BaseBitmap::Init(filename)**: Initializes the BaseBitmap by loading an image from the given file. ### Example 1: Initialize with Dimensions ```cpp // This example creates a new BaseBitmap with Full HD resolution. // If the BaseBitmap could be created, it is filled with a random color. AutoAlloc bitmap; if (bitmap == nullptr) return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION); const Int32 width = 1920; const Int32 height = 1080; const Int32 depth = 24; const IMAGERESULT res = bitmap->Init(width, height, depth); if (res != IMAGERESULT::OK) return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION); // Fill with random colors Random randomGen; for (Int32 x = 0; x < width; ++x) { for (Int32 y = 0; y < height; ++y) { const Int32 red = Int32(randomGen.Get01() * COLORTOINT_MULTIPLIER); const Int32 green = Int32(randomGen.Get01() * COLORTOINT_MULTIPLIER); const Int32 blue = Int32(randomGen.Get01() * COLORTOINT_MULTIPLIER); bitmap->SetPixel(x, y, red, green, blue); } } // Show BaseBitmap in the Picture Viewer ShowBitmap(bitmap); ``` ### Example 2: Initialize by Loading from File ```cpp // This example opens a dialog to select an image file. // The selected file is loaded into a BaseBitmap and displayed // in the Picture Viewer window. Filename selectedImageFile; // select image file if (!selectedImageFile.FileSelect(FILESELECTTYPE::IMAGES, FILESELECT::LOAD, "Select Image"_s)) return maxon::OK; AutoAlloc bitmap; if (bitmap == nullptr) return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION); // load image file into the given BaseBitmap if (bitmap->Init(selectedImageFile) != IMAGERESULT::OK) return maxon::IoError(MAXON_SOURCE_LOCATION, MaxonConvert(selectedImageFile, MAXONCONVERTMODE::NONE), "Could not load image file."_s); // show BaseBitmap in the Picture Viewer ShowBitmap(bitmap); ``` ``` -------------------------------- ### Selection Management Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_kerning_data Methods for setting and getting the start and end points of a selection within the kerning data. ```APIDOC ## POST /api/kerningdata/selection/start ### Description Sets the starting point of the selection. ### Method POST ### Endpoint /api/kerningdata/selection/start ### Parameters #### Request Body - **start** (Int32) - Required - The starting index of the selection. ### Request Example ```json { "start": 5 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## GET /api/kerningdata/selection/start ### Description Gets the starting point of the selection. ### Method GET ### Endpoint /api/kerningdata/selection/start ### Parameters None ### Request Body None ### Response #### Success Response (200) - **start** (Int32) - The starting index of the selection. #### Response Example ```json { "start": 5 } ``` ## POST /api/kerningdata/selection/end ### Description Sets the ending point of the selection. ### Method POST ### Endpoint /api/kerningdata/selection/end ### Parameters #### Request Body - **end** (Int32) - Required - The ending index of the selection. ### Request Example ```json { "end": 15 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## GET /api/kerningdata/selection/end ### Description Gets the ending point of the selection. ### Method GET ### Endpoint /api/kerningdata/selection/end ### Parameters None ### Request Body None ### Response #### Success Response (200) - **end** (Int32) - The ending index of the selection. #### Response Example ```json { "end": 15 } ``` ## POST /api/kerningdata/selection/set ### Description Sets both the start and end points of the selection. ### Method POST ### Endpoint /api/kerningdata/selection/set ### Parameters #### Request Body - **start** (Int32) - Required - The starting index of the selection. - **end** (Int32) - Required - The ending index of the selection. ### Request Example ```json { "start": 5, "end": 15 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## GET /api/kerningdata/selection/length ### Description Gets the length of the current selection. ### Method GET ### Endpoint /api/kerningdata/selection/length ### Parameters None ### Request Body None ### Response #### Success Response (200) - **length** (Int32) - The length of the selection. #### Response Example ```json { "length": 10 } ``` ``` -------------------------------- ### Constructor and Method Examples in Maxon C++ API Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_b This section provides examples of constructors and key methods for various classes within the Maxon C++ API. These snippets illustrate how to instantiate and utilize core components for tasks such as baking, balancing, and managing data. ```cpp BackfaceCulling() BakeProgressInfo() BakeShaderIntoBaseBitmap() BakeWeights() Balance() BaseArray() BaseBitmap() BaseBitmapLink() BaseBitSet() BaseBitSetIterator() BaseChannel() BaseCollection() BaseContainer() BaseContext() BaseCustomGui() BaseDocument() BaseDraw() BaseDrawHelp() BaseFile() BaseInterface BaseIterator() BaseLink() BaseList() BaseList2D() BaseList2DToUuid() BaseListHead() BaseListLink() BaseListNode() BaseLock() BaseMaterial() BaseObject() BaseOverride() BaseOverrideGroup() BasePlugin() BaseRef BaseRefType BaseSceneHook() BaseSceneLoader() BaseSceneSaver() BaseSelect() BaseShader() BaseSound() BaseTag() BaseTake() BaseThread() BaseTime() BaseType BaseVideoPost() BaseVideoPostStruct() BaseView() BaseVolumeData() BatchIterator() BatchRender() BatchVarAccess() BeforeWrite() Begin() begin() ``` -------------------------------- ### NetFrameInit() Method Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_n Method to initialize a frame buffer in VideoPostData. ```APIDOC ## NetFrameInit() Method ### Description This method initializes a frame buffer for use within VideoPostData. ### Method - NetFrameInit() ### Returns - VideoPostData (type) ``` -------------------------------- ### Get Root Axis Information (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/functions_func_g Retrieves the root axis of hair guides, likely for orientation purposes. ```cpp Vector GetRootAxis(); ``` -------------------------------- ### Get Object Identifiers and Properties (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/class_particle_object Functions to retrieve unique identifiers like GUID, highlight handles, and the underlying spline object. Also includes methods to get and set object visibility and search its hierarchy. ```cpp UInt64 GetGUID () const; Int32 GetHighlightHandle (BaseDraw *bd); SplineObject * GetRealSpline (); const SplineObject * GetRealSpline () const; Float GetVisibility (Float parent) const; Bool SearchHierarchy (const BaseObject *op) const; ``` -------------------------------- ### Create Instance from System (C++) Source: https://developers.maxon.net/docs/cpp/2024_5_1/namespacemaxon_1_1nodes Creates an instance of a given node system using the InstantiationTrace's lookup repository. This method facilitates the creation of node system instances that can be further modified. It leverages the NodeSystem::CreateInstance functionality. ```cpp Result CreateInstance(const NodeSystem& system) const; ```