Skip to content

threedthumbnails

roblox.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
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"])

__init__(self, client: Client, data: dict) special

Source code in roblox/threedthumbnails.py
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
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"])

__init__(self, data: dict) special

Source code in roblox/threedthumbnails.py
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
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"])

__init__(self, data: dict) special

Source code in roblox/threedthumbnails.py
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
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"]

__init__(self, data: dict) special

Source code in roblox/threedthumbnails.py
def __init__(self, data: dict):
    self.x: float = data["x"]
    self.y: float = data["y"]
    self.z: float = data["z"]