载入中...
搜索中...
未找到
ProcgenScriptEditorScriptBindings.cpp
浏览该文件的文档.
32ssq::Table loadModuleFromScript(const editor::ScriptBind& bind, ScriptProcgenScriptEditor* self, const std::string& uri,
39 bind.vm(), self->editor().loadModule(uri, id, displayName, kind, editor::toEditorValue(converted.value())));
46 auto procgenEditor = editor::addScriptClass<ScriptProcgenScriptEditor>(table, "ProcgenScriptEditor");
55 meshEditor.addFunc("observeRevision", [bind](MeshModifierEditor* self, const std::string& document, int revision) {
59 meshEditor.addFunc("getTargetId", [](MeshModifierEditor* self) { return self ? self->targetId() : std::string{}; });
60 meshEditor.addFunc("getActiveTool", [](MeshModifierEditor* self) { return self ? self->activeTool() : std::string{}; });
68 procgenEditor.addFunc("setInt", [bind](ScriptProcgenScriptEditor* self, const std::string& key, int value) {
69 return bind.checked(self, "procgen editor must not be null", [&] { return self->editor().setInt(key, value); });
71 procgenEditor.addFunc("setFloat", [bind](ScriptProcgenScriptEditor* self, const std::string& key, float value) {
75 procgenEditor.addFunc("setBool", [bind](ScriptProcgenScriptEditor* self, const std::string& key, bool value) {
84 procgenEditor.addFunc("publishPreview", [bind](ScriptProcgenScriptEditor* self, procgen::PointSet* points,
87 return self->editor().publishPreview(points, stage, static_cast<std::uint64_t>(expectedRevision));
96 "failPreview", [bind](ScriptProcgenScriptEditor* self, const std::string& message, int expectedRevision) {
101 procgenEditor.addFunc("selectStage", [bind](ScriptProcgenScriptEditor* self, const std::string& stage) {
102 return bind.checked(self, "procgen editor must not be null", [&] { return self->editor().selectStage(stage); });
109 return bind.checked(self, "procgen editor must not be null", [&] { return self->editor().setLive(enabled); });
111 editor::registerEditorHistory<ScriptProcgenScriptEditor>(procgenEditor, bind, "procgen editor must not be null");
112 procgenEditor.addFunc("isDirty", [](ScriptProcgenScriptEditor* self) { return self && self->editor().isDirty(); });
161 procgenEditor.addFunc("getParamChoice", [](ScriptProcgenScriptEditor* self, int paramIndex, int choiceIndex) {
173 procgenEditor.addFunc("getString", [](ScriptProcgenScriptEditor* self, const std::string& key) {
197 moduleClass.addFunc("createMeshModifier", [bind](ProcgenEditorModule*, const std::string& targetId) {
Squirrel adapter for the procgen script editor.
UI-neutral host for a script generator: schema params, undo, PointSet preview.
Composition model shared by project-specific developer and runtime editors.
Definition EditorWorkspace.h:43
Editor facade binder: common script::BindContext plus history/owned-create helpers.
Definition EditorScriptProjection.h:135
UI-neutral composition controller for modifier graph, spline, sculpt, UV-paint, merge,...
Definition MeshModifierEditor.h:17
const std::string & targetId() const noexcept
Definition MeshModifierEditor.h:28
procgen_editing::Result< void > observeRevision(std::string document, std::uint64_t revision)
Observe an externally owned document revision without copying its state.
Definition MeshModifierEditor.cpp:66
procgen_editing::Result< void > activateTool(editor::EditorWorkspace &workspace, std::string tool)
Activate graph, spline, sculpt, uvPaint, merge, or adhere and update semantic focus.
Definition MeshModifierEditor.cpp:45
Composition adapter for the script-hosted procgen generator editor.
Definition ProcgenEditorModule.h:16
EditorValue toEditorValue(const eve::Value &value)
Compatibility spelling for conversion into the authoring value tree.
Definition EditorProperty.h:29
ssq::Table project(HSQUIRRELVM vm, const eve::Result< void > &result)
Project a completed editing result that has no payload.
Definition EditorScriptProjection.h:28
Definition MeshModifierEditor.cpp:7
void exposeProcgenScriptEditorScriptBindings(ssq::Table &table, ssq::Class &moduleClass)
Expose the script-owned ProcgenScriptEditor factory on ProcgenEditorModule.
Definition ProcgenScriptEditorScriptBindings.cpp:44
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:454
Result< Value > valueFromSquirrel(HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options)
Convert one Squirrel value into the canonical owning Value tree.
Definition SquirrelBinding.cpp:342
@ InvalidArgument
Definition Container.h:602