-
首页
-
C4D R23.110 C++ SDK
customgui_matpreview.h File Reference
Enumerations
|
enum
|
MatPreviewType
{
MatPreviewDefault
,
MatPreviewFlat2D
,
MatPreviewCube
,
MatPreviewPlane
,
MatPreviewCylinder
,
MatPreviewTorus
,
MatPreviewPlaneBack
,
MatPreviewSphere
,
MatPreview2Torus
,
MatPreviewRoundedCube
,
MatPreviewKnot
,
MatPreviewMultipleObjects
,
MatPreviewCandle
,
MatPreviewCloth
,
MatPreviewGem
,
MatPreviewObjectAnim
,
MatPreviewObject
,
MatPreviewUser
}
|
enum
|
MatPreviewSize
{
MatPreviewSizeDefault
,
MatPreviewSizeSmall
,
MatPreviewSizeMedium
,
MatPreviewSizeBig
,
MatPreviewSizeLarge
}
|
函数
|
Bool
|
SetDParameterPreview
(
BaseContainer
*pContainer, const
GeData
*pData,
DESCFLAGS_SET
&lFlags,
Int32
lID)
|
Bool
|
GetDParameterPreview
(
BaseContainer
*pContainer,
GeData
*pData,
DESCFLAGS_GET
&lFlags,
Int32
lID,
Int32
lCount,
BaseMaterial
*pMaterial)
|
Bool
|
GetDParameterPreview
(
BaseContainer
*pContainer,
GeData
*pData,
DESCFLAGS_GET
&lFlags,
Int32
lID,
Int32
lCount,
BaseShader
*pShader)
|
BaseContainer
|
GetPreviewScenes
(
Bool
bIncludeFlat2D,
Bool
bIncludeDefault=false,
Int32
lObjectID=-1)
|
Bool
|
HandlePreviewSceneMessage
(
Int32
lID,
MatPreviewType
&t,
maxon::String
&strScene)
|
Bool
|
AddUserPreviewScene
(const
Filename
&fn,
Int32
lID,
maxon::String
*pstrName)
|
RENDERRESULT
|
RenderMaterialPreview
(const
Filename
&docpath,
BaseMaterial
*pMatClone,
BaseMaterial
*pOrigMat,
BaseThread
*pThread,
BaseBitmap
*pDest,
BaseDocument
*pOriginalDoc,
Float
rCurrentTime,
Int32
lFlags=0)
|
RENDERRESULT
|
RenderShaderPreview
(const
Filename
&docpath,
BaseShader
*pShaderClone,
BaseShader
*pOrigShader,
BaseThread
*pThread,
BaseBitmap
*pDest,
BaseDocument
*pOriginalDoc,
Float
rCurrentTime,
Int32
lFlags=0)
|
RENDERRESULT
|
RenderCustomPreview
(
RenderPreviewImageCallback
fn, void *pUserData,
Int32
lUserID,
BaseThread
*pThread,
BaseBitmap
*pDest,
Int32
lFlags=0)
|
Macro Definition Documentation
◆
CUSTOMGUI_MATPREVIEW
#define CUSTOMGUI_MATPREVIEW
|
Material preview custom GUI ID.
◆
CUSTOMDATATYPE_MATPREVIEW
#define CUSTOMDATATYPE_MATPREVIEW
|
Material preview custom data type ID.
◆
RENDER_PREVIEW_USE_BMP_SIZE
#define RENDER_PREVIEW_USE_BMP_SIZE
|
Renders in full bitmap size, ignoring the settings in the material or shader data. (For
RenderMaterialPreview()
and
RenderShaderPreview()
.)
Typedef Documentation
◆
RenderPreviewImageCallback
typedef
Bool
(* RenderPreviewImageCallback) (
Int32
lMessage, void *pData, void *pUserData)
|
Called to process host message for the
MaterialPreviewData
when initialized with this callback.
-
参数
-
[in]
|
lMessage
|
The message:
MATPREVIEW
|
[in]
|
pData
|
The message data.
|
[in]
|
pUserData
|
A clone of the user data.
|
-
返回
-
true
if successful, otherwise
false
.
Function Documentation
◆
SetDParameterPreview()
Convenience function to use in
NodeData::SetDParameter()
of nodes with a material preview in the description:
Bool
SimpleMaterial::SetDParameter(
GeListNode
*node,
const
DescID
&
id
,
const
GeData
&t_data,
DESCFLAGS_SET
&flags)
{
BaseMaterial
* mat =
static_cast<
BaseMaterial
*
>
(node);
BaseContainer
* data = mat->
GetDataInstance
();
updatecount++;
switch
(
id
[0].
id
)
{
case
SIMPLEMATERIAL_MAT_PREVIEW:
return
SetDParameterPreview
(data, &t_data, flags, SIMPLEMATERIAL_MAT_PREVIEW);
}
return
MaterialData::SetDParameter
(node,
id
, t_data, flags);
}
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GetDParameterPreview()
[1/2]
Convenience function to use in
NodeData::GetDParameter()
of material nodes with a material preview in the description:
Bool
SimpleMaterial::GetDParameter(
GeListNode
*node,
const
DescID
&
id
,
GeData
&t_data,
DESCFLAGS_GET
&flags)
{
BaseMaterial
* mat =
static_cast<
BaseMaterial
*
>
(node);
BaseContainer
* data = mat->
GetDataInstance
();
switch
(
id
[0].
id
)
{
case
SIMPLEMATERIAL_MAT_PREVIEW:
return
GetDParameterPreview
(data, &t_data, flags, SIMPLEMATERIAL_MAT_PREVIEW, updatecount, mat);
}
return
MaterialData::GetDParameter
(node,
id
, t_data, flags);
}
-
参数
-
[in]
|
pContainer
|
The container of the node sent to
NodeData::GetDParameter()
. The caller owns the pointed container.
|
[in]
|
pData
|
The
t_data
sent to
NodeData::GetDParameter()
. The caller owns the pointed data..
|
[in]
|
lFlags
|
The
flags
sent to
NodeData::GetDParameter()
.
|
[in]
|
lID
|
The ID of the material preview.
|
[in]
|
lCount
|
The dirty count.
|
[in]
|
pMaterial
|
The material. The caller owns the pointed material.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetDParameterPreview()
[2/2]
Convenience function to use in
NodeData::GetDParameter()
of shader nodes with a material preview in the description:
Bool
SimpleShader::GetDParameter(
GeListNode
*node,
const
DescID
&
id
,
GeData
&t_data,
DESCFLAGS_GET
&flags)
{
BaseShader
* shd =
static_cast<
BaseMaterial
*
>
(node);
BaseContainer
* data = shd->
GetDataInstance
();
switch
(
id
[0].
id
)
{
case
SIMPLEMATERIAL_MAT_PREVIEW:
return
GetDParameterPreview
(data, &t_data, flags, SIMPLEMATERIAL_MAT_PREVIEW, updatecount, shd);
}
return
ShaderData::GetDParameter
(node,
id
, t_data, flags);
}
-
参数
-
[in]
|
pContainer
|
The container of the node sent to
NodeData::GetDParameter()
. The caller owns the pointed container.
|
[in]
|
pData
|
The
t_data
sent to
NodeData::GetDParameter()
. The caller owns the pointed data..
|
[in]
|
lFlags
|
The
flags
sent to
NodeData::GetDParameter()
.
|
[in]
|
lID
|
The ID of the material preview.
|
[in]
|
lCount
|
The dirty count.
|
[in]
|
pShader
|
The shader. The caller owns the pointed shader.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetPreviewScenes()
Retrieves a list of preview scenes. Use the returned container's elements in menus.
-
参数
-
[in]
|
bIncludeFlat2D
|
Include Flat 2D.
|
[in]
|
bIncludeDefault
|
Include Default.
|
[in]
|
lObjectID
|
An object ID.
|
-
返回
-
The generated menu container.
◆
HandlePreviewSceneMessage()
Generates the type and the scene name from the menu item generated by
GetPreviewScenes()
.
-
参数
-
[in]
|
lID
|
The selected menu ID.
|
[out]
|
t
|
Assigned the preview type.
|
[out]
|
strScene
|
Assigned the scene name.
|
-
返回
-
true
if successful, otherwise
false
.
◆
AddUserPreviewScene()
Adds a user scene that optionally only shows up in materials with type lID. The pstrName may be nullptr, in which case the file name is used.
-
注意
-
The scene has to contain an object named "Object" (which may well be a Null containing a group of objects) in order to be used by this function.
-
参数
-
[in]
|
fn
|
The user scene name.
|
[in]
|
lID
|
The material ID, or
-1
to make the preview scene available for all materials.
|
[in]
|
pstrName
|
An optional user scene name. The string is copied. The caller owns the pointed string.
|
-
返回
-
true
if successful, otherwise
false
.
◆
RenderMaterialPreview()
Called by
Cinema 4D
to calculate the material preview for the Material Manager.
Private
.
◆
RenderShaderPreview()
Called by
Cinema 4D
to calculate the shader preview for the Material Manager.
Private
.
◆
RenderCustomPreview()
Called by
Cinema 4D
to calculate a custom preview.
Private
.
Bool GetDParameterPreview(BaseContainer *pContainer, GeData *pData, DESCFLAGS_GET &lFlags, Int32 lID, Int32 lCount, BaseMaterial *pMaterial)
const BaseContainer * GetDataInstance() const
定义:
c4d_baselist.h:2283
定义:
lib_description.h:327
virtual Bool SetDParameter(GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
virtual Bool GetDParameter(GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
DESCFLAGS_GET
定义:
ge_prepass.h:3099
Represents a C4DAtom that resides in a 4D list.
定义:
c4d_baselist.h:1767
Bool SetDParameterPreview(BaseContainer *pContainer, const GeData *pData, DESCFLAGS_SET &lFlags, Int32 lID)
DESCFLAGS_SET
定义:
ge_prepass.h:3113
maxon::Bool Bool
定义:
ge_sys_math.h:53
定义:
c4d_basematerial.h:27
定义:
c4d_basecontainer.h:46