InitRenderStruct Struct Reference

#include <c4d_shader.h>

详细描述

The InitRenderStruct is usually filled by Cinema 4D and then passed to the shader or channel InitRender() .
However to evaluate a BaseChannel for own purposes then create an InitRenderStruct on the stack.

公共成员函数

  InitRenderStruct ()
  InitRenderStruct ( BaseDocument *t_doc)
void  Init ( BaseDocument *t_doc)
Int32   GetThreadCount () const
向量   TransformColor (const 向量 &input) const

Public Attributes

Int32   version
BaseTime   time
Int32   fps
Filename   docpath
String matname
RootTextureString *  errorlist
VolumeData vd
BaseDocument doc
BaseThread thread
INITRENDERFLAG   flags
Bool   linear_workflow
Int32   document_colorprofile

构造函数 & 析构函数文档编制

◆  InitRenderStruct() [1/2]

InitRenderStruct ( )

Default constructor.

◆  InitRenderStruct() [2/2]

InitRenderStruct ( BaseDocument t_doc )
explicit

Creates the structure accordingly to the passed document.

参数
[in] t_doc The document to initialize the structure. The caller owns the pointed document.

成员函数文档编制

◆  Init()

void Init ( BaseDocument t_doc )

Initializes the structure accordingly to the passed document.

参数
[in] t_doc The document to initialize the structure. The caller owns the pointed document.

◆  GetThreadCount()

Int32 GetThreadCount ( ) const

Retrieves the number of render threads.

返回
The number of render threads.

◆  TransformColor()

向量 TransformColor ( const 向量 input ) const

If linear workflow is enabled the passed color is transformed into the color profile specified by document_colorprofile.

参数
[in] input The color to transform.
返回
The transformed color.

Member Data Documentation

◆  version

Int32 version

The version of Cinema 4D .

◆  time

BaseTime time

The current time.

◆  fps

Int32 fps

The framerate.

◆  docpath

Filename docpath

The path for the document.

◆  matname

String * matname

The material name.

◆  errorlist

RootTextureString* errorlist

A private error list. Can be nullptr , always check.

◆  vd

VolumeData * vd

The volume data. Can be nullptr , always check.

注意
When initializing an InitRenderStruct , if the following line is missing, Cinema 4D assumes that there will be only one render thread.
(Without VolumeData no multi-threaded calculation can be done.). Access to VolumeData::Sample() will then crash or overwrite memory.
Here is a safe initialization of vd : irs.vd = render->GetInitialVolumeData(0);
警告
To accurately rebuild a host environment for shader, material or channel sampling all members that VolumeData offers need to be filled.
Any pointer that is not initialized can cause a crash. Members like BaseVolumeData::recursion_data , BaseVolumeData::multipass and BaseVolumeData::intersection can be set to nullptr .

◆  doc

BaseDocument * doc

The document to render. Can be nullptr , always check.

◆  thread

BaseThread * thread

The current thread or nullptr for the main Cinema 4D thread.

◆  flags

INITRENDERFLAG flags

The flags; INITRENDERFLAG .

◆  linear_workflow

Bool linear_workflow

Linear workflow enabled/disabled.

◆  document_colorprofile

Int32 document_colorprofile

The document color profile: DOCUMENT_COLORPROFILE .