extension-spine icon indicating copy to clipboard operation
extension-spine copied to clipboard

Hide default animation error on model creation

Open SalavatR opened this issue 2 years ago • 9 comments

SalavatR avatar Dec 07 '22 10:12 SalavatR

@SalavatR Thank you for the contribution. Is this PR connected to an open issue? If not, could you please provide a description of the PR and what it solves (more than what it says in the title)

britzl avatar Dec 08 '22 12:12 britzl

@SalavatR Thank you for the contribution. Is this PR connected to an open issue? If not, could you please provide a description of the PR and what it solves (more than what it says in the title)

We have many spine models and run animations from code, extension spams to log ERROR:SPINEEXT: No animation '' found, on scene loading, i think it's not useful

SalavatR avatar Dec 15 '22 07:12 SalavatR

We have many spine models and run animations from code, extension spams to log ERROR:SPINEEXT: No animation '' found, on scene loading, i think it's not useful

And this is because no animation was assigned to the spine scene in the editor?

britzl avatar Dec 15 '22 09:12 britzl

We have many spine models and run animations from code, extension spams to log ERROR:SPINEEXT: No animation '' found, on scene loading, i think it's not useful

And this is because no animation was assigned to the spine scene in the editor?

Yes)

SalavatR avatar Dec 15 '22 09:12 SalavatR

Hmm, ok, yeah, I mean if no animation has been set then I think it maybe makes sense to not try to play any animation and also not log a warning.

britzl avatar Dec 15 '22 09:12 britzl

Hmm, ok, yeah, I mean if no animation has been set then I think it maybe makes sense to not try to play any animation and also not log a warning.

like this? https://github.com/defold/extension-spine/blob/main/defold-spine/src/comp_spine_model.cpp#L588

if(animation_id != dmHashString64(""))
{
     PlayAnimation(component, animation_id, dmGameObject::PLAYBACK_LOOP_FORWARD, 0.0f, 0.0f, 1.0f, 0); // TODO: Is the default playmode specified anywhere?
}

SalavatR avatar Dec 15 '22 13:12 SalavatR

https://github.com/defold/extension-spine/issues/104#issue-1389256094 here is issue :)

SalavatR avatar Dec 16 '22 07:12 SalavatR

like this?

Well, I mean, now that I think of it there really should be no error/warning logged if the spine scene is created and the animation is empty. But I think using an empty hash later on should log a warning as that is likely indicative of an error.

I'd like to get some input from @JCash and/or @AGulev before we proceed.

britzl avatar Dec 18 '22 14:12 britzl

I do agree to removing the warning when starting the game (the build process should warn about it). For the ingame setting of an empty string, I think it's still an error (what is the actual use case?)

JCash avatar Dec 19 '22 07:12 JCash