I’m trying to make a plugin that resizes images and lays them out in visually interesting ways. The images themselves can be all different sizes, not necessarily a fixed resolution or aspect ratio.
To determine the layouts, I need to know the dimensions of the source media - either the original file or the rectangle it currently takes up on screen, either is fine.
I’ve got as far as accessing the ClipProjectItem for items selected (which can get the the media file path among other things), but looking through the API, I don’t see anything from there that gets me the info I need. Is there some means to access this?
Thank you!
[ Note: I tried with video clips not static images ]
I just gave it a quick try in the ADP playground.
It seem like from the VideoClip you need to access the FootageInfo (not the Media Object you were looking at) then query for the clip dimensions:
const currProj = await ppro.Project.getActiveProject();
const selection = await ppro.ProjectUtils.getSelection(currProj)
const projItems = await selection.getItems()
const projItem = projItems[0]
const videoclip = await ppro.ClipProjectItem.cast(projItem)
const footageInfo = await videoclip.getFootageInterpretation()
const h = await footageInfo.getVrHorzView()
const v = await footageInfo.getVrVertView()
const c = await footageInfo.getVrConform()
const l = await footageInfo.getVrLayout()
log(`${h} x ${v} -- Layout: ${l} / Conform: ${c}`)