Generic animation support for CEGUI::Window

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Generic animation support for CEGUI::Window

Postby Kulik » Sun Sep 26, 2010 11:33

Yeah you're right, my patch has a flaw that it doesn't set position to 0 when skipping the first frame.

Thanks for the patch, I will make some minor changes to it and report back. I don't think we want to skip steps if their size is larger than duration, this could cause problems as you said (not showing a frame window at all if framerate is too low because it has animation subscribed to "Shown", etc...).

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Generic animation support for CEGUI::Window

Postby Kulik » Sun Sep 26, 2010 13:02

I used ideas from your patch and made a more powerful version. It allows skipping and clamping of step deltas. Unfortunately it's a joint patch, it includes new checks and exception throws for animation name collisions, etc... I hope that isn't that big of a deal, I don't feel like hand splitting them. I gave it testing and it seems to work OK, clamping solves longer fps drops whilst skipping solves short term fps drops. Both default to never clamp and never skip so it doesn't break any existing code. The skip next frame defaults to true since user usually wants to start the animation after the next step, not before the next step. The difference is unnoticeable in most cases.

http://harcov.czenet.com/kulik/CEGUI/anim_cleanup.patch

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: Generic animation support for CEGUI::Window

Postby r0br0y » Wed Sep 29, 2010 12:41

really cool, works great - thanks!

regards
rob

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Generic animation support for CEGUI::Window

Postby CrazyEddie » Fri Oct 01, 2010 08:45

Just to confirm that this patch is now in CEGUI svn branches/v0-7 :)

CE.

xdinos
Just popping in
Just popping in
Posts: 13
Joined: Tue Apr 13, 2010 22:21

Re: Generic animation support for CEGUI::Window

Postby xdinos » Sat Oct 02, 2010 11:47

hi, and thanks for this great library

i have a question... i altered the taharezlook looknfeel and i 've added this animation definition to the titlebar

Code: Select all

<Animations>
        <AnimationDefinition name="FadeIn" duration="0.3" replayMode="once">
          <Affector property="CaptionColour" interpolator="colour">
            <KeyFrame position="0.0" value="80FFFFFF" />
            <KeyFrame position="0.3" value="FFFFFFFF" />
          </Affector>
          <Subscription event="MouseEntersArea" action="Start" />
        </AnimationDefinition>
        <AnimationDefinition name="FadeOut" duration="0.3" replayMode="once">
          <Affector property="CaptionColour" interpolator="colour">
            <KeyFrame position="0.0" value="FFFFFFFF" />
            <KeyFrame position="0.3" value="80FFFFFF" />
          </Affector>
          <Subscription event="MouseLeavesArea" action="Start" />
        </AnimationDefinition>       
      </Animations>


then i noticed that if i change the order of the AnimationDefinition tags i get a different visual result if i pass quickly over the titlebar of a framewindow
the behavior is something like this ...
the color fadein to white (FFFFFFFF) and then suddenly goes to (80FFFFFF)

thank you

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Generic animation support for CEGUI::Window

Postby Kulik » Sat Oct 02, 2010 14:00

xdinos: The reason for this is quite simple, when you pass a mouse quickly, at one point, 2 animations are running.

To quickly fix this, pause (if you stop, you could theoretically get a one frame flicker, pausing is safer for this) the offending animation at the events of the right animation starting.

Code: Select all

<Animations>
        <AnimationDefinition name="FadeIn" duration="0.3" replayMode="once">
          <Affector property="CaptionColour" interpolator="colour">
            <KeyFrame position="0.0" value="80FFFFFF" />
            <KeyFrame position="0.3" value="FFFFFFFF" />
          </Affector>
          <Subscription event="MouseEntersArea" action="Start" />
          <Subscription event="MouseLeavesArea" action="Pause" />
        </AnimationDefinition>
        <AnimationDefinition name="FadeOut" duration="0.3" replayMode="once">
          <Affector property="CaptionColour" interpolator="colour">
            <KeyFrame position="0.0" value="FFFFFFFF" />
            <KeyFrame position="0.3" value="80FFFFFF" />
          </Affector>
          <Subscription event="MouseLeavesArea" action="Start" />
          <Subscription event="MouseEntersArea" action="Pause" />
        </AnimationDefinition>       
      </Animations>


The reason for a different visual result is that when 2 animations are started at once to the same property, the latter actually overrides the former.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests