File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+ from specklepy .objects .base import Base
4+
5+
6+ @dataclass (kw_only = True )
7+ class RenderMaterial (
8+ Base ,
9+ speckle_type = "Objects.Other.RenderMaterial" ,
10+ serialize_ignore = {"diffuse" , "emissive" },
11+ ):
12+ """
13+ Minimal physically based material DTO class. Based on references from
14+ https://threejs.org/docs/index.html#api/en/materials/MeshStandardMaterial
15+ """
16+
17+ name : str
18+ opacity : float = 1.0
19+ metalness : float = 0.0
20+ roughness : float = 1.0
21+ diffuse : int # ARGB color as int
22+ emissive : int = 0 # ARGB color as int, defaults to black
Original file line number Diff line number Diff line change 33
44from specklepy .objects .base import Base
55from specklepy .objects .interfaces import IHasUnits
6+ from specklepy .objects .other import RenderMaterial
67
78
89@dataclass (kw_only = True )
@@ -46,3 +47,21 @@ class InstanceDefinitionProxy(
4647 objects : List [str ]
4748 max_depth : int
4849 name : str
50+
51+
52+ @dataclass (kw_only = True )
53+ class RenderMaterialProxy (
54+ Base ,
55+ speckle_type = "Objects.Other.RenderMaterialProxy" ,
56+ detachable = {"objects" },
57+ ):
58+ """
59+ used to store render material to object relationships in root collections
60+
61+ Args:
62+ objects (list): the list of application ids of objects used by render material
63+ value (RenderMaterial): the render material used by the objects
64+ """
65+
66+ objects : List [str ]
67+ value : RenderMaterial
You can’t perform that action at this time.
0 commit comments