This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.BaseMaterial – a material class

class c4d.BaseMaterial

SuperClass

BaseList2D

SubClass

Material

Methods

static BaseMaterial.__init__(type)
Parameter:type (int) – The id of the material, e.g: (Mfog). See also: Types
Return type:BaseMaterial
Returns:The new object or None, if allocation failed.
BaseMaterial.Compare(snd)

Returns an average color for the material, based on the material preview.

Parameter:flags (BaseMaterial) – Check if the materials are identical; only their names can be different.
Return type:bool
Returns:True if the materials contents are the same.
BaseMaterial.GetPreview([flags=0])

Returns an average color for the material, based on the material preview.

Parameter:flags (int) – Currently not used.
Return type:BaseBitmap
Returns:The preview image or None if no preview was built yet.
BaseMaterial.GetAverageColor([channel=NOTOK])

Returns an average color for the material, based on the material preview.

Parameter:channel (int) –

An optional specific channel to get the average for.

NOTOK All channels.
CHANNEL_COLOR The color channel of the material.
CHANNEL_LUMINANCE The luminance channel of the material.
CHANNEL_TRANSPARENCY The transparency channel of the material.
CHANNEL_REFLECTION The reflection channel of the material.
CHANNEL_ENVIRONMENT The environment channel of the material.
CHANNEL_FOG The fog channel of the material.
CHANNEL_BUMP The bump channel of the material.
CHANNEL_ALPHA The alpha channel of the material.
CHANNEL_SPECULAR The specular channel of the material.
CHANNEL_SPECULARCOLOR The specular color channel of the material.
CHANNEL_GLOW The glow channel of the material.
CHANNEL_DISPLACEMENT The displacement channel of the material.
CHANNEL_DIFFUSION The diffusion channel of the material.
CHANNEL_NORMAL The normal channel of the material.
CHANNEL_ANY This specifies an unlabeled plugin channel.
Return type:Vector
Returns:Average color.
BaseMaterial.Update(preview, rttm)

Recalculates the material’s thumbnail and updates internal values.

Note

Recalculating the thumbnail/RTTM image is time intensive. It only needs to be done if you want to let the user view the change. The calculations are done asynchronously.

Parameters:
  • preview (bool) – If this value is True then the preview thumbnail is updated.
  • rttm (bool) – If this value is True then the real time texture map of the material will be recalculated.

Table Of Contents

This Page