-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
Added product family "review" and representation to instance
|
||
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) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
From previous discussion, the issue was not an implemented feature in Houdini. Closing this PR in favor of ynput/ayon-core#1048 |
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: