Photoshop: Link / unlink Layer/Vector mask to multiple Layers.

  • 4
  • Idea
  • Updated 6 years ago
  • (Edited)
Link or Unlink ALL Layer or Vector Masks in a file.

Common Scenario:

when Transforming a Layer with a Layer Mask unlinked, only content of the Layer is being Transformed and the content of a layer/Vector mask remains unchanged.
If unintended, this could cause a headache.

Often the Transformation is performed on many layers placed in multiple Layer Groups. It is easy to overlook unlinked Layer or Vector Mask.

Fix and prevention:

Trying to match the Layer/Vector mask to already modified Layer or go back in History.

Preventively, one must scroll through all Layers in a File to locate unlinked Layer or Vector masks and link them manually.

The suggested function would quickly solve this and help to increase productivity.

Please correct me if this function or easy workaround already exist.

Thanks!
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
  • excited to hear back!

Posted 9 years ago

  • 4
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 16089 Posts
  • 2530 Reply Likes
This workflow might be solved with a script (If there are any enterprising script writers out there)
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
Jeffery, while I agree with you this could be solved with a simple script, I believe that offering this as a standard PSD feature would align with Adobe's philosophy to create an intuitive software with emphasis on productivity. Isn't that what separates Adobe products from the rest of the pack?

Simple addition such as the one I suggested would go hand to hand with features like 'Delete all Hidden Layers', Lock All Layers in Group' or 'Select Linked layers'.

Please reconsider whether this suggestion is worthy of further discussion.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 16089 Posts
  • 2530 Reply Likes
Sure. I understand. Just offering a solution that could work immediately. There's never a guarantee that every idea submitted will be implemented.
Photo of Armaan Ahluwalia

Armaan Ahluwalia

  • 6 Posts
  • 0 Reply Likes
I agree with roman. You can read the case in which the need for this arises in my comment below. Either the feature or a solution to the root problem would be welcome!
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 16089 Posts
  • 2530 Reply Likes
Yup. I appreciate your workflow description as well. Even though your suggested implementations were different it seemed like you guys were trying to solve similar workflow problems so I grouped them together to better garner support.
Photo of Armaan Ahluwalia

Armaan Ahluwalia

  • 6 Posts
  • 0 Reply Likes
Have a way to link or unlink all layers in a group to their masks with the click of button.

The need for this arises out of layers moving independent of their masks when you move a group. I have yet to find a use-case where I've wanted to move layers in a group but NOT their masks as well. Could you please make moving a group move everthing inside it including masks even if they are not linked! Or perhaps temporarily show them as linked during the move.

This reply was created from a merged topic originally titled
Link masks while moving Layers / Link-Unlink all layers in a group button.
Photo of Haim Azoulay

Haim Azoulay

  • 5 Posts
  • 2 Reply Likes
I agree with everyone here,
I run into this problem every time, when working on complicated files with more then 300 layers, it's very exhausting to link or unlink layers one by one.

you can add an "unlock for all links" (or lock) toggle button next to the layer lock icon.
Photo of Roman_the_Finisher

Roman_the_Finisher

  • 37 Posts
  • 0 Reply Likes
Is there any development in regards to this Jeffrey?
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
I was going to post this under being a bug. Is there a reason it's not posted there?
This is the way it works in AfterEffects. As the definition of a group, shouldn't everything in it move/scale when you move an object's parent? It sounds a whole lot like someone just plain messed up.

I can see how you might want an object, occasionally, to have a mask that is completely separate from the movement of all it's parents, but that is more likely rare. In AE you can choose an object to be a mask, then link that object to it's Actual parent layer, then move everything as a group, etc. Not so much in photoshop. I really wish they would get all of those software developers together so I don't have to constantly run back and forth. If they knew how I use their software they would probably laugh at how many loops I have to jump through in order to do what Could be a simple task.
ooops, little rant there.

anyway, this belongs in the bug section. If I don't see a response soon I might post it there as well.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
This is not a bug, and posting a duplicate topic would just get it merged back to this existing topic.

There are many reasons for grouping layers, and only a small percentage of those means that you require a parent/child relationship among the layers.

Needing masks that are not linked to the layer content is actually rather common, even if you do not use them that way in your work.

This is also a simple task in Photoshop: link or unlink masks as needed, and select the layers that you want to transform together.
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
If it is only a small percentage, then I am Very surprised that I couldn't find one bit of information on the internet suggesting a way to use groups that does not involve a child/parent relationship for groups under the layers. And Like I mentioned, all other products in the suite I have, from Adobe, uses groups in a parent child relationship. This is actually the only case I've ever seen in an Adobe product that avoids using the group as a parent. And it's not the entire layer, it's only one element, which can't be linked to something else without using scripting.

I am aware using masks that aren't linked to a layer is common. I do it all the time. But if I put the layer And mask in a group, I expect both to move. I can't think of many reasons I wouldn't expect that. I might want something in the background to always come through. But if I move the group, the mask would move as well. If I want a specific part of the image Behind the entire group to come through, then only masking one layer wouldn't even help. That mask should be applied to the actual group itself at that point, with the link turned off. Leaving it on one layer wouldn't even make sense. Although, since you can't use a group as a clipping mask I suppose maybe that's the only way in Photoshop.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
If your layer and mask are separate layers, then they are separate objects and only move together if you select both to move.
If it is a mask on a layer, then it normally moves with the layer, but can be unlinked for the many cases where you don't want them transforming together.

Again, this is not a bug - this is just your lack of experience with the suite products.
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
The concern here, is Not what you seem to be focusing on. And your final comment is quite unprofessional for an Adobe employee.

The concern is not that a layer and mask move independently. Since we have all come across this, you can come to the conclusion that we all intended to unlink those at one point. But as you said, you have to select the layer and the mask to move them.

The general assumption is that grouping an object allows you to select the group, which selects everything within that group.
I'm also interested in how you "select both to move," as you say. The Only way I'm getting both to move is if I temporarily link them back together.

I feel that instead of looking at the user's point of view, you are defending your actions which is not productive at all. If you are going to defend your actions then provide a stronger defense. Saying, "it is the way it is because it's correct and you are wrong," doesn't really help anyone now does it? I think most people, obviously not all, are open to learning but you'll have to provide more information than just telling us we are wrong, or have a lack of experience.

So please, provide some valuable examples of why the link is how it is, or look at it from a different point of view. I can tell you One valid benefit to moving along with the group would be better interoperability with after effects. Without scripting, it is not possible to unlink one object from a group in AE. So opening a photoshop composition in AE will currently change how it works. I'm not saying it's right, because I'm open to your examples, but that helps show one side of why users may expect different results.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
>> The general assumption is that grouping an object allows you to select the group, which selects everything within that group.

Which would be an incorrect assumption in many cases.
You are incorrectly attempting to equate UI organization and compositing organization with parent-child relationships. That's like equating the position of car dealers on the street with their ownership -- in a few cases there might be a relation, but overall there is none.

Layer Groups != Grouped Objects

I am looking at this from a user's perspective: but I look at it from the perspective of many users, across many products.
You are looking at it from only your particular perspective, with bad assumptions.
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
I'm not sure I follow your car dealer example, but I'm sure it makes sense to computer scientists.

Also doesn't your equation say that layer groups never equal grouped objects?

Anyway, you're assuming I didn't post this question elsewhere, and you're ignoring that other people brought this up as well. So Some users, at least, are confused by how it works.

Perhaps an example is in order? I still can't come up with any example for why you would translate a group of layers, but not the layer masks. I'm sure I'm missing a function of masks though. So please provide an example. Maybe a different solution is needed.

Here's how I would solve the issue I'm having here:
First ask, how do I most efficiently move multiple layers along with their masks?
Now figure out the most efficient method.
Now ask, "could that be improved?"
If yes, then it should be put on a list for improvement and solutions should be explored.

The only way I'm seeing how to do this currently is to link all of the masks back to their layers. If some are to remain linked in the end you'll have to add another step for keeping track of which to move back. Move all of the layers, then switch the masks back to unlinked.

I still don't see any reason that grouping a layer shouldn't move it's contents. You have failed to provide a legitimate example of that. But let's pretend you came up with that and it made sense to keep it that way. It is Still not efficient to move multiple layers at once with their masks. So maybe find a solution such as allowing the users to select both the layer And mask at the same?

I'm not complaining Just because I don't seem to get along with you. I'm trying to help come up with a solution. So let's get past this and figure out what each person is saying. Maybe read the full post. Let me know what you don't understand, and pretend that I'm making sense if you don't understand what I'm saying. That way I can more properly illustrate where I'm seeing a problem, hopefully in terms that you are more familiar with.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
When the mask and the layer content are not directly related (like when the mask defines the shape, and the pixels are a scanned texture) - you move one and not the other. Again, this is a pretty common task.
Only when they're tightly related (like a green screen extraction) do you move the content and mask together).

You move multiple layers with their masks by selecting the layers you want to move, and moving them. If you don't want to move the masks, you turn off the link between the mask and pixel content. If you are linking and unlinking a lot - yes, it could get confusing - but that's your workflow choice.

Again, you're confusing grouping for compositing and UI presentation with parent-child relationships: and they are different things.

You're trying to solve a non-problem, or a problem of your own workflow's creation.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
The original request might help your workflow, or a script as suggested by Jeff.
Photo of Armaan Ahluwalia

Armaan Ahluwalia

  • 6 Posts
  • 0 Reply Likes
The original problem occurred when trying to find a way to move all layers within a group along with their masks.

My suggested solution to the problem was that one provides a way to temporarily toggle all masks within a group to being linked with their layers and then be able to toggle back. ( Similar to how Alt + Click ) provides that option when clicking the icon.

Ideally this modifier would be on the move function itself however it could well be a modifier while clicking some kind of icon on the group.

Some key things about this feature request -

1) A significant proportion of Photoshop users require this feature. Therefore the argument that not ALL users require it does not diminish the need for a solution within Photoshop.

2) There is already an alternative method to moving layers along with only masks which are linked to them. This can be done by selecting all the layers within a group and moving them.

Given that there currently exist two different ways to achieve moving layers along with only linked masks and no way of moving all layers within a group along with their masks, one could argue that one of these ways could well be used towards the latter.

Since selecting a group and having the masks move along with it makes intuitive sense ( when selecting an entity as a whole on expects its internal relations to stay the same ) - it is this method that should be used to solve the issue.
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
Well said Armaan. I totally agree with you. Just because not everyone needs a feature does not mean it should be ignored. Not everyone needs the vanishing point tool. That doesn't mean it shouldn't be improved with things like antialiasing (it currently has none).
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 838 Reply Likes
Nothing is being ignored here.
All I've done is try to explain the faults in your reasoning (not a bug, not parent-child, not always wanted, etc.)
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
Right, but without any explaining other than "you don't always want them linked," it's difficult to imagine why.
It's good to know it's not being ignored, but with what you were saying it's hard to believe you are understanding the need, so will most likely not come up with the best solution for everyone. That's why I wanted to know how others were using the feature.
Of course, since I have a "lack of experience," I wouldn't be expected to know enough about user interaction with the software to be useful. :/
Photo of Armaan Ahluwalia

Armaan Ahluwalia

  • 6 Posts
  • 0 Reply Likes
Chris - did you read my comment? What are your thoughts on it?
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 146 Reply Likes
This should unlink all user/vector masks when run, if run with the shift key pressed all user/vector masks will be linked.
Photoshop CS5 or better....


#target photoshop
main();
function main(){
if(!documents.length) return;
var maskedLayers = getNamesPlusIDs();
if (ScriptUI.environment.keyboardState.shiftKey){
for(var a in maskedLayers){
var isUserMask =false;
if(maskedLayers[a][2] == 'true') isUserMask = true;
linkUnlinkMask(Number(maskedLayers[a][0]),true,isUserMask);
}
}else{
for(var a in maskedLayers){
var isUserMask =false;
if(maskedLayers[a][2] == 'true') isUserMask = true;
linkUnlinkMask(Number(maskedLayers[a][0]),false,isUserMask);
}
}
};
function linkUnlinkMask(ID,link,userMask) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), ID);
desc.putReference( charIDToTypeID('null'), ref );
var desc2 = new ActionDescriptor();
if(userMask){
desc2.putBoolean( charIDToTypeID('Usrs'), link);
}else{
desc2.putBoolean( stringIDToTypeID('vectorMaskLinked'), link );
}
desc.putObject( charIDToTypeID('T '), charIDToTypeID('Lyr '), desc2 );
executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
function getNamesPlusIDs(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
var Names=[];
try{
activeDocument.backgroundLayer;
var i = 0; }catch(e){ var i = 1; };
for(i;i<count;i++){
if(i == 0) continue;
ref = new ActionReference();
ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
var desc = executeActionGet(ref);
var layerName = desc.getString(charIDToTypeID( 'Nm ' ));
var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
if(layerName.match(/^<
#target photoshop
main();
function main(){
if(!documents.length) return;
var maskedLayers = getNamesPlusIDs();
if (ScriptUI.environment.keyboardState.shiftKey){
for(var a in maskedLayers){
var isUserMask =false;
if(maskedLayers[a][2] == 'true') isUserMask = true;
linkUnlinkMask(Number(maskedLayers[a][0]),true,isUserMask);
}
}else{
for(var a in maskedLayers){
var isUserMask =false;
if(maskedLayers[a][2] == 'true') isUserMask = true;
linkUnlinkMask(Number(maskedLayers[a][0]),false,isUserMask);
}
}
};
function linkUnlinkMask(ID,link,userMask) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), ID);
desc.putReference( charIDToTypeID('null'), ref );
var desc2 = new ActionDescriptor();
if(userMask){
desc2.putBoolean( charIDToTypeID('Usrs'), link);
}else{
desc2.putBoolean( stringIDToTypeID('vectorMaskLinked'), link );
}
desc.putObject( charIDToTypeID('T '), charIDToTypeID('Lyr '), desc2 );
executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
function getNamesPlusIDs(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
var Names=[];
try{
activeDocument.backgroundLayer;
var i = 0; }catch(e){ var i = 1; };
for(i;i
Photo of happyPants

happyPants

  • 10 Posts
  • 0 Reply Likes
I think what we were looking for was a way to transform multiple layers and masks without changing the structure. If half my masks are linked, and half are not, this script would still require you to go through 1 by 1 and find the layers needing linked masks after you have translated them.

The script would first need to record the current state of each layer. Change all to linked, then when the translation is complete, change all layers back to their original states.
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 146 Reply Likes
I have had a look and found it could be done for user masks but not for vector masks as the 'vectorMaskLinked' key can be set but not read, unless Jeffery knows different?
Photo of Roman_the_Finisher

Roman_the_Finisher

  • 37 Posts
  • 0 Reply Likes
Hi Jeffrey, is there any development bout this issue?