basilisk-engine 0.1.25__py3-none-any.whl → 0.1.27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of basilisk-engine might be problematic. Click here for more details.

Files changed (90) hide show
  1. basilisk/__init__.py +15 -15
  2. basilisk/audio/sound.py +27 -27
  3. basilisk/bsk_assets/cube.obj +48 -48
  4. basilisk/collisions/broad/broad_aabb.py +102 -102
  5. basilisk/collisions/broad/broad_bvh.py +137 -137
  6. basilisk/collisions/collider.py +95 -95
  7. basilisk/collisions/collider_handler.py +224 -224
  8. basilisk/collisions/narrow/contact_manifold.py +95 -95
  9. basilisk/collisions/narrow/dataclasses.py +34 -34
  10. basilisk/collisions/narrow/deprecated.py +46 -46
  11. basilisk/collisions/narrow/epa.py +91 -91
  12. basilisk/collisions/narrow/gjk.py +66 -66
  13. basilisk/collisions/narrow/graham_scan.py +24 -24
  14. basilisk/collisions/narrow/helper.py +29 -29
  15. basilisk/collisions/narrow/line_intersections.py +106 -106
  16. basilisk/collisions/narrow/sutherland_hodgman.py +75 -75
  17. basilisk/config.py +3 -3
  18. basilisk/draw/draw.py +100 -100
  19. basilisk/draw/draw_handler.py +175 -175
  20. basilisk/draw/font_renderer.py +28 -28
  21. basilisk/engine.py +169 -169
  22. basilisk/generic/abstract_bvh.py +15 -15
  23. basilisk/generic/abstract_custom.py +133 -133
  24. basilisk/generic/collisions.py +72 -72
  25. basilisk/generic/input_validation.py +66 -66
  26. basilisk/generic/math.py +6 -6
  27. basilisk/generic/matrices.py +35 -35
  28. basilisk/generic/meshes.py +72 -72
  29. basilisk/generic/quat.py +142 -142
  30. basilisk/generic/quat_methods.py +7 -7
  31. basilisk/generic/raycast_result.py +26 -26
  32. basilisk/generic/vec3.py +143 -143
  33. basilisk/input_output/IO_handler.py +91 -91
  34. basilisk/input_output/clock.py +49 -49
  35. basilisk/input_output/keys.py +43 -43
  36. basilisk/input_output/mouse.py +89 -89
  37. basilisk/input_output/path.py +14 -14
  38. basilisk/mesh/cube.py +33 -33
  39. basilisk/mesh/mesh.py +233 -233
  40. basilisk/mesh/mesh_from_data.py +150 -150
  41. basilisk/mesh/model.py +271 -271
  42. basilisk/mesh/narrow_aabb.py +89 -89
  43. basilisk/mesh/narrow_bvh.py +91 -91
  44. basilisk/mesh/narrow_primative.py +23 -23
  45. basilisk/nodes/helper.py +28 -28
  46. basilisk/nodes/node.py +689 -689
  47. basilisk/nodes/node_handler.py +97 -97
  48. basilisk/particles/particle_handler.py +64 -64
  49. basilisk/particles/particle_renderer.py +92 -92
  50. basilisk/physics/impulse.py +112 -112
  51. basilisk/physics/physics_body.py +43 -43
  52. basilisk/physics/physics_engine.py +35 -35
  53. basilisk/render/batch.py +103 -103
  54. basilisk/render/camera.py +260 -257
  55. basilisk/render/chunk.py +106 -106
  56. basilisk/render/chunk_handler.py +165 -165
  57. basilisk/render/frame.py +95 -95
  58. basilisk/render/framebuffer.py +163 -289
  59. basilisk/render/image.py +87 -87
  60. basilisk/render/image_handler.py +120 -120
  61. basilisk/render/light.py +96 -96
  62. basilisk/render/light_handler.py +58 -58
  63. basilisk/render/material.py +219 -219
  64. basilisk/render/material_handler.py +131 -131
  65. basilisk/render/post_process.py +139 -139
  66. basilisk/render/shader.py +118 -118
  67. basilisk/render/shader_handler.py +83 -83
  68. basilisk/render/sky.py +120 -120
  69. basilisk/scene.py +279 -279
  70. basilisk/shaders/batch.frag +276 -276
  71. basilisk/shaders/batch.vert +115 -115
  72. basilisk/shaders/crt.frag +31 -31
  73. basilisk/shaders/draw.frag +22 -22
  74. basilisk/shaders/draw.vert +25 -25
  75. basilisk/shaders/filter.frag +22 -22
  76. basilisk/shaders/frame.frag +12 -12
  77. basilisk/shaders/frame.vert +13 -13
  78. basilisk/shaders/geometry.frag +8 -8
  79. basilisk/shaders/geometry.vert +41 -41
  80. basilisk/shaders/normal.frag +59 -59
  81. basilisk/shaders/normal.vert +96 -96
  82. basilisk/shaders/particle.frag +71 -71
  83. basilisk/shaders/particle.vert +84 -84
  84. basilisk/shaders/sky.frag +9 -9
  85. basilisk/shaders/sky.vert +13 -13
  86. {basilisk_engine-0.1.25.dist-info → basilisk_engine-0.1.27.dist-info}/METADATA +38 -45
  87. basilisk_engine-0.1.27.dist-info/RECORD +106 -0
  88. {basilisk_engine-0.1.25.dist-info → basilisk_engine-0.1.27.dist-info}/WHEEL +1 -1
  89. basilisk_engine-0.1.25.dist-info/RECORD +0 -106
  90. {basilisk_engine-0.1.25.dist-info → basilisk_engine-0.1.27.dist-info}/top_level.txt +0 -0
@@ -1,59 +1,59 @@
1
- import moderngl as mgl
2
- import glm
3
- from ..render.light import DirectionalLight
4
-
5
-
6
- class LightHandler():
7
- engine: ...
8
- """Back reference to the parent engine"""
9
- scene: ...
10
- """Back reference to the parent scene"""
11
- ctx: mgl.Context
12
- """Back reference to the parent context"""
13
- directional_light: DirectionalLight
14
- """The directional light of the scene"""
15
- point_lights: list
16
- """List of all the point lights in the scene"""
17
-
18
- def __init__(self, scene) -> None:
19
- """
20
- Handles all the lights in a Basilisk scene.
21
- """
22
-
23
- # Back references
24
- self.scene = scene
25
- self.engine = scene.engine
26
- self.ctx = scene.engine.ctx
27
-
28
- # Intialize light variables
29
- self.directional_lights = None
30
- self.directional_lights = [DirectionalLight(self, direction=dir, intensity=intensity) for dir, intensity in zip(((1, -1, 1), (-.1, 3, -.1)), (1, .05))]
31
- self.point_lights = []
32
-
33
- # Initalize uniforms
34
- self.write()
35
-
36
- def write(self, program: mgl.Program=None, directional=True, point=False) -> None:
37
- """
38
- Writes all the lights in a scene to the given shader program
39
- """
40
-
41
- # if not program: program = self.engine.shader.program
42
-
43
- for shader in self.engine.shader_handler.shaders:
44
- if 'numDirLights' not in shader.uniforms: continue
45
-
46
- program = shader.program
47
-
48
- if directional and self.directional_lights and 'numDirLights' in self.engine.shader.uniforms:
49
-
50
- program['numDirLights'].write(glm.int32(len(self.directional_lights)))
51
-
52
- for i, light in enumerate(self.directional_lights):
53
- program[f'dirLights[{i}].direction'].write(light.direction)
54
- program[f'dirLights[{i}].intensity'].write(glm.float32(light.intensity))
55
- program[f'dirLights[{i}].color' ].write(light.color / 255.0)
56
- program[f'dirLights[{i}].ambient' ].write(glm.float32(light.ambient))
57
-
58
- if point:
1
+ import moderngl as mgl
2
+ import glm
3
+ from ..render.light import DirectionalLight
4
+
5
+
6
+ class LightHandler():
7
+ engine: ...
8
+ """Back reference to the parent engine"""
9
+ scene: ...
10
+ """Back reference to the parent scene"""
11
+ ctx: mgl.Context
12
+ """Back reference to the parent context"""
13
+ directional_light: DirectionalLight
14
+ """The directional light of the scene"""
15
+ point_lights: list
16
+ """List of all the point lights in the scene"""
17
+
18
+ def __init__(self, scene) -> None:
19
+ """
20
+ Handles all the lights in a Basilisk scene.
21
+ """
22
+
23
+ # Back references
24
+ self.scene = scene
25
+ self.engine = scene.engine
26
+ self.ctx = scene.engine.ctx
27
+
28
+ # Intialize light variables
29
+ self.directional_lights = None
30
+ self.directional_lights = [DirectionalLight(self, direction=dir, intensity=intensity) for dir, intensity in zip(((1, -1, 1), (-.1, 3, -.1)), (1, .05))]
31
+ self.point_lights = []
32
+
33
+ # Initalize uniforms
34
+ self.write()
35
+
36
+ def write(self, program: mgl.Program=None, directional=True, point=False) -> None:
37
+ """
38
+ Writes all the lights in a scene to the given shader program
39
+ """
40
+
41
+ # if not program: program = self.engine.shader.program
42
+
43
+ for shader in self.engine.shader_handler.shaders:
44
+ if 'numDirLights' not in shader.uniforms: continue
45
+
46
+ program = shader.program
47
+
48
+ if directional and self.directional_lights and 'numDirLights' in self.engine.shader.uniforms:
49
+
50
+ program['numDirLights'].write(glm.int32(len(self.directional_lights)))
51
+
52
+ for i, light in enumerate(self.directional_lights):
53
+ program[f'dirLights[{i}].direction'].write(light.direction)
54
+ program[f'dirLights[{i}].intensity'].write(glm.float32(light.intensity))
55
+ program[f'dirLights[{i}].color' ].write(light.color / 255.0)
56
+ program[f'dirLights[{i}].ambient' ].write(glm.float32(light.ambient))
57
+
58
+ if point:
59
59
  ...
@@ -1,220 +1,220 @@
1
- import glm
2
- import numpy as np
3
- from ..render.image import Image
4
- from ..generic.input_validation import *
5
-
6
- class Material():
7
- material_handler: ...
8
- """Back reference to the parent material handler"""
9
- name: str = None
10
- """Name of the material"""
11
- index: 0
12
- """Index of the material in the material uniform"""
13
-
14
- # Base Material Attributes
15
- color: glm.vec3 = glm.vec3(255.0, 255.0, 255.0)
16
- """Color multiplier of the material"""
17
- texture: Image = None
18
- """Key/name of the texture image in the image handler. If the image given does not exist, it must be loaded"""
19
- normal: Image = None
20
- """Key/name of the normal image in the image handler. If the image given does not exist, it must be loaded"""
21
-
22
- # PBR Material Attributes
23
- roughness: float
24
- """The roughness of the material, controlls both the specular and diffuse response"""
25
- subsurface: float
26
- """Amount of subsurface scattering the material exhibits. Value in range [0, 1]. Lerps between diffuse and subsurface lobes"""
27
- sheen: float
28
- """Amount of sheen the material exhibits. Additive lobe"""
29
- sheen_tint: float
30
- """Amount that the sheen is tinted to the base color. Set to white by default"""
31
- anisotropic: float
32
- """The amount of anisotropic behaviour the materials specular lobe exhibits"""
33
- specular: float
34
- """The strength of the specular lobe of the material"""
35
- metallicness: float
36
- """The metallicness of the material, which dictates how much light the surfaces diffuses"""
37
- specular_tint: float
38
- """Amount that the specular is tinted to the base color. Set to white by default"""
39
- clearcoat: float
40
- """Amount of clearcoat the material exhibits. Additive lobe"""
41
- clearcoat_gloss: float
42
- """The glossiness of the clearcoat layer. 0 For a satin appearance, 1 for a gloss appearance"""
43
-
44
- def __init__(self, name: str=None, color: tuple=(255.0, 255.0, 255.0), texture: Image=None, normal: Image=None, roughness_map: Image=None, ao_map: Image=None,
45
- roughness: float=0.7, subsurface: float=0.2, sheen: float=0.5, sheen_tint: float=0.5,
46
- anisotropic: float=0.0, specular: float=1.0, metallicness: float=0.0, specular_tint: float=0.0,
47
- clearcoat: float=0.5, clearcoat_gloss: float=0.25) -> None:
48
- """
49
- Basilisk Material object. Contains the data and images references used by the material.
50
- Args:
51
- name: str
52
- Identifier to be used by user
53
- color: tuple
54
- Base color of the material. Applies to textures as well
55
- texture: Basilisk Image
56
- The albedo map (color texture) of the material
57
- normal: Basilisk Image
58
- The normal map of the material.
59
- """
60
-
61
- # Set handler only when used by a scene
62
- self.material_handler = None
63
-
64
- self.index = 0
65
-
66
- self.name = name if name else ''
67
- self.color = color
68
- self.texture = texture
69
- self.normal = normal
70
- self.roughness_map = roughness_map
71
- self.ao_map = ao_map
72
- self.roughness = roughness
73
- self.subsurface = subsurface
74
- self.sheen = sheen
75
- self.sheen_tint = sheen_tint
76
- self.anisotropic = anisotropic
77
- self.specular = specular
78
- self.metallicness = metallicness
79
- self.specular_tint = specular_tint
80
- self.clearcoat = clearcoat
81
- self.clearcoat_gloss = clearcoat_gloss
82
-
83
- def get_data(self) -> list:
84
- """
85
- Returns a list containing all the gpu data in the material.
86
- Used by the material handler
87
- """
88
-
89
- # Add color and PBR data
90
- data = [self.color.x / 255.0, self.color.y / 255.0, self.color.z / 255.0, self.roughness, self.subsurface, self.sheen,
91
- self.sheen_tint, self.anisotropic, self.specular, self.metallicness, self.specular_tint, self.clearcoat, self.clearcoat_gloss]
92
-
93
- # Add texture data
94
- if self.texture: data.extend([1, self.texture.index.x, self.texture.index.y])
95
- else: data.extend([0, 0, 0])
96
-
97
- # Add normal data
98
- if self.normal: data.extend([1, self.normal.index.x, self.normal.index.y])
99
- else: data.extend([0, 0, 0])
100
-
101
- # Add roughness data
102
- if self.roughness_map: data.extend([1, self.roughness_map.index.x, self.roughness_map.index.y])
103
- else: data.extend([0, 0, 0])
104
-
105
- # Add ao data
106
- if self.ao_map: data.extend([1, self.ao_map.index.x, self.ao_map.index.y])
107
- else: data.extend([0, 0, 0])
108
-
109
- return data
110
-
111
- def __repr__(self) -> str:
112
- return f'<Basilisk Material | {self.name}, ({self.color.x}, {self.color.y}, {self.color.z}), {self.texture}>'
113
-
114
-
115
- @property
116
- def color(self): return self._color
117
- @property
118
- def texture(self): return self._texture
119
- @property
120
- def normal(self): return self._normal
121
- @property
122
- def roughness_map(self): return self._roughness_map
123
- @property
124
- def ao_map(self): return self._ao_map
125
- @property
126
- def roughness(self): return self._roughness
127
- @property
128
- def subsurface(self): return self._subsurface
129
- @property
130
- def sheen(self): return self._sheen
131
- @property
132
- def sheen_tint(self): return self._sheen_tint
133
- @property
134
- def anisotropic(self): return self._anisotropic
135
- @property
136
- def specular(self): return self._specular
137
- @property
138
- def metallicness(self): return self._metallicness
139
- @property
140
- def specular_tint(self): return self._specular_tint
141
- @property
142
- def clearcoat(self): return self._clearcoat
143
- @property
144
- def clearcoat_gloss(self): return self._clearcoat_gloss
145
-
146
-
147
- @color.setter
148
- def color(self, value: tuple | list | glm.vec3 | np.ndarray):
149
- self._color = validate_glm_vec3("Material", "color", value)
150
- if self.material_handler: self.material_handler.write(regenerate=True)
151
-
152
- @texture.setter
153
- def texture(self, value: Image | None):
154
- self._texture = validate_image("Material", "texture", value)
155
- if self.material_handler: self.material_handler.write(regenerate=True)
156
-
157
- @normal.setter
158
- def normal(self, value: Image | None):
159
- self._normal = validate_image("Material", "normal map", value)
160
- if self.material_handler: self.material_handler.write(regenerate=True)
161
-
162
- @roughness_map.setter
163
- def roughness_map(self, value: Image | None):
164
- self._roughness_map = validate_image("Material", "roughness_map", value)
165
- if self.material_handler: self.material_handler.write(regenerate=True)
166
-
167
- @ao_map.setter
168
- def ao_map(self, value: Image | None):
169
- self._ao_map = validate_image("Material", "ao_map map", value)
170
- if self.material_handler: self.material_handler.write(regenerate=True)
171
-
172
- @roughness.setter
173
- def roughness(self, value: float | int | glm.float32):
174
- self._roughness = validate_float("Material", "roughness", value)
175
- if self.material_handler: self.material_handler.write(regenerate=True)
176
-
177
- @subsurface.setter
178
- def subsurface(self, value: float | int | glm.float32):
179
- self._subsurface = validate_float("Material", "subsurface", value)
180
- if self.material_handler: self.material_handler.write(regenerate=True)
181
-
182
- @sheen.setter
183
- def sheen(self, value: float | int | glm.float32):
184
- self._sheen = validate_float("Material", "sheen", value)
185
- if self.material_handler: self.material_handler.write(regenerate=True)
186
-
187
- @sheen_tint.setter
188
- def sheen_tint(self, value: float | int | glm.float32):
189
- self._sheen_tint = validate_float("Material", "sheen tint", value)
190
- if self.material_handler: self.material_handler.write(regenerate=True)
191
-
192
- @anisotropic.setter
193
- def anisotropic(self, value: float | int | glm.float32):
194
- self._anisotropic = validate_float("Material", "anisotropic", value)
195
- if self.material_handler: self.material_handler.write(regenerate=True)
196
-
197
- @specular.setter
198
- def specular(self, value: float | int | glm.float32):
199
- self._specular = validate_float("Material", "specular", value)
200
- if self.material_handler: self.material_handler.write(regenerate=True)
201
-
202
- @metallicness.setter
203
- def metallicness(self, value: float | int | glm.float32):
204
- self._metallicness = validate_float("Material", "metallicness", value)
205
- if self.material_handler: self.material_handler.write(regenerate=True)
206
-
207
- @specular_tint.setter
208
- def specular_tint(self, value: float | int | glm.float32):
209
- self._specular_tint = validate_float("Material", "specular tint", value)
210
- if self.material_handler: self.material_handler.write(regenerate=True)
211
-
212
- @clearcoat.setter
213
- def clearcoat(self, value: float | int | glm.float32):
214
- self._clearcoat = validate_float("Material", "clearcoat", value)
215
- if self.material_handler: self.material_handler.write(regenerate=True)
216
-
217
- @clearcoat_gloss.setter
218
- def clearcoat_gloss(self, value: float | int | glm.float32):
219
- self._clearcoat_gloss = validate_float("Material", "clearcoat gloss", value)
1
+ import glm
2
+ import numpy as np
3
+ from ..render.image import Image
4
+ from ..generic.input_validation import *
5
+
6
+ class Material():
7
+ material_handler: ...
8
+ """Back reference to the parent material handler"""
9
+ name: str = None
10
+ """Name of the material"""
11
+ index: 0
12
+ """Index of the material in the material uniform"""
13
+
14
+ # Base Material Attributes
15
+ color: glm.vec3 = glm.vec3(255.0, 255.0, 255.0)
16
+ """Color multiplier of the material"""
17
+ texture: Image = None
18
+ """Key/name of the texture image in the image handler. If the image given does not exist, it must be loaded"""
19
+ normal: Image = None
20
+ """Key/name of the normal image in the image handler. If the image given does not exist, it must be loaded"""
21
+
22
+ # PBR Material Attributes
23
+ roughness: float
24
+ """The roughness of the material, controlls both the specular and diffuse response"""
25
+ subsurface: float
26
+ """Amount of subsurface scattering the material exhibits. Value in range [0, 1]. Lerps between diffuse and subsurface lobes"""
27
+ sheen: float
28
+ """Amount of sheen the material exhibits. Additive lobe"""
29
+ sheen_tint: float
30
+ """Amount that the sheen is tinted to the base color. Set to white by default"""
31
+ anisotropic: float
32
+ """The amount of anisotropic behaviour the materials specular lobe exhibits"""
33
+ specular: float
34
+ """The strength of the specular lobe of the material"""
35
+ metallicness: float
36
+ """The metallicness of the material, which dictates how much light the surfaces diffuses"""
37
+ specular_tint: float
38
+ """Amount that the specular is tinted to the base color. Set to white by default"""
39
+ clearcoat: float
40
+ """Amount of clearcoat the material exhibits. Additive lobe"""
41
+ clearcoat_gloss: float
42
+ """The glossiness of the clearcoat layer. 0 For a satin appearance, 1 for a gloss appearance"""
43
+
44
+ def __init__(self, name: str=None, color: tuple=(255.0, 255.0, 255.0), texture: Image=None, normal: Image=None, roughness_map: Image=None, ao_map: Image=None,
45
+ roughness: float=0.7, subsurface: float=0.2, sheen: float=0.5, sheen_tint: float=0.5,
46
+ anisotropic: float=0.0, specular: float=1.0, metallicness: float=0.0, specular_tint: float=0.0,
47
+ clearcoat: float=0.5, clearcoat_gloss: float=0.25) -> None:
48
+ """
49
+ Basilisk Material object. Contains the data and images references used by the material.
50
+ Args:
51
+ name: str
52
+ Identifier to be used by user
53
+ color: tuple
54
+ Base color of the material. Applies to textures as well
55
+ texture: Basilisk Image
56
+ The albedo map (color texture) of the material
57
+ normal: Basilisk Image
58
+ The normal map of the material.
59
+ """
60
+
61
+ # Set handler only when used by a scene
62
+ self.material_handler = None
63
+
64
+ self.index = 0
65
+
66
+ self.name = name if name else ''
67
+ self.color = color
68
+ self.texture = texture
69
+ self.normal = normal
70
+ self.roughness_map = roughness_map
71
+ self.ao_map = ao_map
72
+ self.roughness = roughness
73
+ self.subsurface = subsurface
74
+ self.sheen = sheen
75
+ self.sheen_tint = sheen_tint
76
+ self.anisotropic = anisotropic
77
+ self.specular = specular
78
+ self.metallicness = metallicness
79
+ self.specular_tint = specular_tint
80
+ self.clearcoat = clearcoat
81
+ self.clearcoat_gloss = clearcoat_gloss
82
+
83
+ def get_data(self) -> list:
84
+ """
85
+ Returns a list containing all the gpu data in the material.
86
+ Used by the material handler
87
+ """
88
+
89
+ # Add color and PBR data
90
+ data = [self.color.x / 255.0, self.color.y / 255.0, self.color.z / 255.0, self.roughness, self.subsurface, self.sheen,
91
+ self.sheen_tint, self.anisotropic, self.specular, self.metallicness, self.specular_tint, self.clearcoat, self.clearcoat_gloss]
92
+
93
+ # Add texture data
94
+ if self.texture: data.extend([1, self.texture.index.x, self.texture.index.y])
95
+ else: data.extend([0, 0, 0])
96
+
97
+ # Add normal data
98
+ if self.normal: data.extend([1, self.normal.index.x, self.normal.index.y])
99
+ else: data.extend([0, 0, 0])
100
+
101
+ # Add roughness data
102
+ if self.roughness_map: data.extend([1, self.roughness_map.index.x, self.roughness_map.index.y])
103
+ else: data.extend([0, 0, 0])
104
+
105
+ # Add ao data
106
+ if self.ao_map: data.extend([1, self.ao_map.index.x, self.ao_map.index.y])
107
+ else: data.extend([0, 0, 0])
108
+
109
+ return data
110
+
111
+ def __repr__(self) -> str:
112
+ return f'<Basilisk Material | {self.name}, ({self.color.x}, {self.color.y}, {self.color.z}), {self.texture}>'
113
+
114
+
115
+ @property
116
+ def color(self): return self._color
117
+ @property
118
+ def texture(self): return self._texture
119
+ @property
120
+ def normal(self): return self._normal
121
+ @property
122
+ def roughness_map(self): return self._roughness_map
123
+ @property
124
+ def ao_map(self): return self._ao_map
125
+ @property
126
+ def roughness(self): return self._roughness
127
+ @property
128
+ def subsurface(self): return self._subsurface
129
+ @property
130
+ def sheen(self): return self._sheen
131
+ @property
132
+ def sheen_tint(self): return self._sheen_tint
133
+ @property
134
+ def anisotropic(self): return self._anisotropic
135
+ @property
136
+ def specular(self): return self._specular
137
+ @property
138
+ def metallicness(self): return self._metallicness
139
+ @property
140
+ def specular_tint(self): return self._specular_tint
141
+ @property
142
+ def clearcoat(self): return self._clearcoat
143
+ @property
144
+ def clearcoat_gloss(self): return self._clearcoat_gloss
145
+
146
+
147
+ @color.setter
148
+ def color(self, value: tuple | list | glm.vec3 | np.ndarray):
149
+ self._color = validate_glm_vec3("Material", "color", value)
150
+ if self.material_handler: self.material_handler.write(regenerate=True)
151
+
152
+ @texture.setter
153
+ def texture(self, value: Image | None):
154
+ self._texture = validate_image("Material", "texture", value)
155
+ if self.material_handler: self.material_handler.write(regenerate=True)
156
+
157
+ @normal.setter
158
+ def normal(self, value: Image | None):
159
+ self._normal = validate_image("Material", "normal map", value)
160
+ if self.material_handler: self.material_handler.write(regenerate=True)
161
+
162
+ @roughness_map.setter
163
+ def roughness_map(self, value: Image | None):
164
+ self._roughness_map = validate_image("Material", "roughness_map", value)
165
+ if self.material_handler: self.material_handler.write(regenerate=True)
166
+
167
+ @ao_map.setter
168
+ def ao_map(self, value: Image | None):
169
+ self._ao_map = validate_image("Material", "ao_map map", value)
170
+ if self.material_handler: self.material_handler.write(regenerate=True)
171
+
172
+ @roughness.setter
173
+ def roughness(self, value: float | int | glm.float32):
174
+ self._roughness = validate_float("Material", "roughness", value)
175
+ if self.material_handler: self.material_handler.write(regenerate=True)
176
+
177
+ @subsurface.setter
178
+ def subsurface(self, value: float | int | glm.float32):
179
+ self._subsurface = validate_float("Material", "subsurface", value)
180
+ if self.material_handler: self.material_handler.write(regenerate=True)
181
+
182
+ @sheen.setter
183
+ def sheen(self, value: float | int | glm.float32):
184
+ self._sheen = validate_float("Material", "sheen", value)
185
+ if self.material_handler: self.material_handler.write(regenerate=True)
186
+
187
+ @sheen_tint.setter
188
+ def sheen_tint(self, value: float | int | glm.float32):
189
+ self._sheen_tint = validate_float("Material", "sheen tint", value)
190
+ if self.material_handler: self.material_handler.write(regenerate=True)
191
+
192
+ @anisotropic.setter
193
+ def anisotropic(self, value: float | int | glm.float32):
194
+ self._anisotropic = validate_float("Material", "anisotropic", value)
195
+ if self.material_handler: self.material_handler.write(regenerate=True)
196
+
197
+ @specular.setter
198
+ def specular(self, value: float | int | glm.float32):
199
+ self._specular = validate_float("Material", "specular", value)
200
+ if self.material_handler: self.material_handler.write(regenerate=True)
201
+
202
+ @metallicness.setter
203
+ def metallicness(self, value: float | int | glm.float32):
204
+ self._metallicness = validate_float("Material", "metallicness", value)
205
+ if self.material_handler: self.material_handler.write(regenerate=True)
206
+
207
+ @specular_tint.setter
208
+ def specular_tint(self, value: float | int | glm.float32):
209
+ self._specular_tint = validate_float("Material", "specular tint", value)
210
+ if self.material_handler: self.material_handler.write(regenerate=True)
211
+
212
+ @clearcoat.setter
213
+ def clearcoat(self, value: float | int | glm.float32):
214
+ self._clearcoat = validate_float("Material", "clearcoat", value)
215
+ if self.material_handler: self.material_handler.write(regenerate=True)
216
+
217
+ @clearcoat_gloss.setter
218
+ def clearcoat_gloss(self, value: float | int | glm.float32):
219
+ self._clearcoat_gloss = validate_float("Material", "clearcoat gloss", value)
220
220
  if self.material_handler: self.material_handler.write(regenerate=True)