Add a property to identify thumbnail renders
Mentioned in #187 here's what I already use in my host:
/** @brief Indicates whether a thumbnail image is being rendered.
- Type - int X 1
- Property Set - a read only in argument property to ::kOfxImageEffectActionRender
- Valid Values - this must be one of
- 0 - The plugin is not rendering a thumbnail image.
- 1 - The plugin is rendering a thumbnail image.
*/
#define kOfxImageEffectPropThumbnailRender "OfxImageEffectPropThumbnailRender"
could be extended to set it in BeginSequenceRender as well if that helps anyone.
BTW, I note that Resolve has this, as a clip property:
/** @brief Says whether the clip is for thumbnail.
- Type - int X 1
- Property Set - clip instance (read only)
- Valid Values - This must be one of 0 or 1
*/
#define kOfxImageClipPropThumbnail "kOfxImageClipPropThumbnail"
Would be useful to migrate to main for me Also aren't we supposed to prefix what is not in main yet? :)
kOfxImageEffectPropThumbnailRender and kOfxImageClipPropThumbnail
If something is shipped to users (e.g. by a host) then yes it should be prefixed. A simple PR here does not need to be.
We don't need both of these props, right? Should we just pick one and say that's the way to do it?
The Render inArg prop kOfxImageEffectPropThumbnailRender makes more sense to me as a plugin developer because it's just one thing to check (I presume this would be available in IsIdentity as well?), whereas a clip property could be confusing -- if I take 3 inputs and only one of them is marked as thumbnail, what should I do? Maybe only check the dest clip?
Should be a single check for whole effect not per clip and as Phil suggest for good form should also work in BeginRender
This is not a PR if both Baselight and Resolve have this in their software now.
I agree, per-render is better.
Resolve has it per-clip, which I don't think is right. But even if both hosts already had it the same, it's still a valid spec change to make it official and add it to the header files and doc.
@barretpj would you make a PR with your property? My suggestion (feel free to suggest alternatives) would be to make it available in the inArgs of the following:
- Render and BeginSequenceRender
- GetRegionOfDefinition and GetRegionsOfInterest
- InstanceChanged and BeginInstanceChanged
- IsIdentity (maybe, if it makes sense)
I made that list by looking at RenderScale which is kind of similar.
I suggest that this property should also be passed to kOfxImageEffectActionIsIdentity so a plugin can turn itself off for thumbnails, kOfxImageEffectActionGetFramesNeeded so a plugin can turn off temporal behaviour for thumbnails, and potentially other actions.
NB just dug back in my email and found this was actually proposed by Nathan Weston (then at GenArts) in 2008:
We're hoping to do this as an unofficial extension first, and if it gets traction, worry about making it part of the official OFX spec later. I've attached a header file for the proposed property.
This is added in Silhouette 2025.5.2