Photoshop: Unify Layer Position/Visibility can not be automated

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
In our company, we use Photoshop a lot to create sprite animation for video games. This includes the usage of the animation feature. One problem we have encountered though is that it does not seem to be possible to automate the settings "Unify Layer Position" and "Unify Layer Visibility". We need these settings activated on every single layer in our files, and we always have to set them manually which is very tedious and costs a lot of time. It is not possible to record an action (despite the fact that the unify settings show up in the history) nor have our programmers found a way to set these flags via Java Script. Is there any way this can be done?
Photo of Hannes Drexl

Hannes Drexl

  • 8 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15367 Posts
  • 2241 Reply Likes
Hi Hannes,

That is strange. The Listener plug-in does record these action descriptors but does nothing when executed:

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc80 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref31 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref31.putEnumerated( idLyr, idOrdn, idTrgt );
desc80.putReference( idnull, ref31 );
var idT = charIDToTypeID( "T " );
var desc81 = new ActionDescriptor();
var idanimationUnifyPosition = stringIDToTypeID( "animationUnifyPosition" );
desc81.putBoolean( idanimationUnifyPosition, true );
var idLyr = charIDToTypeID( "Lyr " );
desc80.putObject( idT, idLyr, desc81 );
executeAction( idsetd, desc80, DialogModes.NO );

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc82 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref32 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref32.putEnumerated( idLyr, idOrdn, idTrgt );
desc82.putReference( idnull, ref32 );
var idT = charIDToTypeID( "T " );
var desc83 = new ActionDescriptor();
var idanimationUnifyVisibility = stringIDToTypeID( "animationUnifyVisibility" );
desc83.putBoolean( idanimationUnifyVisibility, true );
var idLyr = charIDToTypeID( "Lyr " );
desc82.putObject( idT, idLyr, desc83 );
executeAction( idsetd, desc82, DialogModes.NO );

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc84 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref33 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref33.putEnumerated( idLyr, idOrdn, idTrgt );
desc84.putReference( idnull, ref33 );
var idT = charIDToTypeID( "T " );
var desc85 = new ActionDescriptor();
var idanimationUnifyEffects = stringIDToTypeID( "animationUnifyEffects" );
desc85.putBoolean( idanimationUnifyEffects, true );
var idLyr = charIDToTypeID( "Lyr " );
desc84.putObject( idT, idLyr, desc85 );
executeAction( idsetd, desc84, DialogModes.NO );

I'm looking into it with the team.
Photo of Hannes Drexl

Hannes Drexl

  • 8 Posts
  • 0 Reply Likes
Great, thank you for looking into it! It would be very helpful for us if that could be fixed.

I've got a couple of similar problems where we had trouble to script some Photoshop functionality that should theoretically be possible to be scripted. I'll compile them once I find the time and create a new issue.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15367 Posts
  • 2241 Reply Likes
Great. Separate topics with sample code with help immensely.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15367 Posts
  • 2241 Reply Likes
Official Response
This should be fixed in the Photoshop CC (2015) update.