ynput / ayon-blender

Blender addon for AYON
Apache License 2.0
6 stars 2 forks source link

Blender: Expose frame range and unit conversion attributes on publish instances #1

Open iLLiCiTiT opened 2 months ago

iLLiCiTiT commented 2 months ago

Changelog Description

Improved creators and publish instances to allow per instance frame ranges to be configured instead of using folder-level attributes.

Additional info

Note: A caveat of this is that now the frame ranges of instances aren't 1:1 tied to the scene's frame range but to what is configured on the publish instance in the publisher UI.

Transferred PR from https://github.com/ynput/ayon-core/pull/658

Testing notes:

The creators and the extractors that have been updated should be tested to check if they're using the information set in the creator.

  1. FBX extractors should now have a Unit Scale attribute that works in a sensible manner:

    • [x] These should provide backward compatible results (existing instances should generate the same scale exports when now published with this PR as before without this PR
    • [x] Model publish works, with FBX unit scale providing different scaling
    • [x] Animation publish works, with FBX unit scale providing different scaling
  2. All Extractors should now adhere to a frame range configured on the instance instead of exporting all.

    • [x] FBX export should not have animation data outside of the frame range.
    • [x] Animation export should not have animation data outside of the frame range.
    • [x] Review export should match the configured frame range on the instance.
BigRoy commented 1 month ago

The PR title does not match at all what the code changes do - Something is wrong? :)

moonyuet commented 1 month ago

This is my unit scale setting for blender in AYON(for matching the default unit scale in maya) image image Publish successfully image

The animation loaded correctly, but the loaded fbx seems to be a bit off( I guess it is related to the scene_length you mentioned above) image

LiborBatek commented 1 month ago

@moonyuet speaking of animation and offset be aware of the Fps as it has huge impact on timeline aka loading animations for e.g. 25fps vs 24fps , just sayin...doesnt mean thats the issue atm

moonyuet commented 1 month ago

@moonyuet speaking of animation and offset be aware of the Fps as it has huge impact on timeline aka loading animations for e.g. 25fps vs 24fps , just sayin...doesnt mean thats the issue atm

If this is dangerous, guess we should also need to remove the fps option in the scene overrides so that users won't publish assets with weird fps type.

BigRoy commented 2 weeks ago

Unassigning myself since I may not be the best to continue this without clear pointers on what is "good" Blender behavior.

Tagging @LiborBatek @moonyuet for visibility - anyone who may be a better fit? Or should I just include Kayla's notes - do a simple test run and then assume I haven't broken other critical blender parts?

iLLiCiTiT commented 2 weeks ago

Can someone take care of this PR? @BigRoy @moonyuet ?

LiborBatek commented 2 weeks ago

@moonyuet maybe outside of scope of this PR but as we will introduce frame range on each publish instance...I would like to point out that we completely lack Validate Frame range on the Context widget as in e.g. Maya host. Shouldnt we introduce it for blender too?!

Edit: we lack it also on each publish instance, which should be very useful feature to have...again not sure what that means in terms of dev time/refactoring

moonyuet commented 2 weeks ago

@moonyuet maybe outside of scope of this PR but as we will introduce frame range on each publish instance...I would like to point out that we completely lack Validate Frame range on the Context widget as in e.g. Maya host. Shouldnt we introduce it for blender too?!

yes we should include these families to the validate frame range, but with different PR

iLLiCiTiT commented 5 days ago

Is this ready for review?

moonyuet commented 5 days ago

Is this ready for review?

Is this ready for review?

yes, @LiborBatek and @BigRoy can you review?

LiborBatek commented 5 days ago

I can see the frame range settings for each publish instance which is good but the UI lacks Unit Scale settings...am I correct when expecting it to be shown in the publisher UI?!

Screenshot 2024-09-11 144411 Screenshot 2024-09-11 144522

been tested on these publish instances:

animation model pointcache camera review