We have a production workflow where all our plugins start in c++ code base.
Our current workflow is as follow
1.Rapid Development = c++ plugin creating
sScriptingSuite->CreateEngine(&engineRef);
We usually pass to it a string-string to execute and use return string as json object to read it result.
Our main usage of it is prototyping/development
2. C++ performance, once script is developed in method 1. if needed we convert it to pure c++ for speed.
With UPX there is no UPX engine that we can create in c++, is it possible now/in future to create UPX engine in c++ plugin where we can manage it, pass it code/for execution etc ?
We would like to add UPX as another option for rapid script development alongside javascript engine now. Is this possible?
I believe you meant UXP, not UPX. If so, UXP does support hybrid plugins in Photoshop. You can find more information about this in the ‘Hybrid Plugins’:
Please check that out and let me know if it addresses your requirements. If you have any further questions or need clarification, feel free to ask.
I don’t see anything resembling engine creation or script execution like in >
typedef struct {
/// Returns true if any of the published scripting engines is currently executing a script.
ASAPI ASBoolean (*ScriptIsRunning) ( void );
/// Creates a new instance of a JavaScript Engine.
ASAPI ASErr (*CreateEngine) ( JSEngineRef * engineRefPtr );
/// Disposes of a JavaScript Engine instance.
ASAPI ASErr (*DeleteEngine) ( JSEngineRef engineRef );
/** Set the default search path(s) for include files encountered in script files executed by
* an engine. This string contains all include directories, separated by the colon or the
* semicolon characters. **/
ASAPI ASErr (*SetIncludePath) ( JSEngineRef engineRef, const ASUnicode * includePath );
/** Get the default search path(s) for include files encountered in script files executed by
* an engine.
*
* buffSize size, in ASUnicode characters, of the includePathBuff being passed in.
* If get fails, buffSize will contain the required size for the buffer to contain the entire path string. **/
ASAPI ASErr (*GetIncludePath) ( JSEngineRef engineRef, ASUnicode * includePathBuff, long * buffSize );
/** Execute a JavaScript script
@param engineRef Engine with which to execute JavaScript script, acquired from CreateEngine.
@param script unicode text of the JavaScript script to be executed.
@param executionMode If kJSExecutionModeRun then the JavaScript is executed normally, if kJSExecutionModeDebug then the JavaScript is halted at the first line and the debugger Ui is shown
@param result Pointer to result of execution. If an execution error occured, the returned string will contain error information.
@returns kSPNoError Success. kJSScriptExecutionError Additional information available in result string.
**/
ASAPI ASErr (*ExecuteScript) ( JSEngineRef engineRef,
const ASUnicode * script,
JavaScriptExecutionMode executionMode,
const ASUnicode ** result );
//@}
///@name New in 12.0 version 2 of the suite
//@{
/// Creates a new instance of a JavaScript Engine with an APE reference for High Bandwidth API
ASAPI ASErr (*CreateEngineAPE) ( JSEngineRef * engineRefPtr, intptr_t apeEngineRef );
} JSScriptingSuite2;
So as it stands, we can’t create UXP engine nor give it custom code as unicode, We don’t even need to create new engine, but we need to be able to give it custom code to execute directly.