Quantcast Animation groups. Scaling frames with children - WoWInterface
 
Thread Tools Display Modes
06-01-16, 01:47 AM   #1
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
Animation groups. Scaling frames with children

Not sure if this is a bug. But what I was expecting was the same thing that happens when you SetScale() on a frame that has children.

What happens instead is every child texture or frame and the parts of the backdrop borders get scaled. Looks ugly. As a work around. I had to do an OnUpdate that applies SetScale() based on Animation:GetProgress()

Update:
Bad Scaling https://www.youtube.com/watch?v=2CpTr0187I4
Good Scaling https://www.youtube.com/watch?v=d1dQ6idHK0s

Last edited by galvin : 06-01-16 at 10:30 AM.
 
06-01-16, 10:55 AM   #2
dssd
A Fallenroot Satyr
Join Date: May 2016
Posts: 25
Is this different from how it works on live?

The UI anim system works directly at the rendering layer and not at the anchoring layer, so the behaviors are expectedly different.
 
06-01-16, 11:00 AM   #3
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
Not sure on live, but that can't be right, its not usable like that. IMO it should work like SetScale().

And Scale Animation has a SetOrigin() function, which is like its own version of SetPoint()

My mod won't work on live, too many changes, so I cant test that.
Even if it works like that on live, beta is the best time to fix it.
 
06-02-16, 06:30 PM   #4
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
This is related but it deals with alpha. When using an animationgroup on a frame with children. And you're using alpha. It conflicts with SetAlpha() calls that happen at the same time.

The work around is the same as with Scale. Use an OnUpdate and use SetAlpha().

My suggestion is if possible make it work like SetAlpha()

The C code I imagine to do both SetAlpha and SetScale could be used to work in the AnimationGroups.

Anyway thanks. Just glad I was able to do work arounds.
 
06-03-16, 02:19 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Why would you do that in first place?

If you need to change the behaviour of the animation while it is playing just trigger a function like this: https://github.com/zorker/rothui/blo...efader.lua#L44

You can pause the animation, apply new setting and then Play/Stop it. You can use the "OnFinished" script for further adjustments.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
06-03-16, 10:28 AM   #6
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
Well Scale had to be done that way anyway. I'm not new to animation groups.

The bars in my addon show resources, so while its animating its possible the resource could change. And resource changing has its own animation as well. So with this change I can play two alpha animations at the same time and they won't conflict with each other. There's no way pause can fix that. One is playing on the parent frame, and the other is playing on a child frame that has a texture.

What happens is when you try to alpha animate a child texture while its parent is also alpha animating. Is the child frame gets stuck. On live you had to reloudUI to fix it (unless that was fixed?) On beta you don't but you still get the stuck alpha. On live I just prevented any child frame from animating if its parent was fading. But that added complexity and didn't look as nice.

The current Animation works like this. Parent and Child. The animation runs on Parent. It will then set the alpha value to Parent and Child. If there is alpha animation running on Child, it will get overwritten by the animation alpha running on Parent. Cause the animator overwrites the alpha on all children. So you get conflicts. I cant be the only person to have seen this issue. Course a call to SetAlpha in OnFinished will restore the frame. But the issue you want to fix is while its playing.

SetScale() and SetAlpha() work differently. You can change a parent but it won't alter a SetScale or SetAlpha setting on a child frame. By placing these inside the animation OnUpdate you create a better animator. For Alpha and Scale I only use OnUpdate for the parent, and use the built in for children. And Scale I had to use cause it doesn't work nice with child frames which I explained above.

Anyway I hope I was clear why I did it this way.

Last edited by galvin : 06-03-16 at 10:55 AM.
 
06-03-16, 10:51 AM   #7
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
The question is, is it intented to work like this, or is it just a beta bug?

It pretty much looks like a bug at all..
__________________

Last edited by syncrow : 06-03-16 at 10:53 AM.
 
06-03-16, 11:17 AM   #8
galvin
A Frostmaul Preserver
Join Date: Nov 2006
Posts: 263
Ok after further testing, looks like two animation alpha's playing at the same time work ok. Can't be 100% sure. But if I do a SetAlpha() on a child frame while the parent is animating. The first SetAlpha() call works, but future SetAlpha() calls don't, until the animation is done. I know on live playing two animations on parent and child was an issue, but it may have been fixed. I never looked into this again till a week ago. The original fade code I wrote around 5 years ago.

So Zork may be right a pause may fix the issue. But it adds more complexity. Its easier if I don't have to check at all.

But Scale totally doesn't work nice on child frames though.

Edit: The child frame also has animation alpha playing too during the SetAlpha() but this doesn't seem to cause an issue. Its only when modifying child when parent is animating.

Last edited by galvin : 06-03-16 at 11:34 AM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Animation groups. Scaling frames with children

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off