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

Automatic thumbnail generation on publishing review #189

Closed
wants to merge 2 commits into from

Conversation

Dreamink-Official
Copy link

Added product family "review" and representation to instance

Changelog Description

As proposed in ynput/ayon-core#1049 I adjusted the ExtractActiveViewThumbnail class to allow to extract a thumbnail for the product family "review" it adds a representation for the extracted thumbnail.

Testing notes:

  1. Open Houdini and publish a review

Added product family "review" and representation to instance
@Dreamink-Official Dreamink-Official changed the title Update extract_active_view_thumbnail.py Automatic thumbnail generation on publishing review Dec 2, 2024
@antirotor antirotor added the community Issues and PRs coming from the community members label Dec 11, 2024
Comment on lines +47 to +61

instance.data.setdefault("representations", [])
representation = {
"name": "thumbnail",
"ext": "jpg",
"files": os.path.basename(view_thumbnail),
"stagingDir": os.path.dirname(view_thumbnail),
"thumbnail": True
}

# Adding representation to instance
instance.data["representations"].append(representation)
self.log.debug(
"Adding thumbnail representation: {}".format(representation)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
instance.data.setdefault("representations", [])
representation = {
"name": "thumbnail",
"ext": "jpg",
"files": os.path.basename(view_thumbnail),
"stagingDir": os.path.dirname(view_thumbnail),
"thumbnail": True
}
# Adding representation to instance
instance.data["representations"].append(representation)
self.log.debug(
"Adding thumbnail representation: {}".format(representation)
)

you shouldn't add representation for the thumbnail as there are dedicated plugins for creating the representation.

Copy link
Author

Choose a reason for hiding this comment

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

Great! I didn’t know there were more general plugins in the core addon. That would’ve saved me some time figuring out how to add the thumbnail (even though it’s pretty easy, haha). So, creating a PR in the ayon-core repo to implement the 'review' family and 'houdini' as host is the right approach, correct?"

class ExtractThumbnail(pyblish.api.InstancePlugin):
    """Create jpg thumbnail from sequence using ffmpeg"""

    label = "Extract Thumbnail"
    order = pyblish.api.ExtractorOrder + 0.49
    families = [
        "imagesequence", "render", "render2d", "prerender",
        "source", "clip", "take", "online", "image", "review"
    ]
    hosts = [
        "shell",
        "fusion",
        "resolve",
        "traypublisher",
        "substancepainter",
        "nuke",
        "aftereffects",
        "unreal",
        "houdini",
    ]
    enabled = False

Copy link
Contributor

Choose a reason for hiding this comment

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

yes!
Houdini host is missing as you have pointed out.

@@ -17,7 +18,8 @@ class ExtractActiveViewThumbnail(plugin.HoudiniExtractorPlugin,
"""
order = pyblish.api.ExtractorOrder + 0.49
label = "Extract Active View Thumbnail"
families = ["workfile"]
families = ["workfile",
"review"]
Copy link
Contributor

@MustafaJafar MustafaJafar Dec 12, 2024

Choose a reason for hiding this comment

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

My feeling, this is more of a "workaround" than a "proper solution".

Additionally, a snapshot from the sceneview may not look the same as the first frame of the review.
This is not for review only but also render and image sequence products.

What about using the first frame as the thumbnail? (we'll need to convert it to png or jpg).
My feeling, it can be a core feature for all DCCs. It's actually a core feature...

Copy link
Author

Choose a reason for hiding this comment

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

Using the first frame as the thumbnail could also work. The input from our artists was that it would be great to be able to choose a specific frame. But you are right. In the end that will not look like the real render by using the screenshot of the viewport. So perhaps adding a option in the publisher to be able to select which frame should be used as thumbnail (not only the middle frame of the sequence) could be an option?

Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to create an issue for it on ayon-core.

@MustafaJafar
Copy link
Contributor

From previous discussion, the issue was not an implemented feature in Houdini.
The feature already exists in core addon but it was lacking Houdini host.

Closing this PR in favor of ynput/ayon-core#1048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants