Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maya: fps rounding - OP-2549 #4424

Merged

Conversation

tokejepsen
Copy link
Member

@tokejepsen tokejepsen commented Feb 2, 2023

Brief description

When FPS is registered in for example Ftrack and round either down or up (floor/ceil), comparing to Maya FPS can fail. Example:

23.97 (Ftrack/Mongo) != 23.976023976023978 (Maya)

Description

Since Maya only has a select number of supported framerates, I've taken the approach of converting any fps to supported framerates in Maya. We validate the input fps to make sure they are supported in Maya in two ways:

Whole Numbers - are validated straight against the supported framerates in Maya.
Demical Numbers - we find the closest supported framerate in Maya. If the difference to the closest supported framerate, is more than 0.5 we'll throw an error.

If Maya ever supports arbitrary framerates, then we might have a problem but I'm not holding my breath...

Testing notes:

  1. Setup shot in Ftrack with fps 23.976023976023978, which will be rounded to 23.97.
  2. Launch Maya.
  3. Create Animation instance.
  4. Publish.

There are other testing notes on #4076

@tokejepsen tokejepsen added the type: bug Something isn't working label Feb 2, 2023
@tokejepsen tokejepsen self-assigned this Feb 2, 2023
@ynbot
Copy link
Contributor

ynbot commented Feb 2, 2023

@m-u-r-p-h-y m-u-r-p-h-y self-requested a review February 9, 2023 07:45
Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a project with fps set to 29.98

shot has fps set to 23.9760246277 (number coming from Hiero editorial publish)

a scene in Maya set to 25fps

during save, the popup informs about the wrong fps, but the numbers are not matching

image

after pressing fix, everything seems ok, saving works, no complaints anymore

but when you use OpenPype -> Reset frame range, the scene is set to 25fps with no error in the script editor

@tokejepsen
Copy link
Member Author

@m-u-r-p-h-y should be fixed now.

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work for me - the only question is the allowed error. I've tested it with frame rate 23.5 that doesn't make sense but since the difference is just 0.4760... and rounded 0 it is still accepted as 23.976023976023978. And maybe it's good thing? But I feel that the tolerance should be less, maybe in order of 0.1

@tokejepsen
Copy link
Member Author

It does work for me - the only question is the allowed error. I've tested it with frame rate 23.5 that doesn't make sense but since the difference is just 0.4760... and rounded 0 it is still accepted as 23.976023976023978. And maybe it's good thing? But I feel that the tolerance should be less, maybe in order of 0.1

Sure, I dont mind having a lower tolerance. We can maybe loosen it later if productions have issues with it. No point in having it a setting, right?

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following testing steps and setting custom framerate in ftrack/mongoDB to 23.976023976023978

OP correctly sets the framerate according to DB
image

Did run the full test with creating / publishing /loading assets and all works as expected. When changing the shot to other framerate than in DB OP correctly fixes it back when re-opened.

@tokejepsen tokejepsen removed the request for review from BigRoy February 16, 2023 16:28
@antirotor antirotor merged commit 5a78cb0 into ynput:develop Feb 16, 2023
@ynbot ynbot added this to the next-patch milestone Feb 16, 2023
@tokejepsen tokejepsen deleted the bugfix/OP-2549_fps-rounding-in-maya branch February 17, 2023 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants