#[non_exhaustive]pub struct Binding {
pub attributes: Vec<String>,
pub surface_shader: Option<String>,
pub displacement_shader: Option<String>,
pub volume_shader: Option<String>,
}Expand description
What an ɴsɪ attributes node resolves to for one piece of geometry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.attributes: Vec<String>Every attributes node gathered along the path, nearest the
geometry first, then in connection order.
The priority on a geometryattributes connection deliberately
does not reorder this: 3Delight ignores it, whatever the
specification says. A priority on a shader connection is
honoured; see Binding::surface_shader and research.md D12.
ɴsɪ gathers attributes along the whole path and considers
every node on it – “one attributes node can set object
visibility and another can set the surface shader” – so this is
a list, not a winner. A backend looking for one attribute takes
the first node in this list that defines it – correct only while
no node sets ATTR.priority and the attribute is not a
visibility one. Scene::attribute_value applies those two
rules and is the safe way to ask.
When this Binding came from a Placement, ask
Scene::attribute_value_along with that placement’s path
instead: attribute_value takes a geometry, so it refuses the
multi-parent node a placement exists for.
The handles are returned rather than their contents because what lives on them – visibility flags above all – is encoded differently by each renderer, and inventing a common shape for it here would be guesswork.
surface_shader: Option<String>The shader reached through surfaceshader, resolved across every
gathered node by the same rule, using the priority of the
surfaceshader connection itself.
None when nothing on the path sets one.
displacement_shader: Option<String>The displacementshader, resolved the same way.
volume_shader: Option<String>The volumeshader, resolved the same way.
Trait Implementations§
impl Eq for Binding
impl StructuralPartialEq for Binding
Auto Trait Implementations§
impl Forget for Binding
impl Freeze for Binding
impl Move for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.