I have a looping animation which I apply to a suitable model using Enhanced Animations. In this looping animation, the last frame is a duplicate of the first frame. This ensures the animation loops smoothly. But I want to cut out the last frame of the loop (to reduce file size) and use a transition to get from frame "-1" back to frame "1" instead.
The code below runs the looping animation with its final frame cut
just once without looping and checks to see if it has ended; if so, the looping animation is then applied as a transition from itself.
So far so good. The animation loops nice and smooth.
When the transition is complete, the transition animation should become the "playing animation" as explained in the EA help files. So the program continues checking to see if the looping animation has ended (just as before) - only this time, the call to apply a transition animation fails and does nothing.
So it appears I cannot "transition" from a transition animation.
Am I doing something wrong here? Or has this always been an EA limitation? I've never really thought about it until now.
`Load test object:
load object "testobject.x", 1
`Load test looping anim:
testanim = enan_animload("anims\testanim.anim")
`Set play speed:
enan_setdefaultplayspeed 1.0
`Create OAC:
testobject = enan_oaccreate(1)
`Set OAC link:
global testlimb as integer = 2
global testtransspeed as integer = 50
enan_oacplayanim testobject,testlimb,testanim,1,1,-1,0,0
`Setup camera:
position camera 0, object size(1), -object size(1)*2
`Program loop:
do
`Update timer:
elapsedTime = timer()-time
time = timer()
`Initiate animations and checks: <<<<<<<<<<<<<<<<<<<[THE MEAT AND POTATOES BIT]
if spacekey()
if enan_oacgetlimbisactive(testobject,testlimb) = 0
enan_oacanimtransition testobject, testlimb, testanim, 1, 1, -1, testtransspeed, 0, 0
center text screen width()/2, 30, "---anim has stopped---"
endif
`Update animations:
enan_oacupdate testobject,elapsedTime
endif
`Console:
center text screen width()/2, 10, "Current Frame: "+str$(enan_oacgetcurrentframe(testobject,testlimb))
sync
loop
EDIT: Oh. Could this be a u77 thing? Ouch.
Object
------
Now clip the end of an OBJECT animation
Fixed bug causing ray cast material artitary value to reset too late (inside loop)
Added parameter to SET OBJECT EFFECT called Force CPU Animation - ideal for bone detection
EDIT2: Apparently not! Thank goodness for that. Unfortunately the original issue still stands.