Code Monkey home page Code Monkey logo

Comments (6)

MangoLeFroot avatar MangoLeFroot commented on June 15, 2024

For anyone that is also wanting to mess with the newly added MorphWeights, I made forked the repo and made this function in plugin.rs. It seems to work for my purposes but I doubt this is the best way to do this. It doesn't cover having multiple models imported.

pub fn morph_animator_system<T: Component>(
    time: Res<Time>,
    mut query1: Query<(Entity, &mut Animator<T>)>,
    mut query2: Query<&mut T>,
    events: ResMut<Events<TweenCompleted>>,
) {
    let mut events: Mut<Events<TweenCompleted>> = events.into();
    for (entity, mut animator) in query1.iter_mut() {
        let target = query2.single_mut();
        if animator.state != AnimatorState::Paused {
            let speed = animator.speed();
            let mut target = ComponentTarget::new(target);
            animator.tweenable_mut().tick(
                time.delta().mul_f32(speed),
                &mut target,
                entity,
                &mut events,
            );
        }
    }
}

from bevy_tweening.

djeedai avatar djeedai commented on June 15, 2024

Did you add a component_animator_system()?

https://github.com/djeedai/bevy_tweening#custom-component-support

from bevy_tweening.

MangoLeFroot avatar MangoLeFroot commented on June 15, 2024

Did you add a component_animator_system()?

https://github.com/djeedai/bevy_tweening#custom-component-support

I did but in the code above, had to write my own seperating the target into it's own query for the MorphWeights to work.

These are the changes I made.
https://git.smolfroot.com/mangolefroot/bevy_tweening/-/commit/b2e9178f257dc26f18d1b6364689fa0dfe2259f9

from bevy_tweening.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.