MaterialPreviewData Class Reference

#include <customgui_matpreview.h>

Inheritance diagram for MaterialPreviewData:

详细描述

Material preview data type ( CUSTOMDATATYPE_MATPREVIEW ) for MaterialPreviewCustomGui .

公共成员函数

void  AnimatePreview ( Bool bAnimate)
Bool   PreviewIsAnimated ()
void  SetPreviewType ( MatPreviewType t)
MatPreviewType   GetPreviewType ()
void  SetUserPreviewSceneName (const maxon::String &strName)
String   GetUserPreviewSceneName ()
void  SetPreviewSize ( MatPreviewSize s)
MatPreviewSize   GetPreviewSize ()
void  SetObjectMatrix (const 矩阵 &m)
Bool   GetObjectMatrix ( 矩阵 &m)
void  ClearObjectMatrix ()
Float   GetWorldSize ()
void  SetWorldSize ( Float r)
Float   GetPreviewStartTime ()
void  SetPreviewStartTime ( Float r)
void  GetEnvironment ( 向量 &col, Float &strength)
void  SetEnvironment (const 向量 &col, const Float &strength)
Int32   GetDirtyCount ()
Bool   GetRegion ( Float &l, Float &t, Float &r, Float &b)
void  SetRegion ( Bool bActive, Float l, Float t, Float r, Float b)
Int32   GetPreviewChannel ()
void  SetPreviewChannel ( Int32 lChannel)
Int32   GetReflectionLayer ()
void  SetReflectionLayer ( Int32 lLayer)

私有成员函数

  MaterialPreviewData ()
  ~MaterialPreviewData ()

Init

Bool   Init ( BaseChannel *pChannel, Int32 lCount)
Bool   Init ( BaseShader *pShader, Int32 lCount)
Bool   Init ( BaseMaterial *pMaterial, Int32 lCount)
Bool   Init ( BaseBitmap *pImage, Int32 lCount)
Bool   Init ( RenderPreviewImageCallback fn, void *pUserData, Int32 lUserID, Int32 lCount)

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

◆  MaterialPreviewData()

MaterialPreviewData () private

◆  ~MaterialPreviewData()

~ MaterialPreviewData () private

成员函数文档编制

◆  Init() [1/5]

Bool Init ( BaseChannel pChannel ,
Int32   lCount  
)

Initializes the material preview with pChannel .

参数
[in] pChannel The initial preview source. The caller owns the pointed channel.
[in] lCount The dirty count. Used to detect changes.
返回
true if successful, otherwise false .

◆  Init() [2/5]

Bool Init ( BaseShader pShader ,
Int32   lCount  
)

Initializes the material preview with pShader .

参数
[in] pShader The initial preview source. The caller owns the pointed shader.
[in] lCount The dirty count. Used to detect changes.
返回
true if successful, otherwise false .

◆  Init() [3/5]

Bool Init ( BaseMaterial pMaterial ,
Int32   lCount  
)

Initializes the material preview with pMaterial .

参数
[in] pMaterial The initial preview source. The caller owns the pointed material.
[in] lCount The dirty count. Used to detect changes.
返回
true if successful, otherwise false .

◆  Init() [4/5]

Bool Init ( BaseBitmap pImage ,
Int32   lCount  
)

Initializes the material preview with pImage .

参数
[in] pImage The initial preview source. The caller owns the pointed bitmap.
[in] lCount The dirty count. Used to detect changes.
返回
true if successful, otherwise false .

◆  Init() [5/5]

Bool Init ( RenderPreviewImageCallback   fn ,
void *  pUserData ,
Int32   lUserID ,
Int32   lCount  
)

Initializes the material preview with a custom image hook. The hook will handle all host messages.

参数
[in] fn The callback for the preview.
[in] pUserData The user data. Passed along to the hook. May be deleted after the function has finished.
[in] lUserID A user ID for the material preview. Used to identify the callback.
[in] lCount The dirty count. Increment this whenever a parameter has been changed.
返回
true if successful, otherwise false .

◆  AnimatePreview()

void AnimatePreview ( Bool   bAnimate )

Sets the preview animation state.

参数
[in] bAnimate The new animation state.

◆  PreviewIsAnimated()

Bool PreviewIsAnimated ( )

Checks the preview animation state.

返回
The preview animation state.

◆  SetPreviewType()

void SetPreviewType ( MatPreviewType   t )

Sets the preview type.

参数
[in] t The new preview type: MatPreviewType

◆  GetPreviewType()

MatPreviewType GetPreviewType ( )

Checks the preview type.

返回
The preview type: MatPreviewType

◆  SetUserPreviewSceneName()

void SetUserPreviewSceneName ( const maxon::String strName )

Sets the user preview scene name.

参数
[in] strName The new user preview scene name.

◆  GetUserPreviewSceneName()

String GetUserPreviewSceneName ( )

Retrieves the user preview scene name.

返回
The user preview scene name.

◆  SetPreviewSize()

void SetPreviewSize ( MatPreviewSize   s )

Sets the preview size.

参数
[in] s The new preview size: MatPreviewSize

◆  GetPreviewSize()

MatPreviewSize GetPreviewSize ( )

Retrieves the preview size.

返回
The preview size.

◆  SetObjectMatrix()

void SetObjectMatrix ( const 矩阵 m )

Sets the object matrix.

参数
[in] m The new object matrix.

◆  GetObjectMatrix()

Bool GetObjectMatrix ( 矩阵 m )

Retrieves the object matrix.

参数
[out] m Assigned the object matrix, if not cleared.
返回
true if successful, false if the object matrix is not initialized.

◆  ClearObjectMatrix()

void ClearObjectMatrix ( )

Clears the object matrix, i.e to an uninitialized state.

◆  GetWorldSize()

Float GetWorldSize ( )

Retrieves the world size.

返回
The world size.

◆  SetWorldSize()

void SetWorldSize ( Float   r )

Sets the world size.

参数
[in] r The new world size.

◆  GetPreviewStartTime()

Float GetPreviewStartTime ( )

Retrieves the preview start time.

返回
The preview start time.

◆  SetPreviewStartTime()

void SetPreviewStartTime ( Float   r )

Sets the preview start time.

参数
[in] r The new start time.

◆  GetEnvironment()

void GetEnvironment ( 向量 col ,
Float strength  
)

Gets the environment data.

参数
[out] col Assigned the environment color.
[out] strength Assigned the environment strength.

◆  SetEnvironment()

void SetEnvironment ( const 向量 col ,
const Float strength  
)

Sets the environment data.

参数
[in] col The new environment color.
[in] strength The new environment strength.

◆  GetDirtyCount()

Int32 GetDirtyCount ( )

Retrieves the dirty count for the preview.

返回
The dirty count.

◆  GetRegion()

Bool GetRegion ( Float l ,
Float t ,
Float r ,
Float b  
)

Retrieves the current selection region.

参数
[out] l Assigned the left boundary, between 0 and 1 .
[out] t Assigned the top boundary, between 0 and 1 .
[out] r Assigned the right boundary, between 0 and 1 .
[out] b Assigned the bottom boundary, between 0 and 1 .
返回
true if the region could be retrieved, otherwise false .

◆  SetRegion()

void SetRegion ( Bool   bActive ,
Float   l ,
Float   t ,
Float   r ,
Float   b  
)

Sets a selection region in the preview.

参数
[in] bActive Determines if the rectangle is active or not.
[in] l The new left boundary, between 0 and 1 .
[in] t The new top boundary, between 0 and 1 .
[in] r The new right boundary, between 0 and 1 .
[in] b The new bottom boundary, between 0 and 1 .

◆  GetPreviewChannel()

Int32 GetPreviewChannel ( )

Retrieves the channel used for preview.

返回
The channel: CHANNEL

◆  SetPreviewChannel()

void SetPreviewChannel ( Int32   lChannel )

Sets the channel used for preview.

参数
[in] lChannel The new channel: CHANNEL

◆  GetReflectionLayer()

Int32 GetReflectionLayer ( )

Retrieves the reflection layer used for preview.

由于
R16
返回
The reflection layer ID or NOTOK if unset.

◆  SetReflectionLayer()

void SetReflectionLayer ( Int32   lLayer )

Sets the reflection layer used for preview.

注意
Suited to test a specific reflectance layer. This disables several material properties in the preview like color and transparency. It also only shows the effect of the reflectance layer with ID lLayer if any.
Make sure to check the layer with ID lLayer exists before setting this, otherwise one may get a pure-black material preview.
Keep always in mind that reflection layers can be removed any time (both by user and via API), therefore a specific layer ID could be no longer valid.
由于
R16
参数
[in] lLayer The reflection layer ID to set. Pass NOTOK to revert back to normal behavior i.e. to show all material properties and all reflection layers.