Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Nuke | Global: adding custom tags representation filtering #4009

Merged
merged 7 commits into from
Oct 24, 2022

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Oct 19, 2022

Brief description

Representation can be filtered by custom tagging in extract review

Description

Extract review was filtering only on the publishing instance level and not able to aim directly at particular representation. We have to implement filtering method to be able to activate output preset only to particular representation.

Additional info

  • adding custom_tag as optional key to representation
  • adding custom_tags to nuke extract review data movie plugin
  • improving nuke's way of handling viewerProcess to include also display selector which is now pars-able from a string. The syntax is as follows:
    • add string input to project_settings/nuke/publish/ExtractReviewDataMov/outputs/baking/viewer_process_override in case you want to add bake stream overide of project_settings/nuke/imageio/baking/viewerProcess (notice we hade moved imagio from Anatomy settings to project settings)
    • syntax is either: viewer_name (display_name) or display_name/viewer_name
    • examples are: sRGB (ACES) or ACES/sRGB

Matching mechanics:

image

Testing notes:

  1. Open Studio settings and go to your project settings
  2. go to project_settings/nuke/publish/ExtractReviewDataMov/outputs
  3. Add one more baking stream and set its Add custom tag to some value
  4. Go to project_settings/global/publish/ExtractReview/profiles
  5. Create a new profile, add it at first, set the host input to nuke
  6. Add two output profiles > it could be h264 ffmpeg args copied form default preset. Set names to h264first and h264first two the same profiles, except one of them is having set Additional filtering to custom tags with the same input from step 3.
  7. In the same project open Nuke and Create render write node.
  8. Publish and notice that preset defined filter on custom tag was run only once.

@jakubjezek001 jakubjezek001 self-assigned this Oct 19, 2022
@ynbot
Copy link
Contributor

ynbot commented Oct 19, 2022

Task linked: OP-4217 ProRes4444 ACEScct mov profile

@jakubjezek001 jakubjezek001 added host: Nuke type: enhancement Enhancements to existing functionality labels Oct 19, 2022
Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/local/bin/flake8", line 8, in 
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 393, in run
    self._run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 381, in _run
    self.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 300, in run_checks
    self.file_checker_manager.run()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 331, in run
    self.run_serial()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 315, in run_serial
    checker.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 598, in run_checks
    self.run_ast_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 502, in run_ast_checks
    for (line_number, offset, text, check) in runner:
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 56, in run
    parser.visit(self.tree)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 379, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 39, in visit_ClassDef
    self.capture_issues_visitor('ClassDef', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 33, in capture_issues_visitor
    self.generic_visit(node)
  File "/usr/lib/python3.8/ast.py", line 381, in generic_visit
    self.visit(value)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 36, in visit_Call
    self.capture_issues_visitor('Call', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 30, in capture_issues_visitor
    issues = checker.run(node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checkers/render.py", line 22, in run
    if isinstance(arg, ast.Call) and arg.func.id == 'locals':
AttributeError: 'Attribute' object has no attribute 'id'

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/local/bin/flake8", line 8, in 
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 393, in run
    self._run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 381, in _run
    self.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 300, in run_checks
    self.file_checker_manager.run()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 331, in run
    self.run_serial()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 315, in run_serial
    checker.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 598, in run_checks
    self.run_ast_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 502, in run_ast_checks
    for (line_number, offset, text, check) in runner:
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 56, in run
    parser.visit(self.tree)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 379, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 39, in visit_ClassDef
    self.capture_issues_visitor('ClassDef', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 33, in capture_issues_visitor
    self.generic_visit(node)
  File "/usr/lib/python3.8/ast.py", line 381, in generic_visit
    self.visit(value)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 36, in visit_Call
    self.capture_issues_visitor('Call', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 30, in capture_issues_visitor
    issues = checker.run(node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checkers/render.py", line 22, in run
    if isinstance(arg, ast.Call) and arg.func.id == 'locals':
AttributeError: 'Attribute' object has no attribute 'id'

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/local/bin/flake8", line 8, in 
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 393, in run
    self._run(argv)
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 381, in _run
    self.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/main/application.py", line 300, in run_checks
    self.file_checker_manager.run()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 331, in run
    self.run_serial()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 315, in run_serial
    checker.run_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 598, in run_checks
    self.run_ast_checks()
  File "/usr/local/lib/python3.8/dist-packages/flake8/checker.py", line 502, in run_ast_checks
    for (line_number, offset, text, check) in runner:
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 56, in run
    parser.visit(self.tree)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 379, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 39, in visit_ClassDef
    self.capture_issues_visitor('ClassDef', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 33, in capture_issues_visitor
    self.generic_visit(node)
  File "/usr/lib/python3.8/ast.py", line 381, in generic_visit
    self.visit(value)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 36, in visit_Call
    self.capture_issues_visitor('Call', node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checker.py", line 30, in capture_issues_visitor
    issues = checker.run(node)
  File "/usr/local/lib/python3.8/dist-packages/flake8_django/checkers/render.py", line 22, in run
    if isinstance(arg, ast.Call) and arg.func.id == 'locals':
AttributeError: 'Attribute' object has no attribute 'id'

Comment on lines +1749 to +1765
# lower all filter tags
tag_filters_low = [tag.lower() for tag in tag_filters]

self.log.debug("__ tag_filters: {}".format(tag_filters))
self.log.debug("__ repre_c_tags_low: {}".format(
repre_c_tags_low))

# check if any repre tag is not in filter tags
for tag in repre_c_tags_low:
if tag in tag_filters_low:
valid = True
break

if not valid:
continue

filtered_outputs.append(output_def)
Copy link
Member

Choose a reason for hiding this comment

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

Removed unnecessary loggers and do tags filtering only if they are set.

Suggested change
# lower all filter tags
tag_filters_low = [tag.lower() for tag in tag_filters]
self.log.debug("__ tag_filters: {}".format(tag_filters))
self.log.debug("__ repre_c_tags_low: {}".format(
repre_c_tags_low))
# check if any repre tag is not in filter tags
for tag in repre_c_tags_low:
if tag in tag_filters_low:
valid = True
break
if not valid:
continue
filtered_outputs.append(output_def)
else:
# lower all filter tags
tag_filters_low = [tag.lower() for tag in tag_filters]
# check if any repre tag is not in filter tags
for tag in repre_c_tags_low:
if tag in tag_filters_low:
valid = True
break
if valid:
filtered_outputs.append(output_def)

Copy link
Member

@iLLiCiTiT iLLiCiTiT Oct 21, 2022

Choose a reason for hiding this comment

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

This will fix this issue too #4009 (review) Not true.

This change won't cause issues with old settings overrides.

Copy link
Collaborator

@jrsndl jrsndl left a comment

Choose a reason for hiding this comment

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

I tested the tags, and publish crashes on FFprobe in Extract Review. The same Shot Publishes OK on latest Develop.

02_MovExists
/45896205/197170720-a76fde38-e8b3-4dc6-b936-f5be251ab295.png)
01_FFprobeError

@jrsndl jrsndl self-requested a review October 21, 2022 15:53
Copy link
Collaborator

@jrsndl jrsndl left a comment

Choose a reason for hiding this comment

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

The error above is not relevant to this PR. Sorry

I did more tests: with Nuke 12.2 and Nuke 13.2. With and without slate, with different burnin combinations.
All works

@jakubjezek001 jakubjezek001 merged commit 75c2122 into develop Oct 24, 2022
@jakubjezek001 jakubjezek001 deleted the feature/OP-4217_ProRes4444-ACEScct-mov-profile branch October 24, 2022 11:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Nuke type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants