#include <c4d_renderconnection.h>
Open/Close | |
Bool | Open (const Char *ip_address, Int32 application_id, Int32 initial_timeout, Int32 connection_timeout, Int32 retries=50) |
Bool | Close (Bool shutdown=true) |
License | |
Bool | OpenLicenseManager () |
Bool | SignOut () |
Send File | |
Bool | SendScenefile (const Filename &filepath) |
Bool | SendScenefile (const Filename &filepath, BaseDocument *doc) |
Bool | FrameScene (OVERVIEW mode, Vector &newPos, Vector &newRot) |
Bool | SetActiveObject (Int32 appid, const void *mem, Int32 size, Int32 mode=0) |
Update | |
Bool | UpdateScenefile (Int32 unique_id_type, BaseDocument *doc) |
Bool | UpdateView (const Vector &pos, const Vector &rot, Float focal_length, Float aperture, Float zoom, Int32 projection, Bool bNewCamera=false) |
Bool | UpdateCamera (BaseObject *op, Bool bNewCamera=false) |
Bool | UpdateSetActiveCamera (Int32 applicationUID, GeMarker cameraUID) |
Bool | UpdateDisplaySettings (BaseDraw *draw) |
Bool | UpdateRenderSettings (RenderData *rdat, Bool bKeepVP=false) |
Bool | UpdateTime (BaseTime time) |
Texture | |
Bool | UseTextureCache (Bool bKeepTextures) |
Bool | SendTexture (const Filename &filepath, void *mem, Int64 len, Bool memoryOnly) |
Bool | SendTextureRaw (const Filename &filepath, void *data, const COLORMODE &mode, const Int64 &width, const Int64 &height, const Int64 &rowBytes) |
Bool | FlushTexture (const Filename &filepath) |
Start/Stop Render | |
Bool | StartRender (Int32 xres, Int32 yres, ColorResolution colorresolution, Bool allow_saving, Bool high_priority) |
Bool | StopRender () |
Image Callback | |
Bool | GetImageUpdate (UpdateImage imgupdate, void *userdata, Bool *is_running) |
Bool | GetImageUpdateMP (Int32 vpbuffid, Int32 vpbuffsubid, UpdateImage imgupdate, void *userdata, Bool *is_running) |
Bool | GetFullImage (UpdateImage imgupdate, void *userdata, Bool *is_running) |
Bool | GetFullImageMP (Int32 vpbuffid, Int32 vpbuffsubid, UpdateImage imgupdate, void *userdata, Bool *is_running) |
Textures/Assets | |
Bool | GetAllTextures (BaseContainer *bc) |
Bool | GetAllAssets (BaseContainer *bc) |
Miscellaneous | |
Bool | ExportScene (const Filename &filepath, FILEFORMAT format) |
Bool | FreeSession () |
Bool | ResetRenderServer () |
Bool | GetC4dVersion (Int32 *version) |
Bool | GetC4dVersionType (VERSIONTYPE *type) |
Bool | GetPreferencePath (String &prefsPath) |
Bool | GetRenderStatus (Bool *is_running, Int32 *rendererror, Float *progress_percent, Int32 *progress_type) |
Bool | GetRenderErrorString (String &errorText) |
Bool | IsSceneAlive (Bool *is_alive) |
BaseList2D * | ConvertParameters (BaseList2D *node, CINEMA4D_VERSION version) |
Bool | BuildDescription (Int32 pluginId, BaseContainer &bc) |
BaseDocument * | RenderMaterials (BaseDocument *doc) |
Bool | FindPlugin (Int32 pluginId, Bool &found) |
Private. For AFX only. | |
Bool | UpdateLayer (BaseArray< GeMarker > &layerMarkers, Bool enableDefaultLayer) |
Bool | UpdateLayerEx (Int32 *array, Int32 count, Bool enableDefaultLayer) |
Bool | SetCurrentTake (const GeMarker &takeMarker) |
Bool | GetInfo (Int32 pluginID, Int32 *info) |
Communication thread to establish a connection to a render server and to control the rendering process.
Bool Open | ( | const Char * | ip_address, |
Int32 | application_id, | ||
Int32 | initial_timeout, | ||
Int32 | connection_timeout, | ||
Int32 | retries = 50 |
||
) |
Opens a connection to the render server at ip_address.
[in] | ip_address | IP address of the render server. The default IP (127.0.0.1:1234) is used if nullptr is passed. |
[in] | application_id | A unique ID provided by the external application. Provide different (unique) IDs to maintain multiple sessions at the same time. |
[in] | initial_timeout | Timeout in seconds after which the connection attempts shall be stopped (default 10 seconds). |
[in] | connection_timeout | Timeout in seconds after which the connection will be closed if no data has been sent since then (default 60 seconds). |
[in] | retries | Define how many times the function tries to connect. |
Closes the connection to the render server.
[in] | shutdown | The connection is closed if set to false but the session is still valid, so it is possible to open a new connection. In that case rendering will start then immediately, without the need to transfer the scene data again. The render server terminates if set to true. All open sessions will be freed. |
Bool OpenLicenseManager | ( | ) |
Opens the License Manager window.
Bool SignOut | ( | ) |
Sign-Out.
Transfers a file on disc to the render server/session.
[in] | filepath | The path to the file to transfer. |
Bool SendScenefile | ( | const Filename & | filepath, |
BaseDocument * | doc | ||
) |
Transfers a document from memory to the render server/session.
[in] | filepath | Filename for the scene. |
[in] | doc | Document to transfer. The caller owns the pointed document. |
Frames the active camera to the selected objects or elements, geometry only or whole scene.
[in] | mode | Defines what should be zoomed to: OVERVIEW |
[out] | newPos | New local position of the active camera. |
[out] | newRot | New local rotation of the active camera. |
Modifies the current object multi-selection on server side depending on mode.
[in] | appid | The unique application ID under which the UID of the object should be searched for. |
[in] | mem | Points to a block of memory containing the UID data. Scene including the object must been sent already. |
[in] | size | The length of mem block. |
[in] | mode | The selection mode: SELECTION |
Bool UpdateScenefile | ( | Int32 | unique_id_type, |
BaseDocument * | doc | ||
) |
Updates an existing scene file on the render server.
[in] | unique_id_type | Unique ID, should usually be set to MAXON_CREATOR_ID unless an own system for unique IDs is used. |
[in] | doc | Document to update. The caller owns the pointed document. |
Bool UpdateView | ( | const Vector & | pos, |
const Vector & | rot, | ||
Float | focal_length, | ||
Float | aperture, | ||
Float | zoom, | ||
Int32 | projection, | ||
Bool | bNewCamera = false |
||
) |
Updates the scene or editor camera.
[in] | pos | New camera position. |
[in] | rot | New camera rotation. |
[in] | focal_length | New focal length. |
[in] | aperture | New camera aperture. |
[in] | zoom | New camera zoom. |
[in] | projection | New camera projection type, for instance Pleft or Pperspective. |
[in] | bNewCamera | If true if true, otherwise false., creates a new camera object. |
Bool UpdateCamera | ( | BaseObject * | op, |
Bool | bNewCamera = false |
||
) |
Updates an existing scene camera with op.
[in] | op | New camera object. The caller owns the pointed camera object. |
[in] | bNewCamera | If true if true, otherwise false., creates a new camera object. |
Sets an existing camera as active scene camera.
[in] | applicationUID | Application UID under which the cameras UIDs should be searched for. |
[in] | cameraUID | UID of the camera object that should be set as active. |
Updates the display settings of the given draw view.
[in] | draw | View to update. The caller owns the pointed view. |
Bool UpdateRenderSettings | ( | RenderData * | rdat, |
Bool | bKeepVP = false |
||
) |
Updates the render settings with rdat.
[in] | rdat | New render settings. The caller owns the pointed render data. |
[in] | bKeepVP | Pass true to keep Video Post. |
Updates the document to the given time.
[in] | time | New time. |
Controls if the texture cache should be kept in memory or freed after rendering.
[in] | bKeepTextures | Pass true to keep textures in memory after render is finished, false to free them. |
Transfers a texture from memory to the render server/session.
[in] | filepath | Texture path (if only the name is passed the texture will be saved in the preferences folder under tex/). |
[in] | mem | Pointer to the memory block containing the texture bitmap. Can contain any Cinema 4D readable image format. |
[in] | len | Size of the memory block. |
[in] | memoryOnly | If true the texture will be saved to memory and not written to disk (requires Cinema 4D version >= 15.059). |
Bool SendTextureRaw | ( | const Filename & | filepath, |
void * | data, | ||
const COLORMODE & | mode, | ||
const Int64 & | width, | ||
const Int64 & | height, | ||
const Int64 & | rowBytes | ||
) |
Transfers a texture from memory to the render server/session.
[in] | filepath | Texture name - must be unique to this render session. |
[in] | data | Pointer to the memory block containing the data. |
[in] | mode | The format of the data, must adhere to known C4D orders. |
[in] | width | The width in pixels of the texture. |
[in] | height | The height in pixels of the texture. |
[in] | rowBytes | The number of bytes per scanline Note: It is not always the same as width*sizeof(PIXEL) in some applications. |
Frees a specific texture on render server/session and deletes the file on disk (requires Cinema 4D build >= #119398).
[in] | filepath | Texture path (if only the name is passed the texture file will be searched in the preferences folder under tex/). |
Bool StartRender | ( | Int32 | xres, |
Int32 | yres, | ||
ColorResolution | colorresolution, | ||
Bool | allow_saving, | ||
Bool | high_priority | ||
) |
Starts rendering the open session.
[in] | xres | The width of the rendered image in pixels. |
[in] | yres | The height of the rendered image in pixels. |
[in] | colorresolution | Determine the color depth the image that will be streamed Note: It is not enough for an image to be streamed as float data if the render settings are not adjusted to float resolution. |
[in] | allow_saving | Pass false to set RDATA_GLOBALSAVE to false before rendering. |
[in] | high_priority | Pass true to start rendering with different priorities (low/high priority). |
Bool StopRender | ( | ) |
Stops rendering of the open session.
Bool GetImageUpdate | ( | UpdateImage | imgupdate, |
void * | userdata, | ||
Bool * | is_running | ||
) |
Gets image updates.
[in] | imgupdate | Callback for image updates. |
[in] | userdata | User data for imgupdate callback. Can be nullptr. |
[out] | is_running | Assigned the render running status. Can be nullptr if not needed. |
Bool GetImageUpdateMP | ( | Int32 | vpbuffid, |
Int32 | vpbuffsubid, | ||
UpdateImage | imgupdate, | ||
void * | userdata, | ||
Bool * | is_running | ||
) |
Gets multipass image updates.
[in] | vpbuffid | Selects the multipass image channel ID. |
[in] | vpbuffsubid | Selects the multipass image channel sub ID. |
[in] | imgupdate | Callback for image updates. |
[in] | userdata | User data for imgupdate callback. Can be nullptr. |
[out] | is_running | Assigned the render running status. Can be nullptr if not needed. |
Bool GetFullImage | ( | UpdateImage | imgupdate, |
void * | userdata, | ||
Bool * | is_running | ||
) |
Gets full image updates.
[in] | imgupdate | Callback to get the full image. |
[in] | userdata | User data for imgupdate callback. Can be nullptr. |
[out] | is_running | Assigned the render running status. Can be nullptr if not needed. |
Bool GetFullImageMP | ( | Int32 | vpbuffid, |
Int32 | vpbuffsubid, | ||
UpdateImage | imgupdate, | ||
void * | userdata, | ||
Bool * | is_running | ||
) |
Gets full multipass image updates.
[in] | vpbuffid | Selects the multipass image channel ID. |
[in] | vpbuffsubid | Selects the multipass image channel sub ID. |
[in] | imgupdate | Callback to get the full image. |
[in] | userdata | User data for imgupdate callback. Can be nullptr. |
[out] | is_running | Assigned the render running status. Can be nullptr if not needed. |
Bool GetAllTextures | ( | BaseContainer * | bc | ) |
Gets all the textures used in render.
[out] | bc | Filled with all textures filenames. The caller owns the pointed container. |
Bool GetAllAssets | ( | BaseContainer * | bc | ) |
Gets all the assets used in render.
[in] | bc | Filled with all assets. The caller owns the pointed container. |
Bool ExportScene | ( | const Filename & | filepath, |
FILEFORMAT | format | ||
) |
Exports the scene into filepath in the given format.
[in] | filepath | The path to the file to export. |
[in] | format | The file format. |
Bool FreeSession | ( | ) |
Frees the session (scene, image etc.).
Bool ResetRenderServer | ( | ) |
Frees all sessions (all scenes, images, textures in memory etc., requires Cinema4D version >= 15.059).
Gets the running Cinema 4D version of the render server.
[in] | version | Assigned the running Cinema 4D version of the render server (for older servers where the command isn't supported this will be set to 1). |
Bool GetC4dVersionType | ( | VERSIONTYPE * | type | ) |
Gets the running Cinema 4D version type of the render server.
[in] | type | Assigned the running Cinema 4D version type of the render server (for older servers where the command isn't supported this will be set to VERSIONTYPE_UNKNOWN). |
Gets the path to the preference folder of the render server.
[out] | prefsPath | Assigned the preference path as String. Note: The string will be empty if the server version is too old and doesn't support the call. |
Bool GetRenderStatus | ( | Bool * | is_running, |
Int32 * | rendererror, | ||
Float * | progress_percent, | ||
Int32 * | progress_type | ||
) |
Checks if the renderer is running.
[out] | is_running | Assigned the render running status. |
[out] | rendererror | Assigned a render error code: RENDERERROR. |
[out] | progress_percent | Assigned the render progress in percentage. |
[out] | progress_type | Assigned the render progress type: PROGRESSTYPE. |
Gets additional error information after an error has occurred.
[out] | errorText | Assigned the render error text as String. Depends on the error which has occurred before. |
Checks if a scene file was already sent to the render server.
[in] | is_alive | Assigned true only if a scene was already transfered. |
BaseList2D* ConvertParameters | ( | BaseList2D * | node, |
CINEMA4D_VERSION | version | ||
) |
Converts legacy parameters of a node into actual parameters of the running Cinema 4D version.
[in] | node | The node containing the legacy parameter. Types of BaseObject, BaseMaterial, BaseTag and RenderData are supported. |
[in] | version | The C4D version the parameter data was valid for. |
Bool BuildDescription | ( | Int32 | pluginId, |
BaseContainer & | bc | ||
) |
Returns the description data of the node related to the running Cinema 4D version.
[in] | pluginId | The plugin ID of the node. |
[out] | bc | The existing BaseContainer which will be filled with the parameter of the description. |
BaseDocument* RenderMaterials | ( | BaseDocument * | doc | ) |
Renders the materials previews of all included materials.
[in] | doc | The document containing the materials. |
Checks if the Plug-In with the provided ID is available.
[in] | pluginId | The plugin ID of the node. |
[out] | found | True if the plugin was found. |