#include <customgui_matpreview.h>
◆ MaterialPreviewData()
◆ ~MaterialPreviewData()
◆ Init() [1/5]
Initializes the material preview with pChannel.
- Parameters
-
[in] | pChannel | The initial preview source. The caller owns the pointed channel. |
[in] | lCount | The dirty count. Used to detect changes. |
- Returns
- true if successful, otherwise false.
◆ Init() [2/5]
Initializes the material preview with pShader.
- Parameters
-
[in] | pShader | The initial preview source. The caller owns the pointed shader. |
[in] | lCount | The dirty count. Used to detect changes. |
- Returns
- true if successful, otherwise false.
◆ Init() [3/5]
Initializes the material preview with pMaterial.
- Parameters
-
[in] | pMaterial | The initial preview source. The caller owns the pointed material. |
[in] | lCount | The dirty count. Used to detect changes. |
- Returns
- true if successful, otherwise false.
◆ Init() [4/5]
Initializes the material preview with pImage.
- Parameters
-
[in] | pImage | The initial preview source. The caller owns the pointed bitmap. |
[in] | lCount | The dirty count. Used to detect changes. |
- Returns
- true if successful, otherwise false.
◆ Init() [5/5]
Initializes the material preview with a custom image hook. The hook will handle all host messages.
- Parameters
-
[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. |
- Returns
- true if successful, otherwise false.
◆ AnimatePreview()
void AnimatePreview |
( |
Bool |
bAnimate | ) |
|
Sets the preview animation state.
- Parameters
-
[in] | bAnimate | The new animation state. |
◆ PreviewIsAnimated()
Bool PreviewIsAnimated |
( |
| ) |
|
Checks the preview animation state.
- Returns
- The preview animation state.
◆ SetPreviewType()
Sets the preview type.
- Parameters
-
◆ GetPreviewType()
◆ SetUserPreviewSceneName()
Sets the user preview scene name.
- Parameters
-
[in] | strName | The new user preview scene name. |
◆ GetUserPreviewSceneName()
String GetUserPreviewSceneName |
( |
| ) |
|
Retrieves the user preview scene name.
- Returns
- The user preview scene name.
◆ SetPreviewSize()
Sets the preview size.
- Parameters
-
◆ GetPreviewSize()
Retrieves the preview size.
- Returns
- The preview size.
◆ SetObjectMatrix()
void SetObjectMatrix |
( |
const Matrix & |
m | ) |
|
Sets the object matrix.
- Parameters
-
[in] | m | The new object matrix. |
◆ GetObjectMatrix()
Retrieves the object matrix.
- Parameters
-
[out] | m | Assigned the object matrix, if not cleared. |
- Returns
- 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()
Retrieves the world size.
- Returns
- The world size.
◆ SetWorldSize()
void SetWorldSize |
( |
Float |
r | ) |
|
Sets the world size.
- Parameters
-
◆ GetPreviewStartTime()
Float GetPreviewStartTime |
( |
| ) |
|
Retrieves the preview start time.
- Returns
- The preview start time.
◆ SetPreviewStartTime()
void SetPreviewStartTime |
( |
Float |
r | ) |
|
Sets the preview start time.
- Parameters
-
◆ GetEnvironment()
Gets the environment data.
- Parameters
-
[out] | col | Assigned the environment color. |
[out] | strength | Assigned the environment strength. |
◆ SetEnvironment()
void SetEnvironment |
( |
const Vector & |
col, |
|
|
const Float & |
strength |
|
) |
| |
Sets the environment data.
- Parameters
-
[in] | col | The new environment color. |
[in] | strength | The new environment strength. |
◆ GetDirtyCount()
Retrieves the dirty count for the preview.
- Returns
- The dirty count.
◆ GetRegion()
Retrieves the current selection region.
- Parameters
-
[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. |
- Returns
- true if the region could be retrieved, otherwise false.
◆ SetRegion()
Sets a selection region in the preview.
- Parameters
-
[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.
- Returns
- The channel: CHANNEL
◆ SetPreviewChannel()
void SetPreviewChannel |
( |
Int32 |
lChannel | ) |
|
Sets the channel used for preview.
- Parameters
-
[in] | lChannel | The new channel: CHANNEL |
◆ GetReflectionLayer()
Int32 GetReflectionLayer |
( |
| ) |
|
Retrieves the reflection layer used for preview.
- Since
- R16
- Returns
- The reflection layer ID or NOTOK if unset.
◆ SetReflectionLayer()
void SetReflectionLayer |
( |
Int32 |
lLayer | ) |
|
Sets the reflection layer used for preview.
- Note
- 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.
- Since
- R16
- Parameters
-
[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. |
◆ CopyLinearWorkflow()
Copies the Linear workflow settings from the source document do dst. The difference to BaseDocument::CopyLinearWorkflow is that this function also runs the scene converter to adapt the OCIO settings of the preview scene.
- Parameters
-
[in] | src | Source document. |
[in] | previewDocument | Preview scene. |