zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
114 stars 22 forks source link

Change "Loop" wording to Wrap (animation) #125

Open m-7761 opened 4 years ago

m-7761 commented 4 years ago

I think interpSkelAnimFrameTime needs to tree the first and last time as a synthetic "identity" frame if there aren't real frames on the ends.

Right now it sources the loop frames from inter-frames. Short of adding a lot of end-condition options I think the default semantics on the front should be the base model. On the back if looping then it's the same as the first frame... which (in this proposal) is the base model's.

P.S. I haven't been working on MM3D code in the past two or three weeks. I got myself caught up in something else.

Off-topic: The rotation interpolation isn't slerp's. I thought it would look uneven but I can't see an obvious problem. Still it makes me nervous since the library is used to sample animation data and not just display it.

m-7761 commented 4 years ago

I think I see the logic in this now. What threw me for a loop (pun intended) is that checking this "loop" box changes the animations appearance... i.e. it's not just cycling the animation. What's implemented is a wrap-around like texture clamping versus wrapping.

I think it would be useful to make looping a playback preference probably not worth saving in the MM3D format. For the record, I understood before that looping would glue the last frame to the first, logically, but wrapping glues the last keyframe to the first keyframe, which means the start of the animation differs as well, and meaning that the animation will unlikely playback correctly if the wrong setting is chosen.

m-7761 commented 4 years ago

MM3D 2-buttons 4-states

I made a Loop button for the media bar that's independent of the "wrap" state. I've changed get/setAnimLooping to get/setAnimWrap and changed the checkboxes accordingly. ("setAnimWrap" makes sense with an enum or bitwise input too should the menu of end conditions ever require expanding.)

There are just 2 buttons in this image (two screenshots stacked.) The ones on the left are a play/pause and the right is stop/loop, but clicking the right button only stops playback in the sense that if it's changed from the looping state to the stopping state the animation will stop when it gets to its end.

Pausing doesn't actually pause, but just uses the more standard representation of a combination play/stop button. I would like to add more buttons to the media-bar but it's not a big priority and I'm happy with this development since I already had the play/pause button and the stop button didn't make any sense to keep other than to fill space!