Copy link to clipboard
Copied
Hello everybody !
For a long time I tried a foreign script that inserted a picture into a new layer with a mask (I found such examples on this site), then the mask was automatically made translucent and the user could transform the image at his discretion, the mask was unlinked. Then pressing Enter, the mask became normal and was linked to the layer.
I really can not understand the idea of how this was realized. Who has any thoughts and thoughts on this issue? Better the DOM, but but possible an ActionScript
Thanks !
Copy link to clipboard
Copied
Post that script...
Copy link to clipboard
Copied
I don't remeber where has it
Copy link to clipboard
Copied
What was that mask, some shape, opactity etc? Why that was needed, is that something you created to apply to your layers?
Copy link to clipboard
Copied
In my free photo collage toolkit the is and interactive Populate Collage script. The script highlight the area to be populated in the collage template. Then put you into an image file selection dialog where you select the image file you want to place into that area. Once you select the image file the script places the images into the template. Resize the image to fill the area and positions the image over the area and mask the smart object layer to that size and shape. The layer mask is unlinked and then the script puts you into an interactive transform command so you can adjust the smart object layers associated transform you can tweak the image composition add rotation and warp. Many time the will be no DOM support for what you want to script so you will need to use some action manager code in your scripts. Action manager code runs faster than DOM code.
http://www.mouseprints.net/old/dpr/InteractivePopulate.html
Photo Collage Toolkit
Photoshop scripting is powerful and I believe this package demonstrates this here is a video showing a 5 image collage PSD template being populated with images
The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
There are fifteen scripts in this package they provide the following functions:
Copy link to clipboard
Copied
main()
function main()
{
try {
link_mask(false);
select_layer_rgb();
var den = app.activeDocument.activeLayer.layerMaskDensity;
app.activeDocument.activeLayer.layerMaskDensity = 50;
transform();
//menu("freeTransform");
app.activeDocument.activeLayer.layerMaskDensity = den;
link_mask(true);
}
catch(e) { alert(e); }
}
/////////////////////////////////////////////
function link_mask(state)
{
try {
var r = new ActionReference();
r.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));
var d = new ActionDescriptor();
d.putReference( charIDToTypeID( "null" ), r );
var d2 = new ActionDescriptor();
d2.putBoolean( charIDToTypeID( "Usrs" ), state );
d.putObject( charIDToTypeID( "T " ), charIDToTypeID( "Lyr " ), d2 );
executeAction( charIDToTypeID( "setd" ), d, DialogModes.NO );
}
catch(e) { throw(e); }
}
/////////////////////////////////////////////
function select_layer_rgb()
{
try {
var r = new ActionReference();
r.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "RGB " ) );
var d = new ActionDescriptor();
d.putReference( charIDToTypeID( "null" ), r );
d.putBoolean( charIDToTypeID( "MkVs" ), false );
executeAction( charIDToTypeID( "slct" ), d, DialogModes.NO );
}
catch (e) { throw(e); }
}
/////////////////////////////////////////////
function menu(str)
{
try {
var r = new ActionReference();
r.putEnumerated( charIDToTypeID( "Mn " ), charIDToTypeID( "MnIt" ), stringIDToTypeID(str) );
var d = new ActionDescriptor();
d.putReference( charIDToTypeID( "null" ), r );
executeAction( charIDToTypeID( "slct" ), d, DialogModes.ALL );
}
catch (e) { beep() }
}
/////////////////////////////////////////////
function transform(linked)
{
try {
if (linked == undefined) linked = true;
var r = new ActionReference();
var d1 = new ActionDescriptor();
var d2 = new ActionDescriptor();
var ret = true;
try {
r.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
d2.putUnitDouble( charIDToTypeID( "Hrzn" ), charIDToTypeID( "#Rlt" ), 0 );
d2.putUnitDouble( charIDToTypeID( "Vrtc" ), charIDToTypeID( "#Rlt" ), 0 );
d1.putReference( charIDToTypeID( "null" ), r );
d1.putEnumerated( charIDToTypeID( "FTcs" ), charIDToTypeID( "QCSt" ), charIDToTypeID( "Qcsa" ) );
d1.putObject( charIDToTypeID( "Ofst" ), charIDToTypeID( "Ofst" ), d2 );
d1.putUnitDouble( charIDToTypeID( "Wdth" ), charIDToTypeID( "#Prc" ), 100 );
d1.putUnitDouble( charIDToTypeID( "Hght" ), charIDToTypeID( "#Prc" ), 100 );
d1.putBoolean( charIDToTypeID( "Lnkd" ), linked );
d1.putEnumerated( charIDToTypeID( "Intr" ), charIDToTypeID( "Intp" ), charIDToTypeID( "Bcbc" ) );
executeAction( charIDToTypeID( "Trnf" ), d1, DialogModes.ALL );
}
catch(e) { ret = false; }
return ret;
}
catch (e) { throw(e); }
}
Copy link to clipboard
Copied
Well done good work..
Copy link to clipboard
Copied
I agree with JJMack
a great job
AndreyLarush
Why do not you say it as an exact answer?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now