Skip to main content
C.Cella
Inspiring
February 15, 2024
Open for Voting

P: Implement "LrDevelopController.duplicateMask"and duplicateMaskTool() in the SDK

  • February 15, 2024
  • 2 replies
  • 303 views

At today is impossible to directly duplicate a Mask with the SDK.

 

  • Please implement: LrDevelopController.duplicateMask () and LrDevelopController.duplicateMaskTool ()

 

.

2 replies

C.Cella
C.CellaAuthor
Inspiring
February 21, 2024

FWIW I was able to create a script that duplicates a Mask WITH its settings BUT due to a missing parameter in the SDK is not duplicating all settings.

 

It should trivial to implement LrDevelopController.duplicateMask () 

 

.

 

C.Cella
C.CellaAuthor
Inspiring
February 15, 2024

I was able to create a "Duplicate Mask" command using this code.

 

 

 

local LrDevelopController = import "LrDevelopController"

local maskId = LrDevelopController.getSelectedMask ()
if maskId == nil then return end

LrDevelopController.duplicateAndInvertMask (maskId)

local maskId = LrDevelopController.getSelectedMask (maskId)
LrDevelopController.invertMask (maskId)

 

 

 

This workaround works BUT the resulting Mask is still bearing the suffix "Inverted" BUT obviously tis not inverted.

 

 

 

Also history step states Duplicate and Invert (Name of the Mask) but again that is false.

 

 

In this case the Step should at least state the usual generic SDK step "Camera Raw Settings" or "Multiple Settings"

 

Direct LrDevelopController.duplicateMask () would give us the correct result.

 

@johnrellis 

I am not skilled enough to to create a code that sets a Mask with the correct suffix OR even allow to assign a custom name to the newly created mask but I think you know how to do it.

 

Perhaps you can already create a "Duplicate Mask" and "Duplicate and Invert" command" that allow users to immediately set the mask name upon duplication as I FR here: https://community.adobe.com/t5/lightroom-classic-ideas/p-masking-allow-to-immediately-quot-rename-quot-when-duplicating-a-mask/idi-p/14424717

 

 

 

.