Import 3dlut file

hi, is there any way to import 3d lut file? i also tried with alchemist but the generated code doesn’t work.

Can you share the generated code you tried to use?

1 Like

const batchPlay = require(“photoshop”).action.batchPlay;

const result = await batchPlay(
[
{
“_obj”: “make”,
“_target”: [
{
“_ref”: “adjustmentLayer”
}
],
“using”: {
“_obj”: “adjustmentLayer”,
“type”: {
“_class”: “colorLookup”
}
},
“_isCommand”: true,
“_options”: {
“dialogOptions”: “dontDisplay”
}
},
{
“_obj”: “set”,
“_target”: [
{
“_ref”: “adjustmentLayer”,
“_enum”: “ordinal”,
“_value”: “targetEnum”
}
],
“to”: {
“_obj”: “colorLookup”,
“lookupType”: {
“_enum”: “colorLookupType”,
“_value”: “3DLUT”
},
“name”: “H:\red.cube”,
“profile”: {},
“LUTFormat”: {
“_enum”: “LUTFormatType”,
“_value”: “LUTFormatCUBE”
},
“LUT3DFileData”: {},
“LUT3DFileName”: “H:\red.cube”
},
“_isCommand”: true,
“_options”: {
“dialogOptions”: “dontDisplay”
}
}
],{
“synchronousExecution”: false,
“modalBehavior”: “fail”
});

thanks

In cep you could import this code, to apply a lut, is there an equivalent?

function fixskin(){

var idsetd = charIDToTypeID( "setd" );
var desc736 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
    var ref363 = new ActionReference();
    var idAdjL = charIDToTypeID( "AdjL" );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref363.putEnumerated( idAdjL, idOrdn, idTrgt );
desc736.putReference( idnull, ref363 );
var idT = charIDToTypeID( "T   " );
    var desc737 = new ActionDescriptor();
    var idlookupType = stringIDToTypeID( "lookupType" );
    var idcolorLookupType = stringIDToTypeID( "colorLookupType" );
    var idthreeDLUT = stringIDToTypeID( "3DLUT" );
    desc737.putEnumerated( idlookupType, idcolorLookupType, idthreeDLUT );
    var idNm = charIDToTypeID( "Nm  " );
    desc737.putString( idNm, "skin.3dl" );
    var idprofile = stringIDToTypeID( "profile" );
    desc737.putData( idprofile, String.fromCharCode( 0, 1, 111, 156, 65, 68, 66, 69, 2, 16, 0, 0, 108, 105, 110, 107, 82, 71, 66, 32, 82, 71, 66, 32, 7, 228, 0, 9, 0, 12, 0, 15, 

0, 41, 0, 36, 97, 99, 115, 112, 65, 80, 80, 76, 0, 0, 0, 0, 110, 111, 110, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 246, 214, 0, 1, 0, 0, 0, 0, 211, 45, 65, 68, 66, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 3, 100, 101, 115, 99, 0, 0, 0, 168, 0, 0, 0, 97, 112, 115, 101, 113, 0, 0, 1, 12, 0, 0, 0, 12, 65, 50, 66, 48…ecc…ecc…ecc
) );
var idLUTFormat = stringIDToTypeID( “LUTFormat” );
var idLUTFormatType = stringIDToTypeID( “LUTFormatType” );
var idLUTFormatthreeDL = stringIDToTypeID( “LUTFormat3DL” );
desc737.putEnumerated( idLUTFormat, idLUTFormatType, idLUTFormatthreeDL );
var idLUTthreeDFileName = stringIDToTypeID( “LUT3DFileName” );
desc737.putString( idLUTthreeDFileName, “skin.3dl” );
var idcolorLookup = stringIDToTypeID( “colorLookup” );
desc736.putObject( idT, idcolorLookup, desc737 );
executeAction( idsetd, desc736, DialogModes.NO );
}

I still do not see documentation on how to work with raw data type in batchPlay therefore I couldn’t make it work in Alchemist since it records arrayBuffer but I had no luck playing arrayBuffer back.

Anyway, in options, you can turn it on to convert arrayBuffer into array so you can read the numbers from raw data type but generated code still won’t work.

Adobe: please document raw data type and how to play it back.

1 Like

I have a great esteem for you.you were great.
I hope that the situation will be rectified soon from adobe.
but I’m sure of it
Thanks

What about making an advanced profile from the lut and applying it with cr filter?

there are a lot of things you can do through the luts, for example specific masks based on hue and saturation.