SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUMaterialRef Struct Reference

References a material object. More...

#include <SketchUpAPI/model/material.h>

Inherits SUEntityRef.

Related Functions

(Note that these are not member functions.)

SUEntityRef SUMaterialToEntity (SUMaterialRef material)
 Converts from an SUMaterialRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SUMaterialRef SUMaterialFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUMaterialRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUMaterialRef. More...
 
enum SUResult SUMaterialCreate (SUMaterialRef *material)
 Creates a material. More...
 
enum SUResult SUMaterialRelease (SUMaterialRef *material)
 Releases a material and its resources. More...
 
enum SUResult SUMaterialSetName (SUMaterialRef material, const char *name)
 Sets the name of a material object. More...
 
enum SUResult SUMaterialGetName (SUMaterialRef material, SUStringRef *name)
 Retrieves the internal name of a material object. The internal name is the unprocessed identifier string stored with the material. More...
 
enum SUResult SUMaterialGetNameLegacyBehavior (SUMaterialRef material, SUStringRef *name)
 Retrieves the name of a material object. This method was added for users who require the functionality of SUMaterialGetName() prior to SketchUp 2017, API 5.0. If the internal name is encased in square brackets, [], this method will return the name without brackets, otherwise the name will match the name retrieved by SUMaterialGetName. More...
 
enum SUResult SUMaterialSetColor (SUMaterialRef material, const SUColor *color)
 Sets the color of a material object. More...
 
enum SUResult SUMaterialGetColor (SUMaterialRef material, SUColor *color)
 Retrieves the color value of a material object. More...
 
enum SUResult SUMaterialSetTexture (SUMaterialRef material, SUTextureRef texture)
 Sets the texture of a material object. More...
 
enum SUResult SUMaterialGetTexture (SUMaterialRef material, SUTextureRef *texture)
 Retrieves the texture of a material object. More...
 
enum SUResult SUMaterialGetOpacity (SUMaterialRef material, double *alpha)
 Retrieves the alpha value (0.0 - 1.0) of a material object. More...
 
enum SUResult SUMaterialSetOpacity (SUMaterialRef material, double alpha)
 Sets the alpha value of a material object. More...
 
enum SUResult SUMaterialGetUseOpacity (SUMaterialRef material, bool *use_opacity)
 Retrieves the flag indicating whether alpha values are used from a material object. More...
 
enum SUResult SUMaterialSetUseOpacity (SUMaterialRef material, bool use_opacity)
 Sets the flag indicating whether alpha values are used on a material object. More...
 
enum SUResult SUMaterialSetType (SUMaterialRef material, enum SUMaterialType type)
 Sets the type of a material object. More...
 
enum SUResult SUMaterialGetType (SUMaterialRef material, enum SUMaterialType *type)
 Retrieves the type of a material object. More...
 
enum SUResult SUMaterialIsDrawnTransparent (SUMaterialRef material, bool *transparency)
 Retrieves the flag indicating whether the material is drawn with transparency. More...
 
enum SUResult SUMaterialGetOwnerType (SUMaterialRef material, enum SUMaterialOwnerType *type)
 Retrieves the owner type of a material object. More...
 
enum SUResult SUMaterialSetColorizeType (SUMaterialRef material, enum SUMaterialColorizeType type)
 Sets the colorization type of a material object. This is used when the material's color is set to a custom value. Call this function after calling SUMaterialSetColor as otherwise the colorize type will be reset. More...
 
enum SUResult SUMaterialGetColorizeType (SUMaterialRef material, enum SUMaterialColorizeType *type)
 Retrieves the colorization type of a material object. More...
 
enum SUResult SUMaterialGetColorizeDeltas (SUMaterialRef material, double *hue, double *saturation, double *lightness)
 The colorize_deltas method retrieves the HLS deltas for colorized materials. More...
 
enum SUResult SUMaterialWriteToFile (SUMaterialRef material, const char *file_path)
 Writes a material to a SKM file. More...
 
enum SUResult SUModelLoadMaterial (SUModelRef model, const char *file_path, SUMaterialRef *material)
 Loads a material from a SKM file. More...
 
PBR Metallic Roughness Workflow
enum SUResult SUMaterialGetWorkflow (SUMaterialRef material, enum SUMaterialWorkflow *workflow)
 Queries the workflow type of a material. More...
 
enum SUResult SUMaterialSetMetalnessEnabled (SUMaterialRef material, bool enable)
 Enables metalness properties for the material. More...
 
enum SUResult SUMaterialIsMetalnessEnabled (SUMaterialRef material, bool *enabled)
 Queries whether metalness properties are enabled for the material. More...
 
enum SUResult SUMaterialSetMetallicTexture (SUMaterialRef material, SUTextureRef texture)
 Sets the metallic texture of a PBR material. More...
 
enum SUResult SUMaterialGetMetallicTexture (SUMaterialRef material, SUTextureRef *texture)
 Retrieves the metallic texture of a material. More...
 
enum SUResult SUMaterialSetMetallicFactor (SUMaterialRef material, double factor)
 Sets the metallic factor of a material. More...
 
enum SUResult SUMaterialGetMetallicFactor (SUMaterialRef material, double *factor)
 Retrieves the metallic factor of a material. More...
 
enum SUResult SUMaterialSetRoughnessEnabled (SUMaterialRef material, bool enable)
 Enables roughness properties for the material. More...
 
enum SUResult SUMaterialIsRoughnessEnabled (SUMaterialRef material, bool *enabled)
 Queries whether roughness properties are enabled for the material. More...
 
enum SUResult SUMaterialSetRoughnessTexture (SUMaterialRef material, SUTextureRef texture)
 Sets the roughness texture of a PBR material. More...
 
enum SUResult SUMaterialGetRoughnessTexture (SUMaterialRef material, SUTextureRef *texture)
 Retrieves the roughness texture of a material. More...
 
enum SUResult SUMaterialSetRoughnessFactor (SUMaterialRef material, double factor)
 Sets the roughness factor of a material. More...
 
enum SUResult SUMaterialGetRoughnessFactor (SUMaterialRef material, double *factor)
 Retrieves the roughness factor of a material. More...
 
enum SUResult SUMaterialSetNormalEnabled (SUMaterialRef material, bool enable)
 Enables normal map for the material. More...
 
enum SUResult SUMaterialIsNormalEnabled (SUMaterialRef material, bool *enabled)
 Queries whether normal mapping is enabled for the material. More...
 
enum SUResult SUMaterialSetNormalTexture (SUMaterialRef material, SUTextureRef texture)
 Sets the normal texture of a PBR material. More...
 
enum SUResult SUMaterialGetNormalTexture (SUMaterialRef material, SUTextureRef *texture)
 Retrieves the normal texture of a material. More...
 
enum SUResult SUMaterialSetNormalScale (SUMaterialRef material, double scale)
 Sets the normal scale of a material. More...
 
enum SUResult SUMaterialGetNormalScale (SUMaterialRef material, double *scale)
 Retrieves the normal scale of a material. More...
 
enum SUResult SUMaterialSetNormalStyle (SUMaterialRef material, enum SUMaterialNormalMapStyle style)
 Sets the normal mapping style of a material. More...
 
enum SUResult SUMaterialGetNormalStyle (SUMaterialRef material, enum SUMaterialNormalMapStyle *style)
 Retrieves the normal mapping style of a material. More...
 
enum SUResult SUMaterialSetAOEnabled (SUMaterialRef material, bool enable)
 Enables ambient occlusion map for the material. More...
 
enum SUResult SUMaterialIsAOEnabled (SUMaterialRef material, bool *enabled)
 Queries whether ambient occlusion mapping is enabled for the material. More...
 
enum SUResult SUMaterialSetAOTexture (SUMaterialRef material, SUTextureRef texture)
 Sets the ambient occlusion texture of a PBR material. More...
 
enum SUResult SUMaterialGetAOTexture (SUMaterialRef material, SUTextureRef *texture)
 Retrieves the ambient occlusion texture of a material. More...
 
enum SUResult SUMaterialSetAOStrength (SUMaterialRef material, double strength)
 Sets the ambient occlusion strength of a material. More...
 
enum SUResult SUMaterialGetAOStrength (SUMaterialRef material, double *strength)
 Retrieves the ambient occlusion strength of a material. More...
 

Detailed Description

References a material object.

Friends And Related Function Documentation

enum SUResult SUMaterialCreate ( SUMaterialRef material)
related

Creates a material.

If the material is not associated with any face, it must be deallocated with SUMaterialRelease().

Parameters
[out]materialThe material created.
Returns
SUMaterialRef SUMaterialFromEntity ( SUEntityRef  entity)
related

Converts from an SUEntityRef to an SUMaterialRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUMaterialRef.

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUMaterialRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
enum SUResult SUMaterialGetAOStrength ( SUMaterialRef  material,
double *  strength 
)
related

Retrieves the ambient occlusion strength of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]strengthOcclusion strength returned.
Returns
enum SUResult SUMaterialGetAOTexture ( SUMaterialRef  material,
SUTextureRef texture 
)
related

Retrieves the ambient occlusion texture of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]textureThe texture containing the occlusion information, if one exists. This texture should not be released via SUTextureRelease() since it is owned by the material.
Returns
enum SUResult SUMaterialGetColor ( SUMaterialRef  material,
SUColor color 
)
related

Retrieves the color value of a material object.

Parameters
[in]materialThe material object.
[out]colorThe color value retrieved.
Returns
enum SUResult SUMaterialGetColorizeDeltas ( SUMaterialRef  material,
double *  hue,
double *  saturation,
double *  lightness 
)
related

The colorize_deltas method retrieves the HLS deltas for colorized materials.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]materialThe material object.
[out]hueThe Hue delta.
[out]saturationThe Saturation delta.
[out]lightnessThe Lightness delta.
Returns
enum SUResult SUMaterialGetColorizeType ( SUMaterialRef  material,
enum SUMaterialColorizeType type 
)
related

Retrieves the colorization type of a material object.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]materialThe material object.
[out]typeThe type retrieved.
Returns
enum SUResult SUMaterialGetMetallicFactor ( SUMaterialRef  material,
double *  factor 
)
related

Retrieves the metallic factor of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]factorThe factor returned.
Returns
enum SUResult SUMaterialGetMetallicTexture ( SUMaterialRef  material,
SUTextureRef texture 
)
related

Retrieves the metallic texture of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]textureThe texture containing the metalness information, if one exists. This texture should not be released via SUTextureRelease() since it is owned by the material.
Returns
enum SUResult SUMaterialGetName ( SUMaterialRef  material,
SUStringRef name 
)
related

Retrieves the internal name of a material object. The internal name is the unprocessed identifier string stored with the material.

Warning
Breaking Change: The behavior of this method was changed in SketchUp 2017, API 5.0. In previous releases this method retrieved the material's non-localized display name but it was changed to retrieve the internal name. If the old functionality is required, use SUMaterialGetNameLegacyBehavior.
Parameters
[in]materialThe material object.
[out]nameThe name retrieved.
Returns
enum SUResult SUMaterialGetNameLegacyBehavior ( SUMaterialRef  material,
SUStringRef name 
)
related

Retrieves the name of a material object. This method was added for users who require the functionality of SUMaterialGetName() prior to SketchUp 2017, API 5.0. If the internal name is encased in square brackets, [], this method will return the name without brackets, otherwise the name will match the name retrieved by SUMaterialGetName.

Since
SketchUp 2017, API 5.0
Parameters
[in]materialThe material object.
[out]nameThe name retrieved.
Returns
enum SUResult SUMaterialGetNormalScale ( SUMaterialRef  material,
double *  scale 
)
related

Retrieves the normal scale of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]scaleNormal scale returned.
Returns
enum SUResult SUMaterialGetNormalStyle ( SUMaterialRef  material,
enum SUMaterialNormalMapStyle style 
)
related

Retrieves the normal mapping style of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]styleNormal style returned.
Returns
enum SUResult SUMaterialGetNormalTexture ( SUMaterialRef  material,
SUTextureRef texture 
)
related

Retrieves the normal texture of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]textureThe texture containing the normal information, if one exists. This texture should not be released via SUTextureRelease() since it is owned by the material.
Returns
enum SUResult SUMaterialGetOpacity ( SUMaterialRef  material,
double *  alpha 
)
related

Retrieves the alpha value (0.0 - 1.0) of a material object.

Parameters
[in]materialThe material object.
[out]alphaThe alpha value retrieved.
Returns
enum SUResult SUMaterialGetOwnerType ( SUMaterialRef  material,
enum SUMaterialOwnerType type 
)
related

Retrieves the owner type of a material object.

Warning
Materials owned by SUImageRef and SULayerRef may not be applied to any other entity in the model.
Since
SketchUp 2019.2, API 7.1
Parameters
[in]materialThe material object.
[out]typeThe type retrieved.
Returns
enum SUResult SUMaterialGetRoughnessFactor ( SUMaterialRef  material,
double *  factor 
)
related

Retrieves the roughness factor of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]factorThe factor returned.
Returns
enum SUResult SUMaterialGetRoughnessTexture ( SUMaterialRef  material,
SUTextureRef texture 
)
related

Retrieves the roughness texture of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]textureThe texture containing the roughness information, if one exists. This texture should not be released via SUTextureRelease() since it is owned by the material.
Returns
enum SUResult SUMaterialGetTexture ( SUMaterialRef  material,
SUTextureRef texture 
)
related

Retrieves the texture of a material object.

Parameters
[in]materialThe material object.
[out]textureThe texture object retrieved. This texture should not be released via SUTextureRelease() since it is owned by the material.
Returns
enum SUResult SUMaterialGetType ( SUMaterialRef  material,
enum SUMaterialType type 
)
related

Retrieves the type of a material object.

Parameters
[in]materialThe material object.
[out]typeThe type retrieved.
Returns
enum SUResult SUMaterialGetUseOpacity ( SUMaterialRef  material,
bool *  use_opacity 
)
related

Retrieves the flag indicating whether alpha values are used from a material object.

Parameters
[in]materialThe material object.
[out]use_opacityThe flag retrieved.
Returns
enum SUResult SUMaterialGetWorkflow ( SUMaterialRef  material,
enum SUMaterialWorkflow workflow 
)
related

Queries the workflow type of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]workflowThe returned workflow type.
Returns
enum SUResult SUMaterialIsAOEnabled ( SUMaterialRef  material,
bool *  enabled 
)
related

Queries whether ambient occlusion mapping is enabled for the material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]enabledWhether occlusion mapping is enabled or not.
Returns
enum SUResult SUMaterialIsDrawnTransparent ( SUMaterialRef  material,
bool *  transparency 
)
related

Retrieves the flag indicating whether the material is drawn with transparency.

Since
SketchUp 2018, API 6.0
Parameters
[in]materialThe material object.
[out]transparencyThe flag retrieved.
Returns
enum SUResult SUMaterialIsMetalnessEnabled ( SUMaterialRef  material,
bool *  enabled 
)
related

Queries whether metalness properties are enabled for the material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]enabledWhether metalness is enabled or not.
Returns
enum SUResult SUMaterialIsNormalEnabled ( SUMaterialRef  material,
bool *  enabled 
)
related

Queries whether normal mapping is enabled for the material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]enabledWhether normal mapping is enabled or not.
Returns
enum SUResult SUMaterialIsRoughnessEnabled ( SUMaterialRef  material,
bool *  enabled 
)
related

Queries whether roughness properties are enabled for the material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[out]enabledWhether roughness is enabled or not.
Returns
enum SUResult SUMaterialRelease ( SUMaterialRef material)
related

Releases a material and its resources.

The material must not be associated with a parent object such as a face.

Parameters
[in,out]materialThe material to be released.
Returns
enum SUResult SUMaterialSetAOEnabled ( SUMaterialRef  material,
bool  enable 
)
related

Enables ambient occlusion map for the material.

Note
An ambient occlusion map texture must be set before enabling it.
Since
SketchUp 2025.0.2, API 13.1
Parameters
[in,out]materialThe material object.
[in]enableWhether to enable or disable.
Returns
enum SUResult SUMaterialSetAOStrength ( SUMaterialRef  material,
double  strength 
)
related

Sets the ambient occlusion strength of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]strengthStrength to set. The valid range is [0.0, 1.0].
Returns
enum SUResult SUMaterialSetAOTexture ( SUMaterialRef  material,
SUTextureRef  texture 
)
related

Sets the ambient occlusion texture of a PBR material.

Note
Materials take ownership of their assigned textures, so textures should not be shared accross different materials.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]textureThe texture containing the occlusion information. Should be an 8 bit per pixel (single channel) image. If an invalid texture reference is given (i.e. SU_INVALID), then any existing AO texture will be removed from the material, which will effectively disable AO mapping.
Returns
enum SUResult SUMaterialSetColor ( SUMaterialRef  material,
const SUColor color 
)
related

Sets the color of a material object.

Parameters
[in]materialThe material object.
[in]colorThe color value to set the material color.
Returns
enum SUResult SUMaterialSetColorizeType ( SUMaterialRef  material,
enum SUMaterialColorizeType  type 
)
related

Sets the colorization type of a material object. This is used when the material's color is set to a custom value. Call this function after calling SUMaterialSetColor as otherwise the colorize type will be reset.

Since
SketchUp 2019.2, API 7.1
Parameters
[in]materialThe material object.
[in]typeThe type to set.
Returns
enum SUResult SUMaterialSetMetallicFactor ( SUMaterialRef  material,
double  factor 
)
related

Sets the metallic factor of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]factorMetallic factor to set. The valid range is [0.0, 1.0].
Returns
enum SUResult SUMaterialSetMetallicTexture ( SUMaterialRef  material,
SUTextureRef  texture 
)
related

Sets the metallic texture of a PBR material.

Note
Materials take ownership of their assigned textures, so textures should not be shared accross different materials.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]textureThe texture containing the metalness information. Should be an 8 bit per pixel (single channel) image. If an invalid texture reference is given (i.e. SU_INVALID), then any existing metallic texture will be removed from the material.
Returns
enum SUResult SUMaterialSetMetalnessEnabled ( SUMaterialRef  material,
bool  enable 
)
related

Enables metalness properties for the material.

Note
After this is enabled, a metallic texture and/or a metallic factor can be set.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]enableWhether to enable or disable.
Returns
enum SUResult SUMaterialSetName ( SUMaterialRef  material,
const char *  name 
)
related

Sets the name of a material object.

Warning
Breaking Change: A new failure mode was added in SketchUp 2018, API 6.0. Returns SU_ERROR_INVALID_ARGUMENT if the material is managed by a model and the provided name was previously associated with a different material in the model.
Parameters
[in]materialThe material object.
[in]nameThe name to set the material name. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUMaterialSetNormalEnabled ( SUMaterialRef  material,
bool  enable 
)
related

Enables normal map for the material.

Note
A normal map texture must be set before enabling it.
Since
SketchUp 2025.0.2, API 13.1
Parameters
[in,out]materialThe material object.
[in]enableWhether to enable or disable.
Returns
enum SUResult SUMaterialSetNormalScale ( SUMaterialRef  material,
double  scale 
)
related

Sets the normal scale of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]scaleNormal scale to set. Should be >= 0.0
Returns
enum SUResult SUMaterialSetNormalStyle ( SUMaterialRef  material,
enum SUMaterialNormalMapStyle  style 
)
related

Sets the normal mapping style of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]styleNormal style to set.
Returns
enum SUResult SUMaterialSetNormalTexture ( SUMaterialRef  material,
SUTextureRef  texture 
)
related

Sets the normal texture of a PBR material.

Note
Materials take ownership of their assigned textures, so textures should not be shared accross different materials.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]textureThe texture containing the normal information. Should be an 24 bit per pixel (3 channel) image. If an invalid texture reference is given (i.e. SU_INVALID), then any existing normal texture will be removed from the material, which will effectively disable normal mapping.
Returns
enum SUResult SUMaterialSetOpacity ( SUMaterialRef  material,
double  alpha 
)
related

Sets the alpha value of a material object.

Parameters
[in]materialThe material object.
[in]alphaThe alpha value to set. Must be within range [0.0, 1.0].
Returns
enum SUResult SUMaterialSetRoughnessEnabled ( SUMaterialRef  material,
bool  enable 
)
related

Enables roughness properties for the material.

Note
After this is enabled, a roughness texture and/or a roughness factor can be set.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]enableWhether to enable or disable.
Returns
enum SUResult SUMaterialSetRoughnessFactor ( SUMaterialRef  material,
double  factor 
)
related

Sets the roughness factor of a material.

Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]factorRoughness factor to set. The valid range is [0.0, 1.0].
Returns
enum SUResult SUMaterialSetRoughnessTexture ( SUMaterialRef  material,
SUTextureRef  texture 
)
related

Sets the roughness texture of a PBR material.

Note
Materials take ownership of their assigned textures, so textures should not be shared accross different materials.
Since
SketchUp 2025.0, API 13.0
Parameters
[in]materialThe material object.
[in]textureThe texture containing the roughness information. Should be an 8 bit per pixel (single channel) image. If an invalid texture reference is given (i.e. SU_INVALID), then any existing metallic texture will be removed from the material.
Returns
enum SUResult SUMaterialSetTexture ( SUMaterialRef  material,
SUTextureRef  texture 
)
related

Sets the texture of a material object.

Note
Materials take ownership of their assigned textures, so textures should not be shared accross different materials.
Parameters
[in]materialThe material object.
[in]textureThe texture object to set the material texture.
Returns
enum SUResult SUMaterialSetType ( SUMaterialRef  material,
enum SUMaterialType  type 
)
related

Sets the type of a material object.

Parameters
[in]materialThe material object.
[in]typeThe type to set.
Returns
enum SUResult SUMaterialSetUseOpacity ( SUMaterialRef  material,
bool  use_opacity 
)
related

Sets the flag indicating whether alpha values are used on a material object.

Parameters
[in]materialThe material object.
[in]use_opacityThe flag boolean value to set.
Returns
SUEntityRef SUMaterialToEntity ( SUMaterialRef  material)
related

Converts from an SUMaterialRef to an SUEntityRef. This is essentially an upcast operation.

Parameters
[in]materialThe given material reference.
Returns
  • The converted SUEntityRef if material is a valid object
  • If not, the returned reference will be invalid
enum SUResult SUMaterialWriteToFile ( SUMaterialRef  material,
const char *  file_path 
)
related

Writes a material to a SKM file.

Since
SketchUp 2021.1, API 9.1
Parameters
[in]materialThe material object.
[in]file_pathThe location to save the material to. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUModelLoadMaterial ( SUModelRef  model,
const char *  file_path,
SUMaterialRef material 
)
related

Loads a material from a SKM file.

If a matching material exists in the model it will be returned instead.

Since
SketchUp 2021.1, API 9.1
Parameters
[in]modelThe model object.
[in]file_pathThe location to load the material from. Assumed to be UTF-8 encoded.
[out]materialThe material object.
Returns

The documentation for this struct was generated from the following files: