Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Pie Menu Editor 2.4 ドキュメント
Pie Menu Editor 2.4 ドキュメント

はじめる

  • インストール
  • 基本的なパイメニューの作成
  • 使用例とアイデア
    • コード例

エディタ

  • エディターの共通要素
  • Hotkey Mode
  • Pie Menu Editor
  • Vector Menu Editor
  • Regular Menu Editor
  • Pop-up Dialog Editor
  • Floating Panel Editor
  • Sticky Key Editor
  • Stack Key Editor
  • Macro Operator Editor
  • Modal Operator Editor
  • Property Editor
  • Property Stack Editor
  • Context Router Editor
  • Side Panel Editor
  • Hiding Unused Panels
  • Interactive Panels と Extend Panel
  • UI Customization
  • キャプチャーメニュー
  • カスタムアイコン
  • Settings

スクリプティング

  • コードの入力と実行
  • スクリプティングリファレンス
  • スクリプトの管理
  • 同梱ユーティリティー
  • Context Browser

オーサリング API

  • 概要
    • 基本事項
    • 結果とガード
    • メニュー
    • スロット
    • レイアウトの行とパネル
    • メニューの種類ごとの設定
    • ホットキー
    • Property
    • Property Stack
    • Context Router
    • 書き出しと検証
    • リソース
    • コード実行・ユーザープロパティ・identity
    • レシピ
      • パネルを1行ずつ組み立てる
      • Property Stack を作成して状態を表示する
      • 設定を Property のスイッチにする
      • Router の分岐を追加して条件を編集する
      • 子メニューへリンクし、アイコンのフラグを保つ

参考資料

  • キーマップの選び方
  • キーマップの重複
  • Poll Method
  • 用語集
  • 保存先とフォルダ構成
  • 起動オプション
  • 開発者オプション
  • ビデオチュートリアル

サポート

  • FAQ
  • 既知の問題
  • サポート
  • Change Log
🇺🇸 🇯🇵
Back to top
View this page

子メニューへリンクし、アイコンのフラグを保つ¶

既存のスロットを、新しいアイコン付きの子メニューへのリンクに変えます。 スロットのラベル、表示方法、アイコンのフラグは保ちます。

  1. 子メニューの UID を read_pm() またはメニューの一覧から読み取ります。 UID を組み立てないでください。

  2. スロットを読み取り、アイコンのフラグ (#、!、^) をアイコン名から分けます。

  3. リンクと、元のフラグを付けた新しいアイコン名を保存します。

before = pme.editing.read_pm(pm_uid, slot_uids=[slot_uid])
slot = before["slots"][0]
# Keep the leading flags and replace only the icon name.
old_icon = slot["icon"]
icon_flags = old_icon[:len(old_icon) - len(old_icon.lstrip("#!^"))]
result = pme.editing.update_slots(
    pm_uid,
    {slot_uid: {
        "mode": "MENU",
        "menu_target_uid": child_uid,
        "icon": icon_flags + "TOOL_SETTINGS",
        "auto_icon": False,
    }},
    expected_version=before["version"],
    expected={slot_uid: slot},
)
assert result["status"] == "committed", result
  • 子メニューの内容の分類に合うアイコンを選んでください。 Vector Menu は Nest の矢印を自身で描画します。

  • アイコンだけを変更する場合は mode と menu_target_uid を省きます。 表示設定は保存値のまま保たれます。 アイコンを変えるために Submenu を Button へ変更する必要はありません。

  • menu_presentation は、リンク先 Regular Menu の配置方法です。 Nest のジェスチャーや Pie Menu の確定の設定とは別の設定です。

確認¶

  • result["slots"][0]["after"] の mode が "MENU"、target_pm_uid が child_uid と等しく、icon が元のフラグで始まっていること。

  • 目的のメニューで、アイコンの表示、子メニューへの移動、子メニュー内での選択、 子メニューからの離脱が意図どおりに動くこと。

使用する関数: read_pm()、update_slots()。 アイコンの値は アイコンの値、Menu スロットの text は Menu スロットの text で説明しています。

Next
Keymapの選び方
Previous
Router の分岐を追加して条件を編集する
Copyright © 2025, Pluglug and contributors
Made with Sphinx and @pradyunsg's Furo
On this page
  • 子メニューへリンクし、アイコンのフラグを保つ
    • 確認