Skip to content

threedthumbnails

Contains classes related to 3D thumbnails.

ThreeDThumbnail

Represents a user's 3D Thumbnail data. For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.

Attributes:

Name Type Description
mtl ThumbnailCDNHash

A CDN hash pointing to the MTL data.

obj ThumbnailCDNHash

A CDN hash pointing to the OBJ data.

textures List[ThumbnailCDNHash]

A list of CDN hashes pointing to PNG texture data.

camera ThreeDThumbnailCamera

The camera object.

aabb ThreeDThumbnailAABB

The AABB object.

Source code in roblox/threedthumbnails.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class ThreeDThumbnail:
    """
    Represents a user's 3D Thumbnail data.
    For more info, see https://robloxapi.wiki/wiki/3D_Thumbnails.

    Attributes:
        mtl: A CDN hash pointing to the MTL data.
        obj: A CDN hash pointing to the OBJ data.
        textures: A list of CDN hashes pointing to PNG texture data.
        camera: The camera object.
        aabb: The AABB object.
    """

    def __init__(self, client: Client, data: dict):
        self._client: Client = client

        self.mtl: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data["mtl"])
        self.obj: ThumbnailCDNHash = self._client.delivery.get_thumbnail_cdn_hash(data["obj"])
        self.textures: List[ThumbnailCDNHash] = [
            self._client.delivery.get_thumbnail_cdn_hash(cdn_hash) for cdn_hash in data["textures"]
        ]
        self.camera: ThreeDThumbnailCamera = ThreeDThumbnailCamera(data["camera"])
        self.aabb: ThreeDThumbnailAABB = ThreeDThumbnailAABB(data["aabb"])

ThreeDThumbnailAABB

Represents AABB data in a 3D thumbnail. Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.

THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;

Attributes:

Name Type Description
min ThreeDThumbnailVector3

The minimum render position.

max ThreeDThumbnailVector3

The maximum render position.

Source code in roblox/threedthumbnails.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class ThreeDThumbnailAABB:
    """
    Represents AABB data in a 3D thumbnail.
    Roblox uses this data to calculate the maximum render distance used when rendering 3D thumbnails.
    ```js
    THREE.Vector3(json.aabb.max.x, json.aabb.max.y, json.aabb.max.z).length() * 4;
    ```

    Attributes:
        min: The minimum render position.
        max: The maximum render position.
    """

    def __init__(self, data: dict):
        self.min: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["min"])
        self.max: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["max"])

ThreeDThumbnailCamera

Represents a camera in a 3D thumbnail.

Attributes:

Name Type Description
fov float

The camera's field of view.

position ThreeDThumbnailVector3

The camera's position.

direction ThreeDThumbnailVector3

The camera's direction.

Source code in roblox/threedthumbnails.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class ThreeDThumbnailCamera:
    """
    Represents a camera in a 3D thumbnail.

    Attributes:
        fov: The camera's field of view.
        position: The camera's position.
        direction: The camera's direction.
    """

    def __init__(self, data: dict):
        self.fov: float = data["fov"]
        self.position: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["position"])
        self.direction: ThreeDThumbnailVector3 = ThreeDThumbnailVector3(data["direction"])

ThreeDThumbnailVector3

Represents a Vector3 used in a 3D thumbnail.

Attributes:

Name Type Description
x float

The X component of the vector.

y float

The Y component of the vector.

z float

The Z component of the vector.

Source code in roblox/threedthumbnails.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class ThreeDThumbnailVector3:
    """
    Represents a Vector3 used in a 3D thumbnail.

    Attributes:
        x: The X component of the vector.
        y: The Y component of the vector.
        z: The Z component of the vector.
    """

    def __init__(self, data: dict):
        self.x: float = data["x"]
        self.y: float = data["y"]
        self.z: float = data["z"]