Reading animation formulas - values of digits and decimals

# Reading animation formulas - values of digits and decimals

• 2011년 12월 27일 화요일 오전 12:17

I'm having trouble figuring out what the assumed values of digits and decimals are in animation formulas are supposed to represent. For example, let's look at the animation-start value of the width of a rectangle using the Basic Zoom - Out from Screen Bottom entrance animation (presetID="23" presetClass="entr" presetSubtype="36"). Note the bolded numbers in strVal:

```<p:childTnLst>
<p:set>...</p:set>
<p:anim calcmode="lin" valueType="num">
<p:cBhvr>
<p:cTn id="29" dur="2000" fill="hold"/>
<p:tgtEl>
<p:spTgt spid="8"/>
</p:tgtEl>
<p:attrNameLst>
<p:attrName>ppt_w</p:attrName>
</p:attrNameLst>
</p:cBhvr>
<p:tavLst>
<p:tav tm="0">
<p:val>
<p:strVal val="(6*min(max(#ppt_w*#ppt_h,.3),1)-7.4)/-.7*#ppt_w"/>
</p:val>
</p:tav>
<p:tav tm="100000">
<p:val>
<p:strVal val="#ppt_w"/>
</p:val>
</p:tav>
</p:tavLst>
</p:anim>
<p:anim calcmode="lin" valueType="num">...</p:anim>
<p:anim calcmode="lin" valueType="num">...</p:anim>
<p:anim calcmode="lin" valueType="num">...</p:anim>
</p:childTnLst>```

Assuming a rectangle is 0.25" by 0.25" (228600 by 228600 EMU), it's not clear what the digits/decimals represent. For example:

• Does 6 here mean 6 times the size of #ppt_w?
• In max(#ppt_w*#ppt_h,.3), there would never, ever be a case where .3 was more than #ppt_w*#ppt_h (which is 52,257,960,000 EMU) , so would #ppt_w, for example, be a percetange of it's own height on the slide canvas width in order to get it to a more reasonable number?
• Same for the other numbers of 1, -7.4, and -.7. Are they percentages of something? By using them at their face values, the formula doesn't calculate the correct width, height and y location of the pre-animation start value.

Later in the animation, to determine the start y location of the animation used, the formula is:

```1+(6*min(max(#ppt_w*#ppt_h,.3),1)-7.4)/-.7*#ppt_h/2"
```

. See 1 on front and 2 on end. I'm pretty convinced here that 1 means ppt_y, but it's unclear if 2 means 2*ppt_y or it just means two.

I'm looking for some assistance in interpreting what the numbers and digits in formulas are representative of.

In manually figuring part of this out, I can see that width/height of animation start values are about/exactly 8 times the size (so, in the case of the 0.25" by 0.25", the starting width and height values would be 2" by 2". I just have no way of getting to that number from the formula above.
• 편집됨 2011년 12월 27일 화요일 오전 12:20
• 편집됨 2011년 12월 27일 화요일 오전 1:12
•

### 모든 응답

• 2011년 12월 27일 화요일 오전 1:53
중재자

Hi Okatu,

Thanks for your question about PresentationML's p:anim values.  One of the Open Specifications team will respond shortly to assist you.

Best regards,
Tom Jebo
Escalation Engineer
Microsoft Open Specifications

• 2011년 12월 27일 화요일 오후 8:07
중재자

I'm looking into this for you Okatu.

Tom

• 2011년 12월 27일 화요일 오후 8:35

Thanks Tom. I've done a little more discovery on this. It appears that the digits and decimals are just that - real values. The culprit appears to lie in #ppt_w*#ppt_h.

What this means is that if that value of (shape width * shape height) is ever at or below 0.3, then the formula produces a value of 8 (i.e. eight times the width/height of the shape) - which appears to be the correct value.

The problem is that it will never produce a value of 0.3 or below (well, unless the size of the shape is extremely small - almost non-visible. Like just 5 EMU by 5 EMU). So when using it with max(#ppt_w*#ppt_h,.3), the max will always be #ppt_w*#ppt_h - resulting in wildy high values. As seen in the example above with a 0.25" by 0.25" (228600 by 228600 EMU) sample, the resulting value of #ppt_w*#ppt_h is 52,257,960,000 EMU.

Could it be an error in the formula, like maybe it is #ppt_w/#ppt_h (divided by) instead? Maybe not though, as that doesn't seem all that accurate either.

Also, something is still rotten in Denmark with the subsequent Y position <p:anim> of 1+(6*min(max(#ppt_w*#ppt_h,.3),1)-7.4)/-.7*#ppt_h/2". It doesn't appear to produce the correct starting Y position, which is just at the bottom of the page.

Any insight you could provide would be most helpful.

• 편집됨 2011년 12월 27일 화요일 오후 8:36
• 편집됨 2011년 12월 27일 화요일 오후 9:13 minor edits
•
• 2012년 1월 3일 화요일 오후 4:30

• 2012년 1월 3일 화요일 오후 5:13
중재자

Sorry, I've been distracted.  I will try to get you something soon.

Tom

• 2012년 1월 3일 화요일 오후 7:02
중재자

I was trying reproduce the scenario and using the same effect (Basic Zoom) I see this set of code:

```<p:cTn id="5" presetID="23" presetClass="entr" presetSubtype="16" fill="hold" grpId="0" nodeType="clickEffect">
<p:stCondLst>
<p:cond delay="0"/>
</p:stCondLst>
<p:childTnLst>
<p:set>
<p:cBhvr>
<p:cTn id="6" dur="1" fill="hold">
<p:stCondLst>
<p:cond delay="0"/>
</p:stCondLst>
</p:cTn>
<p:tgtEl>
<p:spTgt spid="4"/>
</p:tgtEl>
<p:attrNameLst>
<p:attrName>style.visibility</p:attrName>
</p:attrNameLst>
</p:cBhvr>
<p:to>
<p:strVal val="visible"/>
</p:to>
</p:set>
```

```<p:anim calcmode="lin" valueType="num">
<p:cBhvr>
<p:cTn id="7" dur="500" fill="hold"/>
<p:tgtEl>
<p:spTgt spid="4"/>
</p:tgtEl>
<p:attrNameLst>
<p:attrName>ppt_w</p:attrName>
</p:attrNameLst>
</p:cBhvr>
<p:tavLst>
<p:tav tm="0">
<p:val>
<p:fltVal val="0"/>
</p:val>
</p:tav>
<p:tav tm="100000">
<p:val>
<p:strVal val="#ppt_w"/>
</p:val>
</p:tav>
</p:tavLst>
</p:anim>
```

Notice the lack of formula.  I'm not sure why, could it be the object you inserted?

Tom

• 2012년 1월 3일 화요일 오후 7:19
중재자

Never mind, got the formula.  I hadn't set it to zoom from the bottom.  Sorry.  Stay tuned...

Tom

• 2012년 1월 3일 화요일 오후 7:21

Tom, as noted above, try presetSubtype="36", which is "Out from Screen Bottom" in the PowerPoint client. After you set "Basic Zoom", go to the "Effect Options" button in the Animations Ribbon (PowerPoint 2010). Click it and from the dropdown choose "Out from Screen Bottom". The one you have above is "In" (presetSubtype="16").

• 2012년 1월 3일 화요일 오후 7:25
중재자

Yes, I had all but the effect option.  I see it now.

Tom

• 2012년 1월 4일 수요일 오후 6:46
중재자

Hi Okatu,

Thanks for your patience.  The ppt_* variables contain values in a range of 0 to 1.  These represent an abstract [0,1] coordinate space that ranges from the top-left (i.e. 0, 0) to bottom right (i.e. 1, 1) of a slide.  Values less than zero and greater than 1 can be used (which will move content off slide). For ppt_w/ppt_h, these represent the width/height of the object being animated, again with the same units, so that you can use formulas like ppt_y = 1 + ppt_h/2, that causes a shape to start animating from the bottom of the slide.

ISO 29500-1, Section 19.5.79  "tav (Time Animate Value)" mentions the ppt_h, ppt_w, etc... variable names and their meanings but some additional clarification is needed in that section to explain their ranges.

Let me know if this is clear to you.

Best regards,
Tom Jebo
Escalation Engineer
Microsoft Open Specifications

• 2012년 1월 6일 금요일 오후 8:59

Much obliged Tom - this is a very helpful start. I'm going to need a few days to test out this out, and may have clarifying questions.

But for now, I'm looking at ppt_y = 1 + ppt_h/2 and am not following the logic. Do we assume that 1 equals the height of the slide? Or does it mean the Y position of the object as measured from the bottom of the slide? What does "2" mean? Double the height of the Y position? Double the height of the object? Or just the number 2?

So if I have a slide that is 1000 pixels high and a shape that is 100x100 in the 100y and 100x positions, how does ppt_y = 1 + ppt_h/2 make it start from the bottom of the slide? Sorry, I'm just not seeing the formulas make sense.

Correct me if I'm wrong here, but according to what I understood from above is that in my example, the ppt_h of my object would be 0.1 (i.e. its height percentage of the slide height). Is that right? So "1" would be 0.9 (i.e. 900 pixels, or the Y position of the object from the bottom of the slide). So if this was 1 (0.9) + (ppt_h (0.1) / 2 = 0.05), the starting Y position of the animation would be what? 950 px? Meaning that it starts 50px below the slide?

Again, thanks Tom for working with me on this.

• 2012년 1월 6일 금요일 오후 9:21
중재자

>>Correct me if I'm wrong here, but according to what I understood from above is that in my example, the ppt_h of my object >>would be 0.1 (i.e. its height percentage of the slide height). Is that right?

Yes

>>So "1" would be 0.9 (i.e. 900 pixels, or the Y position of the object from the bottom of the slide).

No, 1 + ppt_h/2 would be half the height past the bottom of the slide.  1 on the y axis is the same as saying the bottom of the slide, just as 1 on the x axis is the right side).  So adding half the height or .05 to 1 makes 1.05 which puts the object's bottom most edge .05 past the bottom of the slide.  This also means that .05 of the object is above the bottom line of the slide, remember the total height of the object is .1.  Make sense?

Which is actually as you found, 50px past the bottom of the slide.  I just explained it a little differently so you could see that half the object is on the slide and half is off the slide.

Tom

• 2012년 1월 7일 토요일 오전 1:36

Thanks Tom, this is all very helpful.

If 1 = the height of the slide, then why doesn't 1 + ppt_h/2 = 1050 in my example above? Meaning 1 = 1000 and ppt_h/2 = 50, so the two of them together should equal 1050 and that would be the Y position of the shape (i.e. the top left corner of the shape) at the start of the animation. In other words, the start of the animation Y position is 50px *below* the slide.

I guess I'm not understanding how it could be possible to get to 950 unless it was 1 - ppt_h/2 based on the formula. (Thoughts: Is the formula actually 1 + ppt_h/2 - ppt_h, with the last part of -ppt_h being assumed?)

This appears to have something to do with the height of the object *after* placement, but I'm not seeing it. If we used 1 + ppt_h/3, what would the answer be? (Based on my thought above, would the answer be that the Y position is 933.33, meaning that 2/3rd of the shape is above the bottom of the slide and 1/3rd is below the bottom of the slide?)

Much obliged for your patience Tom as we work through this.

• 편집됨 2012년 1월 7일 토요일 오전 1:39
•
• 2012년 1월 14일 토요일 오후 6:24

Hi Tom,

• 2012년 1월 15일 일요일 오후 7:56
중재자

Hi Okatu,

thanks for your patience, I'm still looking into this and hope to have something by tomorrow.

Tom

• 2012년 1월 16일 월요일 오후 4:48
중재자

I'm verifying with the PowerPoint team that we place the object based on the object rectangle's bottom/right corner.  This would be the only way the formula would make sense.  You are right that the formula produces 1050.  However, I believe this is placing the object off the slide at the bottom.  My only point of clarification is whether it uses the bottom/right or top/left of the object's rectangle to place it initially.

Tom

• 2012년 1월 16일 월요일 오후 10:00
중재자

And actually, that is correct except that PowerPoint draws the object starting at it's midpoint (in this case vertically).  So, (1 + #ppt_h/2) will result in 1050 in your scenario which means that PowerPoint will initially draw the object completely beyond the bottom of the slide (just beyond it).

One thing that will help you to see this is if you set the duration to a really long value like 50.00.  The object will take a long time to animate and you can see where it starts.

The same is true for the width (#ppt_w) animations.  PowerPoint starts drawing the object at the horizontal midpoint.

Tom

• 2012년 1월 17일 화요일 오후 8:07

Thanks Tom. Let me see if I got this right. My calc of 1050 is correct, it's not the Y of the shape that is placed at 1050, it's the mid-point. So in my example, the Y would simply be 1000 (i.e. the very bottom of the slide) because the height of the object is 50. In other words,

• 1000 + 50 = 1050 = calculation.
• Height of object / 2 (mid point) = 50.
• Y location = 1050 - 50 = 1000.

Is that correct?

Now using my example of 1 + ppt_h/3, that would mean:

• 1000 + 33.3 = 1033.3 = calculation
• Height of object / 2 (mid point) = 50.
• Y location = 1033.3 - 50 = 983.3.

I've tested the first one above using 50 seconds and it take roughly 5 seconds for my shape to come into view at the very bottom of the slide (when the shape has text in it) and 0 seconds to when there is no text in it. That by itself is weird on the different start times.

However, I tested the second one as well - simply remove (presetID="23" presetClass="entr" presetSubtype="36") from the animation at the top and then change change #ppt_h/2 to #ppt_h/3.

The result is very different from the method you described. The start Y is 867.3. In other words, it is (ppt_y [1000] - #ppt_h/3 [33.3] - object height [100]).

Sorry this is taking so long, I still don't feel we have the implementation details here described. Maybe the PowerPoint team has the details?

• 2012년 1월 18일 수요일 오후 8:13
중재자

Why did you remove the presetId, class and subtype?  These identify the type of animation.  I think they are also affecting the behaviour you see when you change the values in the forumlas.   I did my testing using the same id, class and subtype (I used a fly-in entrance animation).

Tom

• 2012년 1월 18일 수요일 오후 8:39

if you have presetID, class and subtype in powerpoint, the client software uses those to run the animation. it *only* reads some of the child elements/attributes below it like duration to run the animation, but otherwise uses the "template" provided by presetID, class and subtype.

if you remove those three, powerpoint will read all of the xml values and then create a "custom" animation based on the defined animation in the xml.

in fact, if you remove those 3 and change nothing else, powerpoint will run the built-in animation exactly, except it is now "custom" in the ribbon instead of a predefined name. it looks at the xml and builds the exact animation.

• 2012년 1월 19일 목요일 오후 6:05
중재자

>>However, I tested the second one as well - simply remove (presetID="23" presetClass="entr" presetSubtype="36") from the animation at the top and then change change #ppt_h/2 to #ppt_h/3.

I did this test (with one of the PowerPoint team developers) and we got exactly what we expected.  Using (1 + #ppt_h/3) places the object off the bottom of the slide except with 1/6th of the object showing initially.  If 1 represents the bottom of the slide (100% of the Y extent of the slide) and PowerPoint always draws the object starting at it's vertical midpoint, then with only 1 in the formula, the object would appear initially as half on and half off the slide.  Correct?  So if you add 1/3 of the object's height to that formula, you push that visible half down by 1/3 the object's height.   That's 1/2 + 1/3 = 5/6, leaving 1/6th of the object initially viewable.  If your object is 100 in height, then you should see 16.6 of it above the bottom line of the slide.  That's what we are seeing in our testing.

I don't know why you're seeing that.  Send your file, as is, to dochelp at microsoft dot com.  Just reference my name and the URL for this thread.  I'll take a look and verify your observations.

Tom

• 2012년 1월 23일 월요일 오전 6:53

Thanks Tom. The extra insight is invaluable and I'll be using that to test. I'll be traveling this week, so my ability to test will be limited. I'll get back to you early next week.
• 2012년 1월 23일 월요일 오후 3:03
중재자

Ok, thanks.

Tom