MCPcopy Create free account
hub / github.com/PerroEngine/Perro / parse_blend_kind

Method parse_blend_kind

perro_source/core/perro_animation/src/anim_tree.rs:244–266  ·  view source on GitHub ↗
(&mut self, close_block: &str)

Source from the content-addressed store, hash-verified

242 }
243
244 fn parse_blend_kind(&mut self, close_block: &str) -> Result<AnimationTreeNodeKind, String> {
245 let mut inputs = Vec::new();
246 let mut weights = Vec::new();
247 let mut mask = AnimationTreeMask::default();
248 loop {
249 if self.consume_close(close_block)? {
250 break;
251 }
252 let key = self.expect_ident()?;
253 self.expect(Token::Equals)?;
254 match key.as_str() {
255 "inputs" => inputs = self.parse_ref_list()?,
256 "weights" => weights = self.parse_f32_list()?,
257 "mask" => mask = self.parse_mask()?,
258 _ => self.skip_value()?,
259 }
260 }
261 Ok(AnimationTreeNodeKind::Blend {
262 inputs: Cow::Owned(inputs.into_iter().map(Cow::Owned).collect()),
263 weights: Cow::Owned(weights),
264 mask,
265 })
266 }
267
268 fn parse_add_kind(&mut self, close_block: &str) -> Result<AnimationTreeNodeKind, String> {
269 let mut base = Cow::Borrowed("");

Callers 1

Calls 8

consume_closeMethod · 0.80
parse_ref_listMethod · 0.80
parse_f32_listMethod · 0.80
parse_maskMethod · 0.80
skip_valueMethod · 0.80
expect_identMethod · 0.45
expectMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected