Dear Users,

Now, we are seeking users who can give us a hand with expertise to evolve our software more dynamically.
If you are willing to help us, we’d like you to make a registration for “Live2D Creators Circle” via the link below.
Designers, programmers, translators are especially welcomed so far.
(More detailed explanation will be given to you before we ask you to do tasks)

https://docs.google.com/forms/d/1G5KK_GL3ozwPXtTHrpi_ktbsI8UZf8jlYRSlDworyBo/viewform?usp=send_form

csmVertexPositionsDidChange never resets Cubism3.0 Native

Hello,
I'm new to Live2d/Cubism programming and have a question regarding the Cubism 3.0 Core Native Development.

I integrated cubism to my project and implemented the rendering of moc3 files. Everything works fine but I got stuck at some point during the implementation of the animation system. I added the possibility to update the vertices if csmGetDrawableDynamicFlags has the flag csmVertexPositionsDidChange set. Unfortunately it is set each update frame. If I check the vertex data during debugging, everything looks unchanged (no animation is set yet). My character (and the vertex data) looks the same each frame but the dynamicFlag never gets a reset. I looked into the example from github and it is implemented like that:
// Update model.
csmUpdateModel(Sample.Model);
// Update renderer.
csmUpdateGlRenderer(Sample.Renderer);
// Reset dynamic drawable flags.
smResetDrawableDynamicFlags(Sample.Model);
// Draw.
csmGlDraw(Sample.Renderer, GetViewProjectionMatrix(), &Sample.Texture);
I implemented it the same way.
1. Call csmUpdateModel()
2. Update vertices if csmVertexPositionsDidChange is set (and more)
3. Call csmResetDrawableDynamicFlags for model
4. Render

If i do not call csmResetDrawableDynamicFlags alls flags for each drawable is 63 and it never changes (of course, because I do not call ResetDrawableDynamicFlag). If I call csmResetDrawableDynamicFlags after each update and before rendering the flags are always 33 and that tells me that the VertexPostionChanged flag is set all the time, even if I have no animations yet and the vertex data is the same. It is not a super critical problem because everything renders fine. But it is very slow because everything wants to update its vertex data each frame.

Did I miss something or am I doing it wrong?
Thank You.

Kind Regards
Nisi

Comments

Sign In or Register to comment.