TextureController

Overview

Description

Path /v2/textures

Handles all requests regarding texture: creating, updating, deleting.

Texture Object

An example for a texture JSON object.

Responses are usually wrapped in a meta object, which contains additional information about the response and may contain a single texture or a list of textures.

JSON Fields

  • id

  • material

  • mapping

  • image

  • mmHeight

  • mmWidth

  • tileable

  • definition

CSV Fields

  • tex<N>_mapping: the mapping for the texture (e.g. "RGB", "RGBA", "XYZ" ...)

  • tex<N>_mmwidth

  • tex<N>_mmheight

  • tex<N>_tileable: 0 for false, 1 for true

  • tex<N>_image: URL to the texture image

API Reference

GET /

List of all textures matching the filter and visible to the Client

Generates: application/json

Response: Returns a container with a list of Texture JSON object.

Query Parameters

Name
Type
Comment

ids[]

List of strings

filters the result to the given material ids

material]

String

filters the result to the given material id

catalog

String

filters the result to the given catalog id

POST /

Accepts: json

Generates: json

for uploading a texture to a given material. There are meta data which has to be set and a definition parameter which has some well known properties but is extendable with custom properties.

meta information:

  • material: String ("catalog1:materialExtId1")

  • image: String

  • platform: String ("web")

definition well known properties:

  • mapping: String ("RGBA")

  • mmWidth: Long

  • mmHeight: Long

  • tileable: Boolean

GET /:id

Returns a specific texture.

Generates: application/json

Response (200 OK): Texture JSON object

DELETE /:id

Deletes a specific texture.

Response (204 NO CONTENT)

PUT /:id (json)

Updates the meta-information of a texture. Image needs to be uploaded explicitly (using ).

Accepts: application/json Generates: application/json

Body: Texture JSON object

Response (200 OK): updated Texture JSON object

Accepts: json

Generates: json

updates an existing texture with new information.

PUT /:id (multipart)

updates assets on an texture

Accepts: multipart-formdata

Generates: application/json

parameters:

  • the data, either as file or as URL. if both are provided, the URL is used

    • file : datafile to be uploaded

    • fileUrl: the publicly available url to the datafile

  • type: type of the asset

possible types are images:

  • "source" - as image file

Response (200 OK): updated Texture JSON object with updated asset

For more information on the assets, please check ElementAssets

Last updated