This topic describes the ST_NumTextures function. This function returns the number of textures in an sfmesh object.
Syntax
int4 ST_NumTextures(sfmesh sfmeshObject);Parameters
| Parameter | Description |
|---|---|
| sfmeshObject | The sfmesh object. |
Description
This function returns the number of textures in an sfmesh object.
Examples
select ST_NumTextures('{"meshgeoms" : ["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"], "materials":[{"type":"db", "attributes": {"schema":"public","table":"t_material","column":"the_material","key":"num=1"}} ], "textures":[{"compressionType" : "None", "format" : "JPEG", "wrap" : "Wrap", "type" : "DB", "depth" : 3, "width" : 256, "height" : 256, "name" : "texture_name3", "size" : 72, "data" : {"schema":"public","table":"test","column":"the_texture","key":"num=1"}} ],"primitives" : [ {"meshgeom": 0, "material" : 0}], "nodes" : [ {"primitive" : 0} ] }'::sfmesh);
------------------------------
1