pub struct EffectGraph {
pub header: EffectHeader,
pub properties: Vec<PropertyDef>,
pub texture_slots: Vec<TextureSlotDef>,
pub nodes: Vec<GraphNode>,
pub stacks: Vec<GraphStack>,
pub links: Vec<GraphLink>,
pub next_id: u32,
}Expand description
The semantic graph: header, properties, nodes, stacks, and links.
Plus the monotonic id allocator. Diff-friendly and layout-free.
Fields§
§header: EffectHeader§properties: Vec<PropertyDef>§texture_slots: Vec<TextureSlotDef>Host-supplied texture slots, ordered by sampling index.
Referenced by ImageBinding::Slot via stable SlotId and filled
per-instance by the host game through bevy_hanabi::EffectMaterial.
Asset-bound images are pinned on their source node and do not appear
here. Empty for an effect with no host-supplied textures.
nodes: Vec<GraphNode>§stacks: Vec<GraphStack>§links: Vec<GraphLink>§next_id: u32Next id to hand out; only ever increases. Ids are never recycled so that links and persisted layout stay valid across edits and reloads.
Implementations§
Source§impl EffectGraph
impl EffectGraph
Sourcepub fn empty() -> Self
pub fn empty() -> Self
An empty graph with a default header.
A placeholder for documents whose graph is not yet populated (e.g. a
legacy EffectAsset opened before the import path exists). Carries no
nodes, stacks, links, or properties.
Sourcepub fn alloc_node_id(&mut self) -> NodeId
pub fn alloc_node_id(&mut self) -> NodeId
Mint a fresh, never-before-used NodeId.
Sourcepub fn alloc_stack_id(&mut self) -> StackId
pub fn alloc_stack_id(&mut self) -> StackId
Mint a fresh, never-before-used StackId.
Drawn from the same counter as node ids so the two id spaces never collide.
Sourcepub fn alloc_property_id(&mut self) -> PropertyId
pub fn alloc_property_id(&mut self) -> PropertyId
Mint a fresh, never-before-used PropertyId.
Drawn from the same counter as node and stack ids so the three id spaces never collide.
Sourcepub fn alloc_slot_id(&mut self) -> SlotId
pub fn alloc_slot_id(&mut self) -> SlotId
Mint a fresh, never-before-used SlotId.
Drawn from the same counter as node, stack, and property ids so the four id spaces never collide.
pub fn node(&self, id: NodeId) -> Option<&GraphNode>
pub fn node_mut(&mut self, id: NodeId) -> Option<&mut GraphNode>
pub fn stack(&self, group: ModifierGroup) -> Option<&GraphStack>
pub fn property(&self, id: PropertyId) -> Option<&PropertyDef>
pub fn texture_slot(&self, id: SlotId) -> Option<&TextureSlotDef>
Sourcepub fn texture_slot_index(&self, id: SlotId) -> Option<usize>
pub fn texture_slot_index(&self, id: SlotId) -> Option<usize>
Sampling index of a texture slot (its position in texture_slots), by
id.
Trait Implementations§
Source§impl Clone for EffectGraph
impl Clone for EffectGraph
Source§fn clone(&self) -> EffectGraph
fn clone(&self) -> EffectGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectGraph
impl Debug for EffectGraph
Source§impl<'de> Deserialize<'de> for EffectGraph
impl<'de> Deserialize<'de> for EffectGraph
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>,
Source§impl PartialEq for EffectGraph
impl PartialEq for EffectGraph
Source§impl Serialize for EffectGraph
impl Serialize for EffectGraph
impl StructuralPartialEq for EffectGraph
Auto Trait Implementations§
impl Freeze for EffectGraph
impl RefUnwindSafe for EffectGraph
impl Send for EffectGraph
impl Sync for EffectGraph
impl Unpin for EffectGraph
impl UnsafeUnpin for EffectGraph
impl UnwindSafe for EffectGraph
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more