pub struct PrincipledBSDF { /* private fields */ }
Expand description
Material data for a mesh
§Blender
When exporting from Blender we read this data from the first Principled BSDF node in the node editor for the material
https://docs.blender.org/manual/en/latest/render/cycles/nodes/types/shaders/principled.html
Implementations§
Source§impl PrincipledBSDF
impl PrincipledBSDF
Sourcepub fn new(
base_color: MaterialInput<[f32; 3], String>,
roughness: MaterialInput<f32, (String, Channel)>,
metallic: MaterialInput<f32, (String, Channel)>,
normal_map: Option<String>,
) -> Self
pub fn new( base_color: MaterialInput<[f32; 3], String>, roughness: MaterialInput<f32, (String, Channel)>, metallic: MaterialInput<f32, (String, Channel)>, normal_map: Option<String>, ) -> Self
Create a new physically-based material.
Sourcepub fn base_color(&self) -> &MaterialInput<[f32; 3], String>
pub fn base_color(&self) -> &MaterialInput<[f32; 3], String>
The base_color of the material.
https://docs.blender.org/api/blender2.8/bpy.types.Material.html#bpy.types.Material.diffuse_color
Sourcepub fn roughness(&self) -> &MaterialInput<f32, (String, Channel)>
pub fn roughness(&self) -> &MaterialInput<f32, (String, Channel)>
The roughness of the material.
https://docs.blender.org/api/blender2.8/bpy.types.Material.html#bpy.types.Material.roughness
Sourcepub fn metallic(&self) -> &MaterialInput<f32, (String, Channel)>
pub fn metallic(&self) -> &MaterialInput<f32, (String, Channel)>
How metallic the material is. Most materials should be 0.0 or 1.0.
https://docs.blender.org/api/blender2.8/bpy.types.Material.html#bpy.types.Material.metallic
Sourcepub fn normal_map(&self) -> Option<&String>
pub fn normal_map(&self) -> Option<&String>
The normal map
Trait Implementations§
Source§impl Clone for PrincipledBSDF
impl Clone for PrincipledBSDF
Source§fn clone(&self) -> PrincipledBSDF
fn clone(&self) -> PrincipledBSDF
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PrincipledBSDF
impl Debug for PrincipledBSDF
Source§impl Default for PrincipledBSDF
impl Default for PrincipledBSDF
Source§fn default() -> PrincipledBSDF
fn default() -> PrincipledBSDF
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PrincipledBSDF
impl<'de> Deserialize<'de> for PrincipledBSDF
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PrincipledBSDF
impl PartialEq for PrincipledBSDF
Source§impl Serialize for PrincipledBSDF
impl Serialize for PrincipledBSDF
impl StructuralPartialEq for PrincipledBSDF
Auto Trait Implementations§
impl Freeze for PrincipledBSDF
impl RefUnwindSafe for PrincipledBSDF
impl Send for PrincipledBSDF
impl Sync for PrincipledBSDF
impl Unpin for PrincipledBSDF
impl UnwindSafe for PrincipledBSDF
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.