TextureController

Overview

Description

Path /v2/textures

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

Texture Object

An example for a texture JSON object.

{
  "id": 42,
  "material": "catalog1:aMaterialId",
  "mapping": "RGBA",
  "platform": "web",
  "image": "https://catalog.roomle.com/textures/82c3f8bce4f2ea5958bbe969465c827a9cc06ac9/image.jpg",
  "mmHeight": 250,
  "mmWidth": 250,
  "tileable": true,
  "definition": {
    "mmHeight": 250,
    "mmWidth": 250,
    "tileable": true,
    "mapping": "RGBA"
  }
}

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.

{
    "texture": 
        {textureObject},
    "textures": [
        {textureObject1},
        {textureObject2},
        ...
    ],
    "meta": {
        "lastUpdated": "2018-01-23T09:15:39.000Z",
        "cached": false,
        "total": 2,
        "serverTime": "2019-03-14T12:29:08.549Z"
    }
}

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:

  • "texture" - as image file

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

For more information on the assets, please check ElementAssets

Last updated