adds rendermaterial and rendermaterialproxy (#385)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from specklepy.objects.base import Base
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
class RenderMaterial(
|
||||
Base,
|
||||
speckle_type="Objects.Other.RenderMaterial",
|
||||
serialize_ignore={"diffuse", "emissive"},
|
||||
):
|
||||
"""
|
||||
Minimal physically based material DTO class. Based on references from
|
||||
https://threejs.org/docs/index.html#api/en/materials/MeshStandardMaterial
|
||||
"""
|
||||
|
||||
name: str
|
||||
opacity: float = 1.0
|
||||
metalness: float = 0.0
|
||||
roughness: float = 1.0
|
||||
diffuse: int # ARGB color as int
|
||||
emissive: int = 0 # ARGB color as int, defaults to black
|
||||
@@ -3,6 +3,7 @@ from typing import List, Optional
|
||||
|
||||
from specklepy.objects.base import Base
|
||||
from specklepy.objects.interfaces import IHasUnits
|
||||
from specklepy.objects.other import RenderMaterial
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@@ -46,3 +47,21 @@ class InstanceDefinitionProxy(
|
||||
objects: List[str]
|
||||
max_depth: int
|
||||
name: str
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
class RenderMaterialProxy(
|
||||
Base,
|
||||
speckle_type="Objects.Other.RenderMaterialProxy",
|
||||
detachable={"objects"},
|
||||
):
|
||||
"""
|
||||
used to store render material to object relationships in root collections
|
||||
|
||||
Args:
|
||||
objects (list): the list of application ids of objects used by render material
|
||||
value (RenderMaterial): the render material used by the objects
|
||||
"""
|
||||
|
||||
objects: List[str]
|
||||
value: RenderMaterial
|
||||
|
||||
Reference in New Issue
Block a user