Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Start by selecting the room you want to modify. Every room in Wizart has a unique identifier (UUID), which can be obtained through either the API or the Wizart PIM interface. With the room UUID, you can request detailed data about the room.

API Endpoint:

GET /api/v1.2/rooms/{room_uuid}

Code Block
languagejson
{ 
  "uuidscene_data": "88cc386a-0897-48ea-93ed-a8aee0609253",{
    "titleversion": "Wizart GO-1551 31.2",
    "imageinterior_pathmeta": "interiors/reserved/images/4b0a7a56-2f6f-4c22-9135-8f28ea004106.jpg",{
      "room_type_titleFoV": "Bathroom"57,
      "roomeuler_type_idx": 90,
   "width"   "euler_z": 25600,
   "height": 1706,    "surfaceskey_plane_distance": ["wall", "floor"],0.75,
      "createdkey_points_attype": "24.01.2022"0,
   "mask_name   "lighting": "mask.png", [
      "ceiling": null, [
  "floor": {      "x": 52.25457191467285 0,
     "y": 88.72437382079792      }-5.5,
   "walls": [      {-4,
       "x": 3,   200
    "y": 20,   ],
    "wall_id": 0   [
  }, {        "x": 35,1.3,
         "y": 20 0.2,
       "wall_id": 1  -3.5,
   }, {      15
 "x": 87,        "y": 20,],
        [
          -1,
          -1,
          -1,
          15
 "wall_id": 2       ]
  }    ]
 }

This response provides detailed room information, including surfaces (walls, floor, etc.), dimensions, and unique wall identifiers. You’ll use this data to apply materials in the next step.

Step 2: Prepare the Request Body with Material Data

To apply materials, you need to fill in the room’s surfaces with the appropriate product information. For each surface (floor, wall, ceiling), you can specify a material to apply.

If you want to apply a material to a surface, include the material object for that surface. If no material is passed for a surface, no changes will be made to it.

Material Object Properties:

  • material_uuid: Product UUID from PIM or retrieved through the API.

  • code: Layout code. Some products may have multiple layouts, allowing you to choose which to apply.

  • custom_rotation_angle: For flooring materials and tiles on walls, you can specify a rotation angle to apply the material in different orientations.

Example Request Body:

Code Block
{ 
  "room_data": { 
    "room": { 
      "id": "example-room-uuid",   },
    "walls": [
      {
        "wall_id": 0,
        "points": [
          [
            -2.927154302597046,
            1.6236560344696045,
            -3.5926945209503174
          ],
          [
            -1.6397849321365356,
            1.6236560344696045,
            -4.22320032119751
         "floor": { ],
         "material": {[
           "material_uuid": "example-floor-material-uuid"-2.927154302597046,
           "custom_rotation_angle": 0 -0.75,
           "code": "no_pattern" -3.5926945209503174
          ],
}        },  [
     "ceiling": {      -1.6397849321365356,
   "material": {          -0.75,
 "material_uuid": "example-ceiling-material-uuid",          -4.22320032119751
 "code": "no_pattern"        ]
 }       ],
},        "wallsnormal": [
         { 0.4398435652256012,
          "wall_id": 0,
           "is_active": true,0.8980743885040283
        ],
   "material": {    "width": 1.4334774017333984,
        "material_uuidheight": "example-floor-material-uuid"2.3736560344696045,
        "applicable": true,
        "codecx": "no_pattern" 14,
        "cy": 38,
      }  "point_to_place_object": null
      },
 {     {
        "wall_id": 1, 
 
        "is_activepoints": true,[
           "custom_rotation_angle": 0,[
            "material": {-1.6397849321365356,
            1.6236560344696045,
         "material_uuid": "example-wall-material-uuid", 
   -4.22320032119751
          ],
          [
           "code": "no_pattern" -2.203275680541992,
           } 1.6236560344696045,
        }    -5.655904769897461
   ]      } 
  } 
}

...

 ],
          [
            -1.6397849321365356,
            -0.75,
            -4.22320032119751
          ],
          [
            -2.203275680541992,
            -0.75,
            -5.655904769897461
          ]
        ],
        "normal": [
          0.930609405040741,
          0,
          -0.36601391434669495
        ],
        "width": 1.539533615112305,
        "height": 2.3736560344696045,
        "applicable": false,
        "cx": null,
        "cy": null,
        "point_to_place_object": null
      },
      {
        "wall_id": 2,
        "points": [
          [
            -2.203275680541992,
            1.6236560344696045,
            -5.655904769897461
          ],
          [
            -0.2818261682987213,
            1.6236560344696045,
            -6.6083245277404785
          ],
          [
            -2.203275680541992,
            -0.75,
            -5.655904769897461
          ],
          [
            -0.2818261682987213,
            -0.75,
            -6.6083245277404785
          ]
        ],
        "normal": [
          0.4441128075122833,
          0,
          0.89597088098526
        ],
        "width": 2.1445446014404297,
        "height": 2.3736560344696045,
        "applicable": false,
        "cx": null,
        "cy": null,
        "point_to_place_object": null
      },
      {
        "wall_id": 3,
        "points": [
          [
            -0.2818261682987213,
            1.6236560344696045,
            -6.6083245277404785
          ],
          [
            1.7091114521026611,
            1.6236560344696045,
            -2.097707986831665
          ],
          [
            -0.2818261682987213,
            -0.75,
            -6.6083245277404785
          ],
          [
            1.7091114521026611,
            -0.75,
            -2.097707986831665
          ]
        ],
        "normal": [
          -0.914845883846283,
          0,
          0.40380313992500305
        ],
        "width": 4.9304656982421875,
        "height": 2.3736560344696045,
        "applicable": true,
        "cx": 86,
        "cy": 32,
        "point_to_place_object": null
      }
    ],
    "floor": {
      "points": null,
      "applicable": true,
      "cx": 52,
      "cy": 89
    },
    "ceiling": {
      "points": [
        [
          -2.927154302597046,
          1.6236560344696045,
          -6.6083245277404785
        ],
        [
          -2.927154302597046,
          1.6236560344696045,
          -2.097707986831665
        ],
        [
          1.7091114521026611,
          1.6236560344696045,
          -2.097707986831665
        ],
        [
          1.7091114521026611,
          1.6236560344696045,
          -6.6083245277404785
        ]
      ],
      "applicable": true,
      "cx": 45.6,
      "cy": 11
    },
    "scene_image_info": null,
    "image_width": 2560,
    "image_height": 1706,
    "image_path": "interiors/reserved/images/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe.jpg",
    "mask_path": "interiors/reserved/data/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe/mask.png",
    "shadow_path": "interiors/reserved/data/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe/shadow.png"
  },
  "room_name": "Wizart WL_v3 1",
  "room_type": 1,
  "interior_type": "living_room",
  "has_walls": true,
  "has_floor": true,
  "has_ceiling": true,
  "id": "163d87b2-b0d7-4758-b8ee-1dcaf1c478fe",
  "order": 0,
  "is_visible": true,
  "created_at": "2024-10-11T10:28:23"
}

This response provides detailed room information, including surfaces (walls, floor, etc.), dimensions, and unique wall identifiers. Each surface contains x and y properties, which represent the center point of the surface as a percentage of the room image's width and height. These coordinates are particularly useful for developers who are working on web applications and need to place UI controls or interactive elements precisely on a surface. By using these relative percentage values, you can dynamically position UI components, such as buttons or material selection menus, directly over specific surfaces in the room's image. This allows for an intuitive and seamless user experience when applying or modifying materials on surfaces within the room.

...

Step 2: Retrieve Product Data

Receive products data from v1.0/articles.

Step 3: Prepare the Request Body with Product Data

To apply materials, you need to fill in the room’s surfaces with the appropriate product information. For each surface (floor, wall, ceiling), you can specify a material to apply.

Request body /v1.2/apply:

Code Block
languagejson
{
    "visualization_quality": "4k",
    "materials": [
        {
            "uuid": "6389edcb-971f-47df-bff7-62c76599d2ff",
            "product_type": "hardwood_flooring",
            "width": 2.54,
            "length": 2,
            "rapport_shift": null,
            "reverse_180": false,
            "overlap": null,
            "customized_size": false,
            "repeatable": false,
            "custom_rotation_angle": 0,
            "native_floor_rotation_angle": 0,
            "native_ceiling_rotation_angle": 0,
            "maps": {
                "color": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12240/6389edcb-971f-47df-bff7-62c76599d2ff/1_2_offset/e395fe80-d38a-4913-b248-dcac8fe7c175_color.jpg",
                "normal": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12240/6389edcb-971f-47df-bff7-62c76599d2ff/1_2_offset/10f6ca7f-e6e2-4b72-b3dc-3f9070d0af1c_normal.jpg",
                "roughness": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12240/6389edcb-971f-47df-bff7-62c76599d2ff/1_2_offset/10f6ca7f-e6e2-4b72-b3dc-3f9070d0af1c_roughness.jpg"
            }
        },
        {
            "uuid": "09d58e60-dd4d-4ded-ac7b-c5500d9035f0",
            "product_type": "wallpaper",
            "width": 0.5,
            "length": 0.5,
            "rapport_shift": null,
            "reverse_180": false,
            "overlap": null,
            "customized_size": false,
            "repeatable": false,
            "custom_rotation_angle": 0,
            "native_floor_rotation_angle": 0,
            "native_ceiling_rotation_angle": 0,
            "maps": {
                "color": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_color.png"
            }
        },
        {
            "uuid": "8baec939-e10e-4486-80fe-56bf185d94bb",
            "product_type": "plaster",
            "width": 0.5,
            "length": 0.5,
            "rapport_shift": null,
            "reverse_180": false,
            "overlap": null,
            "customized_size": false,
            "repeatable": false,
            "custom_rotation_angle": 0,
            "native_floor_rotation_angle": 0,
            "native_ceiling_rotation_angle": 0,
            "maps": {
                "color": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/9199/8baec939-e10e-4486-80fe-56bf185d94bb/no_pattern/Silk-Plaster-Victoria-708_color.jpg"
            }
        }
    ],
    "room_model": {
        "scene_data": {
            "version": "1.2",
            "interior_meta": {
                "FoV": 57,
                "euler_x": 0,
                "euler_z": 0,
                "key_plane_distance": 0.75,
                "key_points_type": 0,
                "lighting": [
                    [
                        0,
                        -5.5,
                        -4,
                        200
                    ],
                    [
                        1.3,
                        0.2,
                        -3.5,
                        15
                    ],
                    [
                        -1,
                        -1,
                        -1,
                        15
                    ]
                ]
            },
            "walls": [
                {
                    "wall_id": 0,
                    "points": [
                        [
                            -2.927154302597046,
                            1.6236560344696045,
                            -3.5926945209503174
                        ],
                        [
                            -1.6397849321365356,
                            1.6236560344696045,
                            -4.22320032119751
                        ],
                        [
                            -2.927154302597046,
                            -0.75,
                            -3.5926945209503174
                        ],
                        [
                            -1.6397849321365356,
                            -0.75,
                            -4.22320032119751
                        ]
                    ],
                    "normal": [
                        0.4398435652256012,
                        0,
                        0.8980743885040283
                    ],
                    "width": 1.4334774017333984,
                    "height": 2.3736560344696045,
                    "applicable": true,
                    "material_uuid": "09d58e60-dd4d-4ded-ac7b-c5500d9035f0",
                    "cx": 14,
                    "cy": 38,
                    "point_to_place_object": null
                },
                {
                    "wall_id": 1,
                    "points": [
                        [
                            -1.6397849321365356,
                            1.6236560344696045,
                            -4.22320032119751
                        ],
                        [
                            -2.203275680541992,
                            1.6236560344696045,
                            -5.655904769897461
                        ],
                        [
                            -1.6397849321365356,
                            -0.75,
                            -4.22320032119751
                        ],
                        [
                            -2.203275680541992,
                            -0.75,
                            -5.655904769897461
                        ]
                    ],
                    "normal": [
                        0.930609405040741,
                        0,
                        -0.36601391434669495
                    ],
                    "width": 1.539533615112305,
                    "height": 2.3736560344696045,
                    "applicable": false,
                    "cx": null,
                    "cy": null,
                    "point_to_place_object": null
                },
                {
                    "wall_id": 2,
                    "points": [
                        [
                            -2.203275680541992,
                            1.6236560344696045,
                            -5.655904769897461
                        ],
                        [
                            -0.2818261682987213,
                            1.6236560344696045,
                            -6.6083245277404785
                        ],
                        [
                            -2.203275680541992,
                            -0.75,
                            -5.655904769897461
                        ],
                        [
                            -0.2818261682987213,
                            -0.75,
                            -6.6083245277404785
                        ]
                    ],
                    "normal": [
                        0.4441128075122833,
                        0,
                        0.89597088098526
                    ],
                    "width": 2.1445446014404297,
                    "height": 2.3736560344696045,
                    "applicable": false,
                    "cx": null,
                    "cy": null,
                    "point_to_place_object": null
                },
                {
                    "wall_id": 3,
                    "points": [
                        [
                            -0.2818261682987213,
                            1.6236560344696045,
                            -6.6083245277404785
                        ],
                        [
                            1.7091114521026611,
                            1.6236560344696045,
                            -2.097707986831665
                        ],
                        [
                            -0.2818261682987213,
                            -0.75,
                            -6.6083245277404785
                        ],
                        [
                            1.7091114521026611,
                            -0.75,
                            -2.097707986831665
                        ]
                    ],
                    "normal": [
                        -0.914845883846283,
                        0,
                        0.40380313992500305
                    ],
                    "width": 4.9304656982421875,
                    "height": 2.3736560344696045,
                    "applicable": true,
                    "material_uuid": "09d58e60-dd4d-4ded-ac7b-c5500d9035f0",
                    "cx": 86,
                    "cy": 32,
                    "point_to_place_object": null
                }
            ],
            "floor": {
                "points": null,
                "applicable": true,
                "material_uuid": "6389edcb-971f-47df-bff7-62c76599d2ff",
                "cx": 52,
                "cy": 89
            },
            "ceiling": {
                "points": [
                    [
                        -2.927154302597046,
                        1.6236560344696045,
                        -6.6083245277404785
                    ],
                    [
                        -2.927154302597046,
                        1.6236560344696045,
                        -2.097707986831665
                    ],
                    [
                        1.7091114521026611,
                        1.6236560344696045,
                        -2.097707986831665
                    ],
                    [
                        1.7091114521026611,
                        1.6236560344696045,
                        -6.6083245277404785
                    ]
                ],
                "applicable": true,
                "material_uuid": "8baec939-e10e-4486-80fe-56bf185d94bb",
                "cx": 45.6,
                "cy": 11
            },
            "scene_image_info": null,
            "image_width": 2560,
            "image_height": 1706,
            "image_path": "interiors/reserved/images/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe.jpg",
            "mask_path": "interiors/reserved/data/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe/mask.png",
            "shadow_path": "interiors/reserved/data/163d87b2-b0d7-4758-b8ee-1dcaf1c478fe/shadow.png"
        },
        "room_name": "Wizart WL_v3 1",
        "room_type": 1,
        "interior_type": "living_room",
        "has_walls": true,
        "has_floor": true,
        "has_ceiling": true,
        "id": "163d87b2-b0d7-4758-b8ee-1dcaf1c478fe",
        "order": 0,
        "is_visible": true,
        "created_at": "2024-10-11T10:28:23"
    }
}

If you want to apply a material to a surface, include the material object for that surface. If no material is passed for a surface, no changes will be made to it.

Material Object Properties:

  • material_uuid: Product UUID from PIM or retrieved through the API. Specified for each surface (floor, walls, ceiling) in the "room_model" entity.

  • layout: Layout code. Some products may have multiple layouts, allowing you to choose which to apply.

  • rapport_shift (optional, float or null): Defines the vertical pattern shift between tiles.

  • reverse_180 (optional, boolean): Defines if each subsequent tile should be rotated 180 degrees.

  • overlap (optional, float or null): Defines the left overlap between material tiles.

  • repeatable (optional, boolean): Defines if the mural should be repeated horizontally between walls.

  • customized_size (optional, boolean): Defines if the mural should be scaled to fit the wall height and width proportionally.

  • custom_rotation_angle (optional, float, in radians): For flooring materials and tiles on walls, you can specify a rotation angle to apply the material in different orientations.

  • native_floor_rotation_angle/native_ceiling_rotation_angle (optional, float, in radians): For floor and ceiling materials, you can specify a default rotation angle. If not specified, the optimal angle will be calculated automatically.

Texture Maps Properties:

All texture maps can be provided as either a path to an S3 or a base64-encoded string.

  • color (required, string or base64): Defines the base texture material.

  • normal (optional, string or base64): Defines material details by simulating depth and bumps.

  • roughness (optional, string or base64): Defines material reflectivity.

  • metalness(optional, string or base64): Determines how metallic the material appears.

  • ao(optional, string or base64): Ambient occlusion map.

A more detailed description of material parameters and examples can be found in Configuring Repetitive Materials for Accurate Visualization in Wizart PIM page.

...

Step 4: Apply Materials to the Room

Once the request body is prepared with the room and material data, send the request to apply the materials to the room's surfaces.

API Endpoint:POST /api/v1/rooms/{room_uuid}/apply-materials

Use the room_data structure as the request body, and the API will return the room with the specified materials applied to the surfaces. The returned result will include an image of the room in base64 format, which can be used directly in your application to display the updated visualization with the applied materials. This allows developers to seamlessly integrate material updates and render the changes in real-time within their web or mobile applications.

6. Uploading Your Own Products to PIM

...