SEA 1.8.1 issues

Messages
20th November 2016 - 09:51:42 AM
Hi,

There is a big probelm with the latest Sea "player":
it's not backwards compatible!
1) Deflate is not included into sea.js and sea.min.js
2) in case of multiple animations you changed the format from Array to JSON.
This is not a good idea because now all the projects with model.animations[n] do not work anymore.

cheers
20th November 2016 - 10:20:09 AM
I've added Deflate to the main package, but the backwards compatibility is still broken.
1.8.0: http://necromanthus.com/Test/html5/dog.html
dog.animations[0].timeScale = 0.8;
dog.animations[1].timeScale = 0.8;
dog.animations[2].timeScale = 0.8;
1.8.1: http://necromanthus.com/Test/html5/dog_181.html
dog.animations.stand.timeScale = 0.8;
dog.animations.walk.timeScale = 0.8;
dog.animations.jump.timeScale = 0.8;

So I had to replace the Array approach with the JSON one to make it work.
But this is not a good idea at least for 2 reasons:
1) Array access is faster than JSON
2) you want to work with Array if you have dozens of animations per character.

Please roll back to Arrays !!!
20th November 2016 - 11:54:52 PM
Hi Remus,

This has been replaced by `dog.animationsIndex[0]` to avoid duplicates values in Array if use `foreach` or a 'numeric name'. @Lth what do you think?
21st November 2016 - 07:35:14 AM
`dog.animationsIndex[0]` also breaks the backwards compatibility, so it's not a good idea either.

If you want to keep them both (Array and JSON), here is probably the best solution.
1) keep the Array untouched:
dog.animations[0].timeScale = 0.8;
dog.animations[1].timeScale = 0.8;
dog.animations[2].timeScale = 0.8;
2) for JSON use this syntax:
dog.animation.stand.timeScale = 0.8;
dog.animation.walk.timeScale = 0.8;
dog.animation.jump.timeScale = 0.8;

cheers
22nd November 2016 - 05:57:25 AM
maybe dog.setTimescaleAnimation( 0 or 'walk', 0.8 );
22nd November 2016 - 06:18:00 AM
i include delate in compile
to change animation timescale is dog.setAnimTimeScale( 0 or 'walk', 0.8 );
and you can set global timescale by dog.setTimescale( 0.8 );
22nd November 2016 - 07:35:15 AM
> to change animation timescale is dog.setAnimTimeScale( 0 or 'walk', 0.8 );

dog.animations[N] is not available anymore, so the backwards compatibility is broken.
22nd November 2016 - 07:39:02 AM
Also, in 1.8.1 an old bug is back:
when you change the current animation, all the previous timeScale values are set to 1.0
22nd November 2016 - 11:19:14 AM
yes however this.currentAnimationAction.getEffectiveTimeScale() give the good value ?
same problem on dog.setTimeScale ...
22nd November 2016 - 11:37:04 AM
i see is the line
if ( this.previousAnimation ) this.previousAnimationAction.crossFadeTo( this.currentAnimationAction, crossfade || 0, true );
if warp set to false timescale work if not timescale reset to 1 ?
22nd November 2016 - 12:27:46 PM
See the previous "dog" 1.8.0 and 1.8.1 examples.
In 1.8.0 everyhting runs ok.
In 1.8.1 the first animation runs at the proper speed (0.8)
But after you click on the stage (and change the animation), all the animations will play at timeScale = 1.0
And this is wrong !

p.s.
Please roll back to "animations[N].timeScale".
Logically speaking, that's the best approach.
22nd November 2016 - 12:35:49 PM
The correct syntax is the following:

1) for a single animation:
model.animation.property
or
model.animations[0].property

2) for multiple animations:
model.animations[0].property
model.animations[1].property
...
model.animations[N].property

So please roll back to
model.animations[0].timeScale
22nd November 2016 - 02:34:44 PM
ok :/
i push new version with only animations array
dog.animations[2].timeScale = 0.8;

i remove warp, is version of three maybe
22nd November 2016 - 02:44:41 PM
> i push new version with only animations array

Well done!
It's backwards compatible and I get the same speed in booth versions:
1.8.0: http://necromanthus.com/Test/html5/dog.html
1.8.1: http://necromanthus.com/Test/html5/dog_181.html
cheers
22nd November 2016 - 05:56:50 PM
I do not like the approach `dog.animations` only for array, for me this should be the names or both. Even to backward compatibility some users use `dog.animations[name]` otherside of `dog.animations[index]`
22nd November 2016 - 06:09:09 PM
`Array` is similar to `Object` only with a extra property `length` and some internal routines instead of the `Vector` which allocates space in memory if you define a specific size... What do you man use `.animationNames` as a `function get` and `animations` to both?

Help