ST_JsonString

Updated at:

Returns the user-defined JSON string stored in a material object.

Syntax

cstring ST_JsonString(material material);

Parameters

ParameterDescription
materialThe material object.

Description

Returns the user-defined JSON string stored in a material object. If the material object contains no user-defined JSON string, NULL is returned.

Examples

SELECT ST_JsonString(ST_MakeMaterial('{"pbrMetallicRoughness": {"baseColorFactor": [ 1.000, 0.766, 0.336, 1.0 ], "metallicFactor": 0.5,"roughnessFactor": 0.1}}', ARRAY(SELECT the_texture from t_texture)));

Output:

{"pbrMetallicRoughness":{"baseColorFactor": [1.0,0.766,0.336,1.0], "metallicFactor":0.5,"roughnessFactor":0.1}}