Skip to content

Commit

Permalink
ynput#327: enhancement: Modification pour eviter un dict de corrélation
Browse files Browse the repository at this point in the history
  • Loading branch information
hfarre committed Mar 13, 2024
1 parent 8822d2f commit 8f275f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
Binary file not shown.
31 changes: 1 addition & 30 deletions openpype/hosts/photoshop/api/extension/host/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,43 +117,14 @@ function setBlendmode(layerName, blendModeName){
/**
* Sets blendMode 'blendModeName'<str> on a given 'layerName'<str>
**/
var blendModeDict= {};

blendModeDict["colorBurn"] = BlendMode.COLORBURN;
blendModeDict["colorDodge"] = BlendMode.COLORDODGE;
blendModeDict["darken"] = BlendMode.DARKEN;
blendModeDict["darkerColor"] = BlendMode.DARKERCOLOR;
blendModeDict["difference"] = BlendMode.DIFFERENCE;
blendModeDict["dissolve"] = BlendMode.DISSOLVE;
blendModeDict["blendDivide"] = BlendMode.DIVIDE;
blendModeDict["exclusion"] = BlendMode.EXCLUSION;
blendModeDict["hardLight"] = BlendMode.HARDLIGHT;
blendModeDict["hardMix"] = BlendMode.HARDMIX;
blendModeDict["hue"] = BlendMode.HUE;
blendModeDict["lighten"] = BlendMode.LIGHTEN;
blendModeDict["lighterColor"] = BlendMode.LIGHTERCOLOR;
blendModeDict["linearBurn"] = BlendMode.LINEARBURN;
blendModeDict["linearDodge"] = BlendMode.LINEARDODGE;
blendModeDict["linearLight"] = BlendMode.LINEARLIGHT;
blendModeDict["luminosity"] = BlendMode.LUMINOSITY;
blendModeDict["multiply"] = BlendMode.MULTIPLY;
blendModeDict["normal"] = BlendMode.NORMAL;
blendModeDict["overlay"] = BlendMode.OVERLAY;
blendModeDict["passThrough"] = BlendMode.PASSTHROUGH;
blendModeDict["pinLight"] = BlendMode.PINLIGHT;
blendModeDict["saturation"] = BlendMode.SATURATION;
blendModeDict["screen"] = BlendMode.SCREEN;
blendModeDict["softLight"] = BlendMode.SOFTLIGHT;
blendModeDict["subtract"] = BlendMode.SUBTRACT;
blendModeDict["vividLight"] = BlendMode.VIVIDLIGHT;

// search for the conresponding layer
var layer = _go_through_layers(layerName, app.activeDocument);
// if layer not found, raise an alert and stop
if (layer==null){
return alert("Error Occured, Layer Not Found");
}
layer.blendMode = blendModeDict[blendModeName];
layer.blendMode = eval('BlendMode.' + blendModeName.toUpperCase());
}

function _go_through_layers(layerName, parentLayer){
Expand Down

0 comments on commit 8f275f1

Please sign in to comment.