Aodaruma / coa_tools2

a Blender addon for cutout animation
GNU General Public License v3.0
35 stars 6 forks source link

Sprite's keyframes deletion by some actions in addon's UI #34

Open EvgeneKuklin opened 1 year ago

EvgeneKuklin commented 1 year ago

Describe the bug Some actions in the addon's UI deletes animation keyframes of sprite objects

Video YouTube video

To Reproduce Steps to reproduce the behavior:

  1. Open clean scene
  2. Open the addon's "N" menu
  3. Click "Create new sprite object"
  4. Click "Re / Import sprites" and import some sprites
  5. In the addon's block "Cutout Animations" click plus button and add new animation collection
  6. In the addon's block "Object properties" click on any imported spite (.png usually)
  7. Press I on keyboard to insert a keyframe and choose location, for example
  8. In the addon's block "Cutout Animations" click on "Restpose" or "NO ACTION" and the on the ani,ation collection (NewCollection by default)
  9. Now we lost all sprite's keyframes

Expected behavior I expect that sprite's keyframes will be on their places

Desktop (please complete the following information):

Additional context I think the bug is critical: not only it's not allowing to use direct animation of sprites but also could delete person's hard work without notice Also I cant finish Json export logic without working sprite animations

Aodaruma commented 1 year ago

confirmed, it seems to be related to animation_handly.py. I found COATOOLS2_OT_AddKeyframe at L46-L207 in animation_handly.py and it looks to be used in Object Property of coa_tools2.

using "add keyframe" button, it stored correctly in the animation collection no matter I change anim_collection_index. image

therefore it is likely in the specifications of coa_tools, but i think it is not user-friendly feature for being lost all keyframes due not to pushing the button when we edit animation collections

EvgeneKuklin commented 1 year ago

I think there might be a related problem: Animation lenght is also resets to default 250 frames in similar scenarios except when we set it in coa's ui

Aodaruma commented 1 year ago

yeah. Not only this problem, but we have seen some problems with this addon where data edited without going through operators functionality is not saved.

Anyway, possible solution to this issue is:

  1. Automatically register keyframes for objects and bones below the sprite object when animation collections are selected
  2. When creating the first animation collections, keyframes below the sprite object should be registered in the first animation collections, and the animation length should be applied to the originally registered end frame (this may be rather deprecated; it would be more appropriate to indicate a modal which shows "all keyframes and animation data will be lost")