Page 1 of 1

How load .cube-files via ExtendScript?

Posted: Tue Jun 06, 2017 11:24 am
by Dimatokis
I tried to grab the action with ScriptenListener, it turned out this

Code: Select all

// =======================================================
var idMk = charIDToTypeID( "Mk " );
var desc60 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref24 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
ref24.putClass( idAdjL );
desc60.putReference( idnull, ref24 );
var idUsng = charIDToTypeID( "Usng" );
var desc61 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var idcolorLookup = stringIDToTypeID( "colorLookup" );
desc61.putClass( idType, idcolorLookup );
var idAdjL = charIDToTypeID( "AdjL" );
desc60.putObject( idUsng, idAdjL, desc61 );
executeAction( idMk, desc60, DialogModes.NO );

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc62 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref25 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref25.putEnumerated( idAdjL, idOrdn, idTrgt );
desc62.putReference( idnull, ref25 );
var idT = charIDToTypeID( "T " );
var desc63 = new ActionDescriptor();
var idlookupType = stringIDToTypeID( "lookupType" );
var idcolorLookupType = stringIDToTypeID( "colorLookupType" );
var idthreeDLUT = stringIDToTypeID( "3DLUT" );
desc63.putEnumerated( idlookupType, idcolorLookupType, idthreeDLUT );
var idNm = charIDToTypeID( "Nm " );
desc63.putString( idNm, """My Name""" ); // displayed name
var idprofile = stringIDToTypeID( "profile" );
desc63.putData( idprofile, String.fromCharCode( 0, 0, 14, 228, 65, 68, 66, 69, 4, 0, ..........)) // long data

var idcolorLookup = stringIDToTypeID( "colorLookup" );
desc62.putObject( idT, idcolorLookup, desc63 );
executeAction( idsetd, desc62, DialogModes.NO );
In the code there is an incomprehensible data format obtained from my .cube file
How to achieve the same data format from my .cube-file?

Re: How load .cube-files via ExtendScript?

Posted: Wed Jun 07, 2017 7:13 am
by txuku
Bonjour

What exactly is this .cube-file???? :)

Re: How load .cube-files via ExtendScript?

Posted: Wed Jun 07, 2017 6:42 pm
by Dimatokis
This is a color lookup table. Used in the Photoshop "Lookup Color" Adjustment layer
https://en.wikipedia.org/wiki/3D_lookup_table

Re: How load .cube-files via ExtendScript?

Posted: Wed Jun 07, 2017 7:24 pm
by txuku
OK !

Thank you :)

Re: How load .cube-files via ExtendScript?

Posted: Sun Jun 11, 2017 2:13 am
by wasfiwasfi
check this please !
i think it might help:
https://forums.adobe.com/thread/2155292

Re: How load .cube-files via ExtendScript?

Posted: Wed Jun 14, 2017 7:35 am
by Dimatokis
Thank you. But in that thread there is no solution for the same reason

Re: How load .cube-files via ExtendScript?

Posted: Tue Jul 23, 2019 11:56 am
by dkyeah
Did you ever manage to find a solution to loading a cube or any other lut file using ExtendScript?