Fix plugins

This commit is contained in:
luboslenco
2024-01-21 09:53:08 +01:00
parent 0e8b6ec05b
commit f9f4282f39
15 changed files with 107 additions and 194 deletions
-1
View File
@@ -168,7 +168,6 @@ class Base {
Base.defaultElementH = Base.uiMenu.t.ELEMENT_H;
// Init plugins
Plugin.init();
if (Config.raw.plugins != null) {
for (let plugin of Config.raw.plugins) {
Plugin.start(plugin);
-86
View File
@@ -1,5 +1,4 @@
// @:keep
class Plugin {
static plugins: Map<string, Plugin> = new Map();
@@ -18,22 +17,6 @@ class Plugin {
Plugin.plugins.set(this.name, this);
}
static init = () => {
// let api = arm;
///if (is_paint || is_sculpt)
// api.ParserMaterial = ParserMaterial;
// api.NodesMaterial = NodesMaterial;
// api.UIView2D = UIView2D;
// api.UtilRender = UtilRender;
///end
///if is_paint
// api.UtilUV = UtilUV;
///end
///if is_lab
// api.BrushOutputNode = BrushOutputNode;
///end
}
static start = (plugin: string) => {
try {
Data.getBlob("plugins/" + plugin, (blob: ArrayBuffer) => {
@@ -56,82 +39,13 @@ class Plugin {
}
}
// @:keep
class Keep {
static keep = () => {
return [
ArmPack.decode,
ArmPack.encode,
UIBox.showMessage
];
}
}
///if is_lab
// @:keep
class KeepLab {
static keep = () => {
let a = Base.uiBox.panel;
return [a];
}
}
///end
// @:expose("core")
class CoreBridge {
// static Image = Image;
// static System = System;
static colorFromFloats = (r: f32, g: f32, b: f32, a: f32): Color => {
return color_from_floats(r, g, b, a);
}
}
// @:expose("iron")
// class IronBridge {
// static App = App;
// static Scene = Scene;
// static RenderPath = RenderPath;
// static Time = Time;
// static Input = Input;
// static ArmPack = ArmPack;
// static BaseObject = BaseObject;
// static Data = Data;
// }
// @:expose("zui")
// class ZuiBridge {
// static Handle = Handle;
// static Zui = Zui;
// }
// @:expose("console")
class ConsoleBridge {
static log = Console.log;
static error = Console.error;
}
// @:expose("arm")
// class ArmBridge {
// static Base = Base;
// static Config = Config;
// static Context = Context;
// static History = History;
// static Operator = Operator;
// static Plugin = Plugin;
// static Project = Project;
// static Res = Res;
// static Path = Path;
// static File = File;
// static NodesBrush = NodesBrush;
// static ParserLogic = ParserLogic;
// static UIBase = UIBase;
// static UINodes = UINodes;
// static UIFiles = UIFiles;
// static UIMenu = UIMenu;
// static UIBox = UIBox;
// static UtilMesh = UtilMesh;
// static Viewport = Viewport;
// ///if (krom_direct3d12 || krom_vulkan || krom_metal)
// static RenderPathRaytrace = RenderPathRaytrace;
// ///end
// }