Mobile app version of vmapp.org
Login or Join
Vandalay110

: New Smart Object via Copy inside a Layer Group Is it possible to duplicate a layer group that contains multiple smart objects with relationships to each other, so the duplicate group is separated

@Vandalay110

Posted in: #AdobePhotoshop #Smartobject

Is it possible to duplicate a layer group that contains multiple smart objects with relationships to each other, so the duplicate group is separated from the original?

I need the duplicate to be editable without changing the original. This can be achieved by the context menu when interacting with a single smart object, but not for a group containing multiple smart objects.

Any ideas?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay110

4 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi706

Copy the group and Convert it to a Smart Object. Then open the Smart Object and drag the group inside back to your original document. Not a very elegant solution, but it gets the job done fast.

10% popularity Vote Up Vote Down


 

@Ogunnowo857

Below is a script that should do what you want.

The script is pretty much identical to the native Duplicate function. The key difference is that Embedded Smart objects within the selection are unlinked from other Embedded Smart objects that sit outside the selection.

This means that if the selected layers are Embedded Smart objects that are direct duplicates of each other, those links won't break.

There is a slight difference in how the layers are named, but I didn't see that as any sort of issue, so I left it like that.



While using a script might feel a bit cumbersome, remember that you can always set a shortcut keys to run scripts:

1. Put the script in the scripts folder.

2. Restart photoshop.

3. Edit > Keyboard shortcuts and menus.

4. In the scrollable area click File and scroll way down to find Scripts> and below that you should find the script name. All that is left is to add the shortcut to it.



The script ( Only tested in PS cc 2014 ):

// gist.github.com/joonaspaakko/898394cf2b46ae7b6ad7 #target photoshop

// If there are any documents open, run the code...
// =================================================
if ( app.documents.length > 0 ) {

// Used later on when the layers are duplicated back to the original document.
// ===========================================================================
var docName = app.activeDocument.name;

// Script listener code - Duplicate active group to a new document.
// =================================================================
var idMk = charIDToTypeID( "Mk " );
var desc14 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref10 = new ActionReference();
var idDcmn = charIDToTypeID( "Dcmn" );
ref10.putClass( idDcmn );
desc14.putReference( idnull, ref10 );
var idUsng = charIDToTypeID( "Usng" );
var ref11 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref11.putEnumerated( idLyr, idOrdn, idTrgt );
desc14.putReference( idUsng, ref11 );
var idVrsn = charIDToTypeID( "Vrsn" );
desc14.putInteger( idVrsn, 5 );
executeAction( idMk, desc14, DialogModes.NO );


// Script listener code - Duplicate active group to the prior document.
// =====================================================================
var idDplc = charIDToTypeID( "Dplc" );
var desc16 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref13 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref13.putEnumerated( idLyr, idOrdn, idTrgt );
desc16.putReference( idnull, ref13 );
var idT = charIDToTypeID( "T " );
var ref14 = new ActionReference();
var idDcmn = charIDToTypeID( "Dcmn" );
ref14.putName( idDcmn, docName );
desc16.putReference( idT, ref14 );
var idVrsn = charIDToTypeID( "Vrsn" );
desc16.putInteger( idVrsn, 5 );
executeAction( idDplc, desc16, DialogModes.NO );

// Closes the new document.
// =======================================================
app.activeDocument.close( SaveOptions.DONOTSAVECHANGES );

}

10% popularity Vote Up Vote Down


 

@Speyer780

Yes, just make a New Smart Object via Copy of the Layer Group.
Then you should be able to modify it without compromise the original group.

10% popularity Vote Up Vote Down


 

@Frith110

I would drop the layer group into a new, empty document. From there, I would modify the contents inside the smart object at least once - a forward then back nudge will do, save smart object contents, then copy the newly edited layer group back into the main document.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme