@ariestav Yes, it seems to be the case.
( In my case I change them “globally”, I do not modify existing keyframes nor try to create animation )
Here is the sample code I used (code & helper function barely tested, just enough so I can start playing with mogrt).
const ppro = require("premierepro");
const proj = await ppro.Project.getActiveProject()
const seq = await proj.getActiveSequence()
const tt = ppro.TickTime.createWithSeconds(0)
const seqEdit = await ppro.SequenceEditor.getEditor(seq)
let videotrackColl = null
proj.lockedAccess( () => {
videotrackColl = seqEdit.insertMogrtFromPath("C:\\Users\\marcc\\OneDrive\\Documents\\Adobe\\Premiere Pro (Beta)\\26.0\\greenRect.mogrt", tt, 2, 2)
// videotrackColl = seqEdit.insertMogrtFromPath("C:\\Users\\marcc\\OneDrive\\Documents\\Adobe\\Premiere Pro (Beta)\\26.0\\textHelloWorld.mogrt", tt, 2, 2)
})
const trackitem = videotrackColl[0]
await DEBUG_dumpAllValues(trackitem)
log("")
log("====================")
log("")
await setComponentValue(trackitem, "Vector Motion", "Scale Width", 50)
const pos = ppro.PointF(0,0)
await setComponentValue(trackitem, "Shape", "Rotation", 45)
// await setComponentValue(trackitem, Component.TEXT, Component.Parameters.TEXT.SOURCE_TEXT, "FOOBAR !?!?") // setting text does not work
log("")
log("====================")
log("")
await DEBUG_dumpAllValues(trackitem)
with helper functions:
async function setComponentValue(trackItem, componentName, propertyName, newvalue) {
let target = null
const componentChain = await trackItem.getComponentChain()
const component = await _getComponent(componentName, componentChain)
const propertyCount = await component.getParamCount()
for(let i = 0; i < propertyCount; i++) {
const property = await component.getParam(i)
const itemName = property.displayName
if (itemName.toLowerCase() != propertyName.trim().toLowerCase()) {
logDebug(`... property '${itemName}' does not match`)
continue
}
logDebug(`Found matching property ${itemName}`)
target = property
break
}
if (!target) {
throw new Error(`Property or component not found, unable to rename`)
}
let keyframeAtZero = await target.getStartValue()
keyframeAtZero = getPropertyOrNull(keyframeAtZero, "value")
keyframeAtZero = getPropertyOrNull(keyframeAtZero, "value") // Duplicated on purpose, need obj.value.value
logDebug(`Previous property value was set to '${keyframeAtZero}' changing to '${newvalue}'`)
const kfEntry = target.createKeyframe(newvalue)
const currProj = await ppro.Project.getActiveProject()
let result = null
await currProj.lockedAccess(async () => {
result = currProj.executeTransaction((compoundAction) => {
const action = target.createSetValueAction(kfEntry) // Note: assuming this is a non time changing value
compoundAction.addAction(action);
})
})
if (! result) {
throw new Error(`Unable to change the property value of the morgt`)
}
}
———————
async function _getComponent(componentName, componentChain) {
RETRY_SEC = 5
let retval = null
const start = Date.now()
let end = Date.now()
while (! retval && (end - start) / 1000 < RETRY_SEC ) { // HACK / workaround for bug
let count = await componentChain.getComponentCount() // This seem to be changing over time (Adobe bug ?)
let component = null
for(let i = 0; i < count; i++) {
component = await componentChain.getComponentAtIndex(i)
const name = await component.getDisplayName()
if (name.trim().toLowerCase() == componentName.toLowerCase()) {
retval = component
break
}
}
if (! retval)
{
logWarning("Specified component not found yet, trying again")
await sleep(250)
end = Date.now()
}
}
if (!retval) {
logError(`Unable to find component '${componentName}'`)
throw new Error(`Unable to find component '${componentName}'`)
}
return retval
}
========================
To dump properties:
function getPropertyOrNull(obj, propertyName) {
let retval = null
if (obj === null) {
return retval
}
try {
retval = obj[propertyName] // for some reason Object.hasOwn(propertyName) does not work
}
catch (err) {
// retval = null
}
return retval
}
———————
async function DEBUG_dumpAllValues(trackItem) {
let target = null
const componentChain = await trackItem.getComponentChain()
const componentCount = await componentChain.getComponentCount()
for(let i = 0; i < componentCount; i++) {
const component = await componentChain.getComponentAtIndex(i)
const compName = await component.getDisplayName()
logDebug(compName)
const propertyCount = await component.getParamCount()
for(let i = 0; i < propertyCount; i++) {
const property = await component.getParam(i)
const itemName = property.displayName
if (!property) {
logDebug(`... (empty property)`)
continue
}
let keyframeAtZero = await property.getStartValue()
keyframeAtZero = getPropertyOrNull(keyframeAtZero, "value")
keyframeAtZero = getPropertyOrNull(keyframeAtZero, "value") // Duplicated on purpose, need obj.value.value
logDebug(`... '${itemName}' --> ${keyframeAtZero}`)
}
}
}
Before
After: