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: Ability to set resolution for playblasts from asset, and override through review instance. #3360

Conversation

ghost
Copy link

@ghost ghost commented Jun 17, 2022

This adds the functionality to add override attributes on review instances to generate Maya playblasts with custom resolutions, overriding asset settings resolutions.

To test this:

  1. Create OpenPype Model instance.
  2. Create camera and append under locator, animate locator to rotate around model.
  3. Select camera and create OpenPype Review instance.
  4. Publish.

If the resolution is set a value other than 0 on the Review instance custom attribute, the playblast generated and submitted to FTrack is going to have those values as its resolution. Otherwise, when it is set to 0, it will fallback and generate the playblast as per the asset's settings.

@ghost
Copy link
Author

ghost commented Jun 17, 2022

@ghost ghost marked this pull request as draft June 17, 2022 05:10
@ghost ghost changed the title OP-3088_Ability-to-sync-asset-resolution-playblast-and-review-resolution OP-3088: Ability to sync asset resolution for playblasts from project settings. Jun 17, 2022
@ghost ghost added type: enhancement Enhancements to existing functionality host: Maya labels Jun 17, 2022
@ghost ghost self-assigned this Jun 17, 2022
@ghost ghost requested review from antirotor and mkolar June 17, 2022 10:38
Allan I. A and others added 4 commits June 17, 2022 15:04
@ghost ghost marked this pull request as ready for review June 17, 2022 20:57
@mkolar mkolar requested review from m-u-r-p-h-y and removed request for mkolar June 20, 2022 07:46
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.

fails with error

image

also would like to ask about the logic.

it should check and set the resolution from the asset, not project settings

image

@ghost
Copy link
Author

ghost commented Jun 20, 2022

fails with error fails with error

image

also would like to ask about the logic.

it should check and set the resolution from the asset, not project settings

image

Ah, I'd misunderstood. Working on that now

@ghost ghost changed the title OP-3088: Ability to sync asset resolution for playblasts from project settings. OP-3088: Ability to set resolution for playblasts from asset, and override through review instance. Jun 20, 2022
@ghost ghost requested a review from m-u-r-p-h-y June 20, 2022 11:49
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.

still the same error

// pyblish.ExtractReview : Overscan color: #000000 //
// pyblish.ExtractReview : pixel_aspect: 1 //
// pyblish.ExtractReview : input_width: 1920 //
// pyblish.ExtractReview : input_height: 1080 //
// pyblish.ExtractReview : Output resolution is 0x0 //
// Error: pyblish.plugin : Traceback (most recent call last):
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 332, in _render_output_definitions
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 612, in _ffmpeg_arguments
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 1325, in rescaling_filters
ZeroDivisionError: float division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\REPO\OpenPype.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 79, in process
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 247, in main_process
File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 346, in _render_output_definitions
NotImplementedError
Traceback (most recent call last):
File "", line 332, in _render_output_definitions
File "", line 612, in _ffmpeg_arguments
File "", line 1325, in rescaling_filters
ZeroDivisionError: float division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\REPO\OpenPype.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
runner(*args)
File "", line 79, in process
File "", line 247, in main_process
File "", line 346, in _render_output_definitions
NotImplementedError //

@ghost
Copy link
Author

ghost commented Jun 20, 2022

This is happening because right now we're appending a resolution value through the review instance. I'll ping Ondrej and ask what he thinks

@ghost ghost marked this pull request as draft June 20, 2022 12:15
@antirotor
Copy link
Member

antirotor commented Jun 20, 2022

Just adding here from internal communication:

I believe these (resolution attributes on created instance) should be set to asset resolution by default. Zero is used down the process to indicate that resolution should be used from the asset. So it should be like:

  1. creator gets resolution from the asset
  2. if zero is set here - project_settings/maya/publish/ExtractPlayblast/capture_preset/Resolution/width (and height) then nothing happens and asset resolution is propagated down the line, but if there is non-zero value, it should be used instead.

So creator has ability to override resolution but the default should be set from the asset. And if Extract Playblast has non-zero value, that should be used instead

@ghost ghost force-pushed the OP-3088_Ability-to-sync-asset-resolution-playblast-and-review-resolution branch from fb08627 to 594707f Compare June 21, 2022 11:02
@ghost ghost requested a review from iLLiCiTiT June 24, 2022 11:42
@ghost ghost marked this pull request as ready for review June 27, 2022 08:43
@mkolar mkolar requested a review from m-u-r-p-h-y June 27, 2022 12:36
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.

/ Error: pyblish.plugin : Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\extract_thumbnail.py", line 98, in process
  File "D:\REPO\OpenPype\openpype\vendor\python\common\capture.py", line 207, in capture
    _applied_viewport_options(viewport_options, panel)
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\contextlib.py", line 427, in enter_context
    result = _cm_type.__enter__(cm)
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "D:\REPO\OpenPype\openpype\vendor\python\common\capture.py", line 731, in _applied_viewport_options
    cmds.modelEditor(panel, edit=True, **options)
TypeError: Invalid flag 'lineAAEnable'
Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "<string>", line 98, in process
  File "D:\REPO\OpenPype\openpype\vendor\python\common\capture.py", line 207, in capture
    _applied_viewport_options(viewport_options, panel)
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\contextlib.py", line 427, in enter_context
    result = _cm_type.__enter__(cm)
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "D:\REPO\OpenPype\openpype\vendor\python\common\capture.py", line 731, in _applied_viewport_options
    cmds.modelEditor(panel, edit=True, **options)
TypeError: Invalid flag 'lineAAEnable' // 
b'Processing Extract Review'
// Error: pyblish.plugin : Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "D:\REPO\OpenPype\openpype\plugins\publish\extract_review.py", line 73, in process
KeyError: 'representations'
Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "<string>", line 73, in process
KeyError: 'representations' // 
b'Processing Extract burnins'
// Error: pyblish.plugin : Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "D:\REPO\OpenPype\openpype\plugins\publish\extract_burnin.py", line 79, in process
RuntimeError: Burnin needs already created mov to work on.
Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "<string>", line 79, in process
RuntimeError: Burnin needs already created mov to work on. // 

@ghost
Copy link
Author

ghost commented Jun 27, 2022

Thank you @m-u-r-p-h-y please try to reset your project's settings and try again, it's propagating keys from the playblast options PR into this which breaks it!

@ghost ghost requested a review from m-u-r-p-h-y June 27, 2022 13:41
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.

You were right @Allan-I My settings from the previous PR messed up my settings. Now it is passing correctly.

with the explicitly set resolution it is not producing the correct output

image

@mkolar mkolar requested a review from m-u-r-p-h-y June 28, 2022 10:20
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 made sure I'm resetting the project settings first before testing this PR.

Now it does not behave properly. This is the output from script editor in maya which indicates we are not passing the correct values to playblast resolution:

'height': None, 'width': None,

// pyblish.ExtractPlayblast : Extracting capture.. // 
// pyblish.ExtractPlayblast : start: 1090, end: 1100 // 
// pyblish.ExtractPlayblast : Outputting images to C:\Users\murph\AppData\Local\Temp\pyblish_tmp_1gt397_1\reviewMain // 
// pyblish.ExtractPlayblast : using viewport preset: {'compression': 'jpg', 'format': 'image', 'quality': 95, 'off_screen': True, 'height': None, 'width': None, 'display_options': {'background': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'backgroundBottom': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'backgroundTop': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'displayGradient': True}, 'viewport_options': {'rendererName': 'vp2Renderer', 'displayLights': 'default', 'shadows': True, 'textures': True, 'twoSidedLighting': True, 'cameras': False, 'clipGhosts': False, 'controlVertices': False, 'deformers': False, 'dimensions': False, 'dynamicConstraints': False, 'dynamics': False, 'fluids': False, 'follicles': False, 'greasePencils': False, 'grid': False, 'hairSystems': True, 'handles': False, 'hud': False, 'hulls': False, 'ikHandles': False, 'imagePlane': True, 'joints': False, 'lights': False, 'locators': False, 'manipulators': False, 'motionTrails': False, 'nCloths': False, 'nParticles': False, 'nRigids': False, 'nurbsCurves': False, 'nurbsSurfaces': False, 'particleInstancers': False, 'pivots': False, 'planes': False, 'pluginShapes': False, 'polymeshes': True, 'strokes': False, 'subdivSurfaces': False}, 'viewport2_options': {'textureMaxResolution': 1024, 'enableTextureMaxRes': True, 'textureMaxResMode': 1, 'multiSampleEnable': True, 'multiSampleCount': 4, 'ssaoEnable': True}, 'sound': None, 'camera': '|camera1|cameraShape1', 'start_frame': 1090, 'end_frame': 1100, 'filename': 'C:\\Users\\murph\\AppData\\Local\\Temp\\pyblish_tmp_1gt397_1\\reviewMain', 'overwrite': True, 'viewer': False} // 
currentTime 1100 ;
// pyblish.ExtractPlayblast : playblast path  C:\Users\murph\AppData\Local\Temp\pyblish_tmp_1gt397_1\reviewMain.####.jpg // 
// pyblish.ExtractPlayblast : filename C:\Users\murph\AppData\Local\Temp\pyblish_tmp_1gt397_1\reviewMain // 
// pyblish.ExtractPlayblast : collection head reviewMain // 
// pyblish.ExtractPlayblast : we found collection of interest reviewMain.%d.jpg [1090-1100] // 
b'Processing Thumbnail'
// pyblish.ExtractThumbnail : Extracting capture.. // 
// pyblish.ExtractThumbnail : Using viewport preset: {'compression': 'jpg', 'format': 'image', 'quality': 95, 'isolate_view': True, 'off_screen': True, 'height': 0, 'width': 0, 'display_options': {'background': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'backgroundBottom': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'backgroundTop': [0.49019607843137253, 0.49019607843137253, 0.49019607843137253], 'displayGradient': True}, 'viewport_options': {'rendererName': 'vp2Renderer', 'displayLights': 'default', 'shadows': True, 'textures': True, 'twoSidedLighting': True, 'cameras': False, 'clipGhosts': False, 'controlVertices': False, 'deformers': False, 'dimensions': False, 'dynamicConstraints': False, 'dynamics': False, 'fluids': False, 'follicles': False, 'greasePencils': False, 'grid': False, 'hairSystems': True, 'handles': False, 'hud': False, 'hulls': False, 'ikHandles': False, 'imagePlane': True, 'joints': False, 'lights': False, 'locators': False, 'manipulators': False, 'motionTrails': False, 'nCloths': False, 'nParticles': False, 'nRigids': False, 'nurbsCurves': False, 'nurbsSurfaces': False, 'particleInstancers': False, 'pivots': False, 'planes': False, 'pluginShapes': False, 'polymeshes': True, 'strokes': False, 'subdivSurfaces': False}, 'viewport2_options': {'textureMaxResolution': 1024, 'enableTextureMaxRes': True, 'textureMaxResMode': 1, 'multiSampleEnable': True, 'multiSampleCount': 4, 'ssaoEnable': True}, 'sound': None} // 
// pyblish.ExtractThumbnail : Outputting images to C:\Users\murph\AppData\Local\Temp\pyblish_tmp_1gt397_1\reviewMain // 
currentTime 1090 ;

Allan I. A and others added 7 commits June 28, 2022 18:20
@ghost ghost requested a review from m-u-r-p-h-y July 1, 2022 13:38
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.

testing scenario:

  • project_anatomy/attributes/resolution 1920x1080
  • project_settings/maya/publish/ExtractPlayblast/capture_preset/Resolution 0x0
  • review instance resolution 0x0
  • shot resolution in mongoDB set to 1080x1920

resulting playblast and thumbnail resolution 1080x1920 - CORRECT


  • project_anatomy/attributes/resolution 1920x1080
  • project_settings/maya/publish/ExtractPlayblast/capture_preset/Resolution 800x800
  • review instance resolution 0x0
  • shot resolution in mongoDB set to 1080x1920

resulting playblast and thumbnail resolution 1080x1920 - INCORRECT
we should have 800x800


  • project_anatomy/attributes/resolution 1920x1080
  • project_settings/maya/publish/ExtractPlayblast/capture_preset/Resolution 800x800
  • review instance resolution 1000x1000
  • shot resolution in mongoDB set to 1080x1920

resulting playblast and thumbnail resolution 1000x1000 - CORRECT

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.

After extensive testing resolution overrides work as expected.

1. Review Instance resolution has the top priority
if set to 0
2. project_settings/maya/publish/ExtractPlayblast/capture_preset/ resolution is used
if set to 0
3. shot/asset resolution is queried from database

Good job @Allan-I :)

@mkolar mkolar merged commit adc90a4 into develop Jul 4, 2022
@mkolar mkolar deleted the OP-3088_Ability-to-sync-asset-resolution-playblast-and-review-resolution branch July 4, 2022 13:04
@mkolar mkolar changed the title OP-3088: Ability to set resolution for playblasts from asset, and override through review instance. Maya: Ability to set resolution for playblasts from asset, and override through review instance. Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants