-
Notifications
You must be signed in to change notification settings - Fork 27
negative playbackRate on c++ QClock and animationPlayer #145
Comments
I don't know why but when defining a Kuesa.AnimationPlayer and assign to them a clock. can easily start the animation in both directions (direct and reverse). but when define a NodeInstantiator and delegate Kuesa.AnimationPlayer we can not play the animation in the reverse direction by setting -1 to playbackRate. NodeInstantiator { but when change playbackRate duration animation from positive to negative correctly change playing direction and play reverse from the current frame to the first frame. some things like this 👍 NodeInstantiator { what we need is to play animation independently in both directions. |
The normalizeTime property of the AnimationPlayer defaults to 0. Could you try to change the normalizeTime value to 1 if you want to immediately start playing with a negative play rate? |
yes, now I can play the animation from the end to start. but there is a new problem when play animation in reverse mode at the end of animation "running" variable does not change to false but the normalized time set to zero. |
for example when starting the "DoorLAction" animation in DodgeViper.gltf file in reverse mode. signal runningChanged never called |
might need this patch. It's old though, may need updating |
In the patch, auto start from the end to the beginning was repaired, but at the moment, the problem is not sending a runningChanged signal when the animation is finished in backward mode, and also some animations are not played completely. |
simply can test is,
|
simple code like this: Kuesa.AnimationPlayer { |
my problem solved by writing a watching method in animation player parent and check normalizedTimeChanged if equal to zero consider animation finished. |
there is another question why can not assign QMaterial to an entity when using Kuesa.ForwardRenderer against to pure qt ForwardRenderer ? |
hello
there is a problem in animationPlayer clock when using c++ API to instantiate animationPlayer and set the clock to them.
for positive playebackRate animation play correctly but in negative playbackRate animation not work.
in qml api usage negative an positive animation is ok.
sample code :
auto player = new Kuesa::AnimationPlayer(m_sceneEntity);
player->setSceneEntity(m_sceneEntity);
player->setClip(clipName);
if (player->status() == Kuesa::AnimationPlayer::Ready) {
player->setClock(m_clock);
m_clock->setPlaybackRate(reverse ? -1.0 : 1.0);
player->start();
}
`
The text was updated successfully, but these errors were encountered: