SDK Issue with applyDevelopPreset for plugin created with plug-in
I am building a plugin that allows me to "Save" settings from one image and then "Apply" those settings to another image. I am saving the settings from the reference image to a develop preset using LrApplication.addDevelopPresetForPlugin() (this is one lua file) and then applying the settings using photo:applyDevelopPreset() (this is a different lua file). Everything is working as it should except when I attempt to apply the settings multiple times in a row. I receive an error that says "An internal error has occurred. assertion failed!"
Here is a video of the error: https://vimeo.com/893943484/947d84620e?share=copy
Here is my script for the Save Settings lua file:
local LrApplication = import "LrApplication"
local LrDialogs = import 'LrDialogs'
local LrTasks = import 'LrTasks'
local catalog = LrApplication.activeCatalog ()
local photo = catalog:getTargetPhoto ()
local targetPhoto = catalog:getTargetPhoto ()
LrTasks.startAsyncTask( function()
catalog:withWriteAccessDo ("Save Settings One", function ()
local settings = targetPhoto:getDevelopSettings ()
savesettingsone = LrApplication.addDevelopPresetForPlugin(_PLUGIN, "Paste Settings", settings)
end)
end)
Here is my script for the Apply Settings lua file:
local LrApplication = import "LrApplication"
local LrDialogs = import 'LrDialogs'
local LrTasks = import 'LrTasks'
local catalog = LrApplication.activeCatalog ()
local photo = catalog:getTargetPhoto ()
local photos = catalog:getTargetPhotos()
LrTasks.startAsyncTask( function()
catalog:withWriteAccessDo ("Paste", function ()
photo:applyDevelopPreset(savesettingsone, _PLUGIN)
end)
end)
Any thoughts on what is happening here?
