Can't access to functions in external files anymore?
-
Another weird thing:
I cannot access functions in an included helper file anymore (like the remap function below) although I can access to constants within the same helper namespace...
Interface: The product is successfully unlocked. Interface:! SpectrumAnalyser.js (100): Unknown function 'remap' {SW50ZXJmYWNlfFNwZWN0cnVtQW5hbHlzZXIuanN8MzE4MXwxMDB8MjM=} Align-IT:! SpectrumAnalyser.js (100): Unknown function 'remap' {SW50ZXJmYWNlfFNwZWN0cnVtQW5hbHlzZXIuanN8MzE4MXwxMDB8MjM=} Interface: CustomLAF.js (113): Unknown function 'remap' {SW50ZXJmYWNlfEN1c3RvbUxBRi5qc3wyNDI0fDExM3wyMw==}
Simplified code looks like this:
include("../../_SCRIPTS/helper.js"); var x = helper.remap(0, 1, 0, 50, value);
Simplified helper file:
namespace helper { const var constantExample = 20; // Remap inline function remap(inMin, inMax, outMin, outMax, value) { local t = invLerp(inMin, inMax, value); return lerp(outMin, outMax, t); } }
-
@ustk Did you include
helper.js
before the other scripts? -
@d-healey Yep it's top in my onInit script
-
@ustk Oh don't use relative paths. Use the
{PROJECT_FOLDER}
wildcard (or the global scripts one). -
@d-healey And it always worked before, as I'm coming back on my projects, nothing has changed since then.
So my guess is that Hise has more security maybe that prevents a few older things to work...? -
@d-healey You mean duplicating my helper in the project's folder? Because I like having only one I can reference from all projects...
-
Because I like having only one I can reference from all projects...
That's what the global scripts folder is for. https://docs.hise.audio/working-with-hise/settings/development.html#global-script-path
I made a video about it, currently on Patreon.
-
@d-healey Oh yes of course I'll use that then. I never did because I reckon it was broken at the beginning so I totally forgot it... Cheking this solution ;)
-
@d-healey That did it!
So Hise certainly was more permissive before... -
U ustk marked this topic as a question on
-
U ustk has marked this topic as solved on