Run Python scripts like python file.py, with the whole plugin API

This commit is contained in:
SoftFever committed 2026-11-03 16:12:04 +08:00
1 parent 99018203de
commit cc05d87607
27 files changed
+3506 -549

No files matched your search

@@ -217,7 +217,6 @@ std::string resolved_slot_preset(PresetBundle& bundle, int slot_number)
void PresetTransaction::set(const std::string& key, const std::string& value)
{
host_bindings::require_plugin_caller("preset.PresetTransaction.set");
if (committed)
throw std::runtime_error("This preset transaction has already been committed; start a new begin_update()");
if (key.empty())
@@ -231,7 +230,6 @@ void PresetTransaction::set(const std::string& key, const std::string& value)
PresetUpdateResult PresetTransaction::commit()
{
host_bindings::require_plugin_caller("preset.PresetTransaction.commit");
if (committed)
throw std::runtime_error("This preset transaction has already been committed; start a new begin_update()");
if (type == Preset::TYPE_INVALID)
@@ -348,7 +346,6 @@ void bind_preset_target(Preset::Type type, const std::string& preset_name, Prese
// Blocking form used by begin_update() and update().
PresetTransaction begin_preset_update(Preset::Type type, const std::string& preset_name)
{
host_bindings::require_plugin_caller("preset.begin_update");
PresetTransaction transaction;
PluginHostUi::run_on_ui_thread([&] { bind_preset_target(type, preset_name, transaction); });
return transaction;
@@ -507,7 +504,6 @@ void bind_filament_target(int slot_number, const std::string& preset_name, Prese
// Blocking form used by begin_update() and update().
PresetTransaction begin_filament_update(int slot_number, const std::string& preset_name)
{
host_bindings::require_plugin_caller("preset.filament.begin_update");
PresetTransaction transaction;
PluginHostUi::run_on_ui_thread([&] { bind_filament_target(slot_number, preset_name, transaction); });
return transaction;
@@ -517,7 +513,6 @@ PresetTransaction begin_filament_update(int slot_number, const std::string& pres
// begin_update()/set()/commit() path, so targeting, selection, validation and commit are shared.
void update_edited_preset(Preset::Type type, const std::string& key, const std::string& value)
{
host_bindings::require_plugin_caller("preset.update");
PresetTransaction transaction = begin_preset_update(type, std::string());
transaction.set(key, value);
transaction.commit();
@@ -525,7 +520,6 @@ void update_edited_preset(Preset::Type type, const std::string& key, const std::
void update_filament_slot(int slot_number, const std::string& key, const std::string& value)
{
host_bindings::require_plugin_caller("preset.filament.update");
PresetTransaction transaction = begin_filament_update(slot_number, std::string());
transaction.set(key, value);
transaction.commit();
@@ -533,7 +527,6 @@ void update_filament_slot(int slot_number, const std::string& key, const std::st
void reload_local_bundle(const std::string& bundle_id)
{
host_bindings::require_plugin_caller("preset.bundles.reload_local");
bool reloaded = false;
std::string error;
PluginHostUi::run_on_ui_thread([&] {