Physics Based Animation Effects Week#10

This week, I was mainly working on cleaning up and migrating the patches from my experimental branch to LO master.

merged patches were:

there was also two minor patches that were merged [1] [2]

patches that are still in review are:

Here’s the file for last weeks demo but updated for this week (Simulated/Simulation was renamed to Physics across the whole implementation last week so it needed an update):

Here’s how the animation effect is expressed in the content.xml of the demo file:

<!-- excerpt from customshapesfalling.odp:content.xml -->
<anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click" presentation:preset-class="emphasis" presentation:preset-id="libo-physics-basic">
		  <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id1"/>
</anim:par>

If you’d like to play around with animation effects and create new ones that combine physics based and existing ones. First you should pull the current implementation from my experimental branch. After that, you should create a dummy animation containing odp file and manually edit it’s content.xml creating an altered animation effect. Finally to see it in action use File -> Reload option.

Here is a file that has two example animations that I’ve created this way which combines physics animations with others:

Below I’ve tried to explain what’s going on in the smil hierarchies of two-example-animations-with-physics.odp:content.xml

<!-- excerpt from two-example-animations-with-physics.odp:content.xml that is padded with comments & prettified -->
	<anim:par presentation:node-type="timing-root">
	  <anim:seq presentation:node-type="main-sequence">
<!-- start of the first animation effect -->
	    <anim:par smil:begin="next">
	      <anim:par smil:begin="0s">
		<anim:par smil:begin="0s" smil:fill="hold" presentation:preset-property="Direction" presentation:node-type="on-click" presentation:preset-class="emphasis" presentation:preset-id="experimental-drop-and-wipe-out" presentation:preset-sub-type="horizontal">
<!-- animatePhysics: is the node for physics based animation effects.
     there's no smil:begin so it'll start with the parent node without a delay -->
		  <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id1"/>
<!-- blindsWipe that is delayed for 3.5s since smil:begin="3.5s" -->
		  <anim:transitionFilter smil:begin="3.5s" smil:dur="0.5s" smil:targetElement="id1" smil:type="blindsWipe" smil:subtype="horizontal" smil:mode="out"/>
<!-- making the shape disappear proper way at the end -->
		  <anim:set smil:begin="4s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id1" smil:attributeName="visibility" smil:to="hidden"/>
		</anim:par>
	      </anim:par>
	    </anim:par>
<!-- start of the second animation effect -->
	    <anim:par smil:begin="next">
	      <anim:par smil:begin="0s">
		<anim:par smil:begin="0s" smil:fill="hold" presentation:preset-property="Direction;Accelerate;Decelerate" presentation:node-type="on-click" presentation:preset-class="entrance" presentation:preset-id="experimental-fly-in-and-drop" presentation:preset-sub-type="from-bottom">
<!-- fly in animation effect -->
		  <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="visibility" smil:to="visible"/>
		  <anim:animate smil:dur="0.5s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="x" smil:values="x;x" smil:keyTimes="0;1"/>
		  <anim:animate smil:dur="0.5s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="y" smil:values="1+height/2;y" smil:keyTimes="0;1"/>
<!-- animatePhysics that starts at the end of fly in since smil:begin="0.5s" -->
		  <loext:animatePhysics smil:begin="0.5s" smil:dur="4s" smil:fill="hold" smil:targetElement="id2"/>
		</anim:par>
	      </anim:par>
	    </anim:par>
	  </anim:seq>
	</anim:par>