Hello! Total new guy here. I have an action that creates a document with a background layer and two layers above it. I would like to add an end step that creates a GUI with two sliders, each slider controlling the opacity of the 2 layers above the background layer, IE the first slider controls top layer opacity, second slider controls middle layer opacity. It would be ideal if this previews in real time as you move the sliders. Is this possible?
Thanks!
Zach
GUI with sliders that change opacity on multiple layers
-
- Posts: 1
- Joined: Fri Mar 09, 2018 7:41 pm
-
- Posts: 45
- Joined: Fri Nov 04, 2016 8:29 am
Re: GUI with sliders that change opacity on multiple layers
yes, by using a script that runs at the end of the action.
-
- Posts: 16
- Joined: Thu Oct 27, 2016 9:56 am
Re: GUI with sliders that change opacity on multiple layers
What you need can be found in this post
so no it is not possible.
This is a bit difficult to doIt would be ideal if this previews in real time as you move the sliders. Is this possible?
so no it is not possible.
-
- Posts: 45
- Joined: Fri Nov 04, 2016 8:29 am
Re: GUI with sliders that change opacity on multiple layers
it is possible !
check this out
this will change the opacity of the active layer, you can create two sliders and make them control the opacity of the required layers by pointing to these layers by index instead of app.activeDocument.activeLayer.opacity
good luck
check this out
Code: Select all
var dlg = new Window("dialog{text:'Script Interface',bounds:[100,100,561,269],\
iwtfkhamhc:EditText{bounds:[16,16,444.95,94] , text:'Your text goes here' ,properties:{multiline:false,noecho:false,readonly:false}},\
button0:Button{bounds:[17,102,117,122] , text:'Save' },\
button1:Button{bounds:[236,101,336,121] , text:'Cancel' },\
button2:Button{bounds:[345,101,445,121] , text:'Whatever' },\
slider0:Slider{bounds:[18,138,173,148] , minvalue:0,maxvalue:100,value:0},\
checkbox0:Checkbox{bounds:[190,133,261,154] , text:'Checkbox Text' },\
dropdown0:DropDownList{bounds:[299,134,443,149],properties:{items:['Select One']}}\
};");
dlg.slider0.onChanging = function (){
app.activeDocument.activeLayer.opacity = dlg.slider0.value;
}
dlg.show();
good luck