Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy_extras/node_shader_utils.py
| Show First 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| def specular_texture_get(self): | def specular_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| print("NO NODES!") | print("NO NODES!") | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["Specular"], | self.node_principled_bsdf.inputs["Specular"], | ||||
| grid_row_diff=0, | grid_row_diff=0, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| specular_texture = property(specular_texture_get) | specular_texture = property(specular_texture_get) | ||||
| # -------------------------------------------------------------------- | # -------------------------------------------------------------------- | ||||
| # Roughness (also sort of inverse of specular hardness...). | # Roughness (also sort of inverse of specular hardness...). | ||||
| Show All 15 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| # Will only be used as gray-scale one... | # Will only be used as gray-scale one... | ||||
| def roughness_texture_get(self): | def roughness_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["Roughness"], | self.node_principled_bsdf.inputs["Roughness"], | ||||
| grid_row_diff=0, | grid_row_diff=0, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| roughness_texture = property(roughness_texture_get) | roughness_texture = property(roughness_texture_get) | ||||
| # -------------------------------------------------------------------- | # -------------------------------------------------------------------- | ||||
| # Metallic (a.k.a reflection, mirror). | # Metallic (a.k.a reflection, mirror). | ||||
| Show All 15 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| # Will only be used as gray-scale one... | # Will only be used as gray-scale one... | ||||
| def metallic_texture_get(self): | def metallic_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["Metallic"], | self.node_principled_bsdf.inputs["Metallic"], | ||||
| grid_row_diff=0, | grid_row_diff=0, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| metallic_texture = property(metallic_texture_get) | metallic_texture = property(metallic_texture_get) | ||||
| # -------------------------------------------------------------------- | # -------------------------------------------------------------------- | ||||
| # Transparency settings. | # Transparency settings. | ||||
| Show All 14 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| # Will only be used as gray-scale one... | # Will only be used as gray-scale one... | ||||
| def ior_texture_get(self): | def ior_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["IOR"], | self.node_principled_bsdf.inputs["IOR"], | ||||
| grid_row_diff=-1, | grid_row_diff=-1, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| ior_texture = property(ior_texture_get) | ior_texture = property(ior_texture_get) | ||||
| def transmission_get(self): | def transmission_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return 0.0 | return 0.0 | ||||
| Show All 11 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| # Will only be used as gray-scale one... | # Will only be used as gray-scale one... | ||||
| def transmission_texture_get(self): | def transmission_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["Transmission"], | self.node_principled_bsdf.inputs["Transmission"], | ||||
| grid_row_diff=-1, | grid_row_diff=-1, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| transmission_texture = property(transmission_texture_get) | transmission_texture = property(transmission_texture_get) | ||||
| def alpha_get(self): | def alpha_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return 1.0 | return 1.0 | ||||
| Show All 11 Lines | class PrincipledBSDFWrapper(ShaderWrapper): | ||||
| # Will only be used as gray-scale one... | # Will only be used as gray-scale one... | ||||
| def alpha_texture_get(self): | def alpha_texture_get(self): | ||||
| if not self.use_nodes or self.node_principled_bsdf is None: | if not self.use_nodes or self.node_principled_bsdf is None: | ||||
| return None | return None | ||||
| return ShaderImageTextureWrapper( | return ShaderImageTextureWrapper( | ||||
| self, self.node_principled_bsdf, | self, self.node_principled_bsdf, | ||||
| self.node_principled_bsdf.inputs["Alpha"], | self.node_principled_bsdf.inputs["Alpha"], | ||||
| grid_row_diff=-1, | grid_row_diff=-1, | ||||
| colorspace_name='Non-Color', | colorspace_name='Non-Colour Data', | ||||
| ) | ) | ||||
| alpha_texture = property(alpha_texture_get) | alpha_texture = property(alpha_texture_get) | ||||
| # -------------------------------------------------------------------- | # -------------------------------------------------------------------- | ||||
| # Emission color. | # Emission color. | ||||
| ▲ Show 20 Lines • Show All 326 Lines • Show Last 20 Lines | |||||