Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
[INFORMATION](4/11/2024)
Cubism Editor 5.1 alpha2 is now available!

We have incorporated some of your comments and suggestions. Thank you for your comments and requests!
We will continue to welcome your feedback on alpha2.

Download/ Manual and Update History
Options

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.