Home Technical Talk

psMaskSync (Photoshop Script)

passerby
polycounter lvl 12
Offline / Send Message
passerby polycounter lvl 12
Here is a quick little script I made for Photoshop. The script is designed to make working with masks in multiple layers much easier. What it does it sync the mask on the currently selected layerSet to the masks of all layerSets that share the same name.

I find this makes it very easy for me to work with PBR materials in Photoshop, since I can make a layerSet for a material like copper, in my Albedo, Roughness, and Metallic maps define the material with in all of those groups. Than once I want to blend that new material into my textures, I can paint on the mask of only one of its layer groups, and use the script to quickly transfer the mask between layer groups.

I have also included a helper script, to make the creation of layerSets for materials easier, and to simplify the naming process for this script.

Download

SourceCode(GitHub)

I have only been able to test for Photoshop CS6, since that is the only one i own. But I think it should work back as far as cs4. I would greatly appreciate it if people would test for CS4, CS5 and CC and get back to me.

If any bugs are found please let me know on this topic, or create a issue on the scripts github page.

Replies

  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    Will give you some feedback in the next couple of days - whenever I actually get to texure something at work again ;-)

    Thanks for the script, it'll fit into our workflow nicely I hope!
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    Thanks, let me know how it works, i only have been able to test in cs6 sofar
  • ScoobyDoofus
    Offline / Send Message
    ScoobyDoofus polycounter lvl 19
    I'm on CC, installed the .zxp via CC Extension manager, but nothing shows up in my "Window\Extensions" but Adobe Exchange and Kuler.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    its in the file>scripts menu, shows that in the readme.

    Photoshop is the only adobe app i own, so as a result i cant build extension pallets, since i don't have flash and flashbuilder. So im just using the extension installer as a easy way to package things.

    you can run it directly from the file > and scripts menu, and there is also a little helper function in there, that installs it to the actions pallet for you as well.
  • ScoobyDoofus
    Offline / Send Message
    ScoobyDoofus polycounter lvl 19
    The readme is in a .md format...what the heck is that?

    Ok, so got it to sync layerset masks, which is great.
    This works based upon the LayerSet name correct? Sync Selected brings up a list of the current layersets...but if they've got the same name, how do you differentiate them as the user?

    The Create Material does nothing for me.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    I will make a video explaining tomorrow.
    The way i setup my layer-groups is by having my top level groups be for my

    Albedo, roughness, and metallic You can use any naming scheme you want.

    Once you create those, if you go to create material, and give it a name, it will make a layerset underneath each those top level groups.

    When you use sync all, use you it with a group with a mask selected, and it will find all other groups with the same name, and sync the mask to those.

    Thinking i will make some changes, so it dosnt ignore the top level groups, but for performance reasons i don't think i will make it work on all layers ever, just on groups.

    *.md stand for markdown its a markup language that looks like plain text. I just use it because it can be read perfectly fine as plain text, and it also can be read by the syntax highlighter on github to provide a styled readme.
  • [Deleted User]
    Works perfectly. Only wish it worked on layers as well :)
    e.g. Rust layer mask synced with albedo/metal/roughness etc. rather than a group of groups.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    ya i will looking into that at somepoint in the future, currently it might be a little slow on large documents if it had to search for all layers.

    But ya, i have to agree the current set-up is kinda rigid in how it works, and really based around my workflow and not much else.
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    Quick feedback: works great on CS5. Will have a colleague test CS4 next week!
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    Thanks cs4 is the one I'm worried about since I know the api has changed a little since than, and I'm not going to even try and support anything before it
  • Pedro Amorim
    Works perfectly on CS6 :)
    Thanks for sharing!
  • c.buliarca
    Offline / Send Message
    c.buliarca polycounter lvl 9
    This is a great script, thank you for sharing!! One think that can be great for it would be to work on solid colors or layers as well, and also it could be run with a panel where you can check the main groups you want to update. I think it would be more interactive this way.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    ya can look into that, cant do much with panels since i don't got flash builder and extension builder, so if i make one it would be static.

    Also the sync selective script, asks you which groups to sync in.

    But what i wont to do in the future, is make it work on all layer types, and to make the sync selective save its settings in the doc so you dont have to bring up the UI every time for it.
  • c.buliarca
    Offline / Send Message
    c.buliarca polycounter lvl 9
    That's a good idea to save the settings in the doc. I am looking forward for it.

    Actually you don't need to have flash builder or flash professional, to create panels you can manage to create flex panels with FlashDevelop, CSXInterface library and Flex 3.6 sdk all these are free.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    c.buliarca wrote: »
    That's a good idea to save the settings in the doc. I am looking forward for it.

    Actually you don't need to have flash builder or flash professional, to create panels you can manage to create flex panels with FlashDevelop, CSXInterface library and Flex 3.6 sdk all these are free.


    Nice i wasn't aware of that, so can make a fully interactive panel? And like configurator would i need to build for every PS version?
  • c.buliarca
    Offline / Send Message
    c.buliarca polycounter lvl 9
    there are some differences with cs4, so you can build separately for that and the cs5, cs6 and cc will work with the same swf.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    Thanks, figured a lot out, but still cant get the panels to look like proper cs6 ones, also from the jsx in the panel is there a way to #include my jsinc files from photoshops script directory?
  • c.buliarca
    Offline / Send Message
    c.buliarca polycounter lvl 9
    I've had a bit of time, and I've made very fast a small panel that will check every 1 second to list the main groups in the current document. How I see it is like this,
    every time the user selects a group in the panel it will update the document metadata with an array containing the names of the groups selected in the panel, and when the user chose to create the materials or set the masks, your script first will first look into the metadata to take the groups selected than it will run the script for that groups.

    The metadata pat is not implemented now, this is for you to see if you like this kind of panel and interaction for your script.

    http://www.buliarca.net63.net/tools/photoshop/PsSinkMasks.rar

    Also if you want I can help you with the panel :) On my spare time. Or I can sent you the FlashDevelop project for it.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    Thanks, im starting to get a handle on how the whole thing works now, just creating a style for UI elements to look more like adobe CS stuff. Which it seems i can only edit some of that in the css and cant really change stuff attached to the mx.skins.halo
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    Would it also be possible to optionally sync the layer content itself between layers. Copy not only the layer mask but also the layer content (optionally). This is useful when you have layers with the same content in multiple layer groups for different maps NM/DM/GM/SM... . These layers can have different 'Layer styles' (colors, shadows, glows) that they retain but the layer content and or mask of the layers are synced. So when you draw details on one layer you can sync the layer content and or mask with the other layers but retain the layer styles.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    I wasnt thinking about layer styles, but ya after im off my current contract im thinking of getting back to this, and making it work for all layers, and letting it copy content as well as masks.
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    That could make this script even more useful! Actually, Ddo from Quixel uses layer styles in a similar fashion. They create Material layers and inside them they have layers for effects. These layers each have different layer styles for the different maps DM/NM/SM/GM... But the layer content and the mask of these layers are the same and can be updated. Till now I have to manually search for the name of these layers and use a PS action to replace (copy/paste) the layer content and layer mask on each layer by hand. It works ok, but a script would be much nicer :-).
  • Eric Chadwick
  • CreativeSheep
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    passerby - You never created a video on how this tool works, I'm a little perplexed on it's usage ?
Sign In or Register to comment.