replicator-workshop 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. replicator/__init__.py +6 -0
  2. replicator/app.py +204 -0
  3. replicator/config.py +48 -0
  4. replicator/core/__init__.py +0 -0
  5. replicator/core/assembly.py +117 -0
  6. replicator/core/blender_link.py +161 -0
  7. replicator/core/critique.py +594 -0
  8. replicator/core/drawing.py +389 -0
  9. replicator/core/dxf.py +120 -0
  10. replicator/core/evaluate.py +439 -0
  11. replicator/core/explain.py +139 -0
  12. replicator/core/export.py +96 -0
  13. replicator/core/fit.py +170 -0
  14. replicator/core/importers.py +185 -0
  15. replicator/core/materials.py +104 -0
  16. replicator/core/ops_advanced.py +496 -0
  17. replicator/core/ops_engineering.py +223 -0
  18. replicator/core/physics.py +147 -0
  19. replicator/core/printers.py +100 -0
  20. replicator/core/program.py +298 -0
  21. replicator/core/render.py +145 -0
  22. replicator/core/reverse.py +350 -0
  23. replicator/core/robot.py +153 -0
  24. replicator/core/step.py +245 -0
  25. replicator/fixtures/gaming_pc_liquid.json +2259 -0
  26. replicator/fixtures/gas_generator_rocket.json +876 -0
  27. replicator/fixtures/gas_generator_rocket_aero.json +861 -0
  28. replicator/fixtures/house_two_bed.json +979 -0
  29. replicator/fixtures/quadcopter_drone.json +687 -0
  30. replicator/fixtures/raspberry_pi_5.json +884 -0
  31. replicator/fixtures/rocket_engine.json +652 -0
  32. replicator/fixtures/turbofan.json +931 -0
  33. replicator/fixtures/vector_engine.json +314 -0
  34. replicator/gpu.py +81 -0
  35. replicator/image3d/__init__.py +0 -0
  36. replicator/image3d/comfy.py +181 -0
  37. replicator/image3d/pipeline.py +208 -0
  38. replicator/image3d/sheet.py +154 -0
  39. replicator/knowledge/__init__.py +61 -0
  40. replicator/knowledge/car_wheel_corner.md +21 -0
  41. replicator/knowledge/desk_lamp.md +21 -0
  42. replicator/knowledge/desktop_pc.md +20 -0
  43. replicator/knowledge/electronics_board.md +21 -0
  44. replicator/knowledge/exoskeleton.md +21 -0
  45. replicator/knowledge/house.md +22 -0
  46. replicator/knowledge/light_aircraft.md +22 -0
  47. replicator/knowledge/multirotor_drone.md +25 -0
  48. replicator/knowledge/print_replica.md +13 -0
  49. replicator/knowledge/rocket_engine.md +27 -0
  50. replicator/knowledge/turbofan.md +23 -0
  51. replicator/llm/__init__.py +0 -0
  52. replicator/llm/client.py +424 -0
  53. replicator/llm/prompts/blueprint.md +28 -0
  54. replicator/llm/prompts/edit.md +15 -0
  55. replicator/llm/prompts/explain.md +37 -0
  56. replicator/llm/prompts/name_parts.md +13 -0
  57. replicator/llm/prompts/program.md +72 -0
  58. replicator/llm/prompts/research_queries.md +8 -0
  59. replicator/mcp_server.py +307 -0
  60. replicator/qml/Main.qml +874 -0
  61. replicator/qml/Replicator/UI/Chip.qml +17 -0
  62. replicator/qml/Replicator/UI/DockHeader.qml +27 -0
  63. replicator/qml/Replicator/UI/Icon.qml +118 -0
  64. replicator/qml/Replicator/UI/IconButton.qml +31 -0
  65. replicator/qml/Replicator/UI/Kbd.qml +18 -0
  66. replicator/qml/Replicator/UI/NumField.qml +69 -0
  67. replicator/qml/Replicator/UI/Pill.qml +28 -0
  68. replicator/qml/Replicator/UI/RCombo.qml +51 -0
  69. replicator/qml/Replicator/UI/RMenu.qml +42 -0
  70. replicator/qml/Replicator/UI/RSlider.qml +23 -0
  71. replicator/qml/Replicator/UI/Segmented.qml +63 -0
  72. replicator/qml/Replicator/UI/Swatch.qml +47 -0
  73. replicator/qml/Replicator/UI/Theme.qml +149 -0
  74. replicator/qml/Replicator/UI/qmldir +14 -0
  75. replicator/qml/panels/AgentPrompt.qml +53 -0
  76. replicator/qml/panels/AttributeManager.qml +171 -0
  77. replicator/qml/panels/Commander.qml +136 -0
  78. replicator/qml/panels/HolodeckPanel.qml +117 -0
  79. replicator/qml/panels/IssuesCard.qml +78 -0
  80. replicator/qml/panels/LedgerPanel.qml +110 -0
  81. replicator/qml/panels/MaterialShelf.qml +97 -0
  82. replicator/qml/panels/ObjectManager.qml +107 -0
  83. replicator/qml/panels/Preferences.qml +211 -0
  84. replicator/qml/panels/Presenter.qml +316 -0
  85. replicator/qml/panels/StatusBar.qml +77 -0
  86. replicator/qml/panels/Timeline.qml +149 -0
  87. replicator/qml/panels/Welcome.qml +126 -0
  88. replicator/qml/viewport/Callouts.qml +87 -0
  89. replicator/qml/viewport/EdgeMaterial.qml +16 -0
  90. replicator/qml/viewport/GridMaterial.qml +16 -0
  91. replicator/qml/viewport/HoloMaterial.qml +23 -0
  92. replicator/qml/viewport/NavGizmo.qml +72 -0
  93. replicator/qml/viewport/ReferenceMaterial.qml +17 -0
  94. replicator/qml/viewport/Viewport.qml +583 -0
  95. replicator/qt/__init__.py +0 -0
  96. replicator/qt/bridge.py +1427 -0
  97. replicator/qt/drawing_sheet.py +33 -0
  98. replicator/qt/envmap.py +40 -0
  99. replicator/qt/library.py +68 -0
  100. replicator/qt/mesh_geometry.py +167 -0
  101. replicator/qt/svg.py +41 -0
  102. replicator/research/__init__.py +0 -0
  103. replicator/research/lane.py +281 -0
  104. replicator/shaders/edge.frag +9 -0
  105. replicator/shaders/edge.vert +7 -0
  106. replicator/shaders/grid.frag +52 -0
  107. replicator/shaders/grid.vert +6 -0
  108. replicator/shaders/holo.frag +41 -0
  109. replicator/shaders/reference.frag +15 -0
  110. replicator/shaders/reference.vert +6 -0
  111. replicator/voice.py +120 -0
  112. replicator_workshop-0.1.0.dist-info/METADATA +410 -0
  113. replicator_workshop-0.1.0.dist-info/RECORD +118 -0
  114. replicator_workshop-0.1.0.dist-info/WHEEL +5 -0
  115. replicator_workshop-0.1.0.dist-info/entry_points.txt +3 -0
  116. replicator_workshop-0.1.0.dist-info/licenses/LICENSE +21 -0
  117. replicator_workshop-0.1.0.dist-info/licenses/vendor/mcp-for-blender/LICENSE +21 -0
  118. replicator_workshop-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,149 @@
1
+ pragma Singleton
2
+ import QtQuick
3
+ import QtCore
4
+
5
+ // Replicator design tokens. Every colour, size and font in the workspace comes from here, so a theme, an accent or
6
+ // a density change repaints the whole app at once. The choices persist in ~/.config/Replicator/Replicator.conf.
7
+ //
8
+ // Theme.themeName abyss | graphite | carbon | daylight
9
+ // Theme.accentName holo | azure | violet | mint | amber | rose
10
+ // Theme.density compact | cozy | roomy
11
+ //
12
+ // A panel never hard-codes a colour: surfaces are bg < panel < panel2 < raised, text is text > dim > faint.
13
+ QtObject {
14
+ id: t
15
+
16
+ property string themeName: "abyss"
17
+ property string accentName: "holo"
18
+ property string density: "cozy"
19
+ property bool motion: true // false = no easing anywhere (accessibility, slow machines)
20
+
21
+ property Settings store: Settings {
22
+ category: "appearance"
23
+ property alias theme: t.themeName
24
+ property alias accent: t.accentName
25
+ property alias density: t.density
26
+ property alias motion: t.motion
27
+ }
28
+
29
+ readonly property var themes: ({
30
+ abyss: {
31
+ label: "Abyss", note: "Deep-sea navy, the Replicator signature", dark: true,
32
+ bg: "#060a10", panel: "#0b1119", panel2: "#111925", raised: "#172231", header: "#080d14",
33
+ line: "#1c2735", lineSoft: "#141d29", field: "#070b11",
34
+ text: "#dde6f0", dim: "#8494a7", faint: "#4f5e71",
35
+ viewTop: "#1b2838", viewBottom: "#06090e", gridMinor: "#5d7590", gridMajor: "#86a3c2",
36
+ stageTop: "#07080b", stageBottom: "#020203", scrim: "#b0030609"
37
+ },
38
+ graphite: {
39
+ label: "Graphite", note: "Neutral studio grey, the classic DCC look", dark: true,
40
+ bg: "#1a1b1e", panel: "#232528", panel2: "#2b2d32", raised: "#33363c", header: "#1e2023",
41
+ line: "#383b41", lineSoft: "#2e3136", field: "#17181b",
42
+ text: "#dcdfe4", dim: "#8d929b", faint: "#5d626b",
43
+ viewTop: "#3d4046", viewBottom: "#232529", gridMinor: "#7e838c", gridMajor: "#a3a8b1",
44
+ stageTop: "#07080b", stageBottom: "#020203", scrim: "#b00b0c0e"
45
+ },
46
+ carbon: {
47
+ label: "Carbon", note: "True black for OLED and dark rooms", dark: true,
48
+ bg: "#000000", panel: "#08090a", panel2: "#101113", raised: "#18191c", header: "#040405",
49
+ line: "#1f2023", lineSoft: "#141517", field: "#020203",
50
+ text: "#e4e4e7", dim: "#8a8b90", faint: "#525359",
51
+ viewTop: "#16171a", viewBottom: "#000000", gridMinor: "#5c5e66", gridMajor: "#84868f",
52
+ stageTop: "#07080b", stageBottom: "#020203", scrim: "#b0000000"
53
+ },
54
+ daylight: {
55
+ label: "Daylight", note: "Light panels for a bright room", dark: false,
56
+ bg: "#e9ecf0", panel: "#f5f6f8", panel2: "#e8ebef", raised: "#ffffff", header: "#eef0f3",
57
+ line: "#cfd4db", lineSoft: "#dde1e6", field: "#ffffff",
58
+ text: "#1b2029", dim: "#596270", faint: "#8e96a3",
59
+ viewTop: "#dfe4ea", viewBottom: "#b9c1cb", gridMinor: "#7f8a98", gridMajor: "#566170",
60
+ stageTop: "#07080b", stageBottom: "#020203", scrim: "#70202836"
61
+ }
62
+ })
63
+ readonly property var accents: ({
64
+ holo: { label: "Holo", base: "#2fc3ff", hi: "#74dbff" },
65
+ azure: { label: "Azure", base: "#3d8ee6", hi: "#62a9f7" },
66
+ violet: { label: "Violet", base: "#9d7bff", hi: "#b9a0ff" },
67
+ mint: { label: "Mint", base: "#3fd9a0", hi: "#7aeac0" },
68
+ amber: { label: "Amber", base: "#ffab3d", hi: "#ffc470" },
69
+ rose: { label: "Rose", base: "#ff5d8a", hi: "#ff8aab" }
70
+ })
71
+ readonly property var densities: ({ compact: 0.92, cozy: 1.0, roomy: 1.1 })
72
+
73
+ readonly property var p: themes[themeName] || themes.abyss
74
+ readonly property var a: accents[accentName] || accents.holo
75
+ readonly property real k: densities[density] || 1.0
76
+ readonly property bool dark: p.dark
77
+
78
+ // ---- surfaces
79
+ readonly property color bg: p.bg
80
+ readonly property color panel: p.panel
81
+ readonly property color panel2: p.panel2
82
+ readonly property color raised: p.raised
83
+ readonly property color header: p.header
84
+ readonly property color line: p.line
85
+ readonly property color lineSoft: p.lineSoft
86
+ readonly property color field: p.field
87
+ readonly property color scrim: p.scrim
88
+ readonly property color glass: Qt.rgba(panel.r, panel.g, panel.b, 0.88) // floating bars over the viewport
89
+ readonly property color glassLine: Qt.rgba(text.r, text.g, text.b, dark ? 0.10 : 0.16)
90
+ readonly property color hover: Qt.rgba(text.r, text.g, text.b, dark ? 0.06 : 0.07)
91
+ readonly property color press: Qt.rgba(text.r, text.g, text.b, dark ? 0.11 : 0.12)
92
+
93
+ // ---- text
94
+ readonly property color text: p.text
95
+ readonly property color dim: p.dim
96
+ readonly property color faint: p.faint
97
+
98
+ // ---- accent
99
+ readonly property color accent: a.base
100
+ readonly property color accentHi: a.hi
101
+ readonly property color onAccent: (0.299 * accent.r + 0.587 * accent.g + 0.114 * accent.b) > 0.55 ? "#041019" : "#ffffff"
102
+ readonly property color accentSoft: Qt.rgba(accent.r, accent.g, accent.b, dark ? 0.16 : 0.18) // selected rows
103
+ readonly property color accentLine: Qt.rgba(accent.r, accent.g, accent.b, 0.55)
104
+
105
+ // ---- fixed meanings (the same in every theme)
106
+ readonly property color holo: "#33c6ff" // the materialize scan, always cyan
107
+ readonly property color amber: "#ffb347" // selection in the viewport
108
+ readonly property color observed: dark ? "#7bd88f" : "#1f9d55"
109
+ readonly property color inferred: dark ? "#ffcb6b" : "#b7791f"
110
+ readonly property color unknown: dim
111
+ readonly property color danger: "#ff5d6c"
112
+ readonly property color axisX: "#e5484d"
113
+ readonly property color axisY: "#6fcf83"
114
+ readonly property color axisZ: "#3d8ee6"
115
+
116
+ // ---- viewport
117
+ readonly property color viewTop: p.viewTop
118
+ readonly property color viewBottom: p.viewBottom
119
+ readonly property color gridMinor: p.gridMinor
120
+ readonly property color gridMajor: p.gridMajor
121
+ readonly property color stageTop: p.stageTop
122
+ readonly property color stageBottom: p.stageBottom
123
+ // overlays drawn over the 3D view stay light-on-dark in every theme except Daylight
124
+ readonly property color viewText: dark ? "#eef2f7" : "#1b2029"
125
+ readonly property color viewDim: dark ? "#93a0b1" : "#4c5562"
126
+
127
+ // ---- type
128
+ readonly property string sans: "Inter"
129
+ readonly property string mono: "JetBrainsMono Nerd Font"
130
+ readonly property int fs: Math.round(12 * k)
131
+ readonly property int fsSmall: Math.round(11 * k)
132
+ readonly property int fsTiny: Math.round(10 * k)
133
+ readonly property int fsLarge: Math.round(14 * k)
134
+ readonly property real caps: 1.4 // letter spacing for small-caps section labels
135
+
136
+ // ---- metrics
137
+ readonly property int row: Math.round(28 * k) // list rows
138
+ readonly property int ctl: Math.round(26 * k) // fields, combos, small buttons
139
+ readonly property int bar: Math.round(34 * k) // dock headers and tool bars
140
+ readonly property int r1: 4
141
+ readonly property int r2: 7
142
+ readonly property int r3: 11
143
+ readonly property int pad: Math.round(10 * k)
144
+
145
+ // ---- motion
146
+ readonly property int fast: motion ? 120 : 0
147
+ readonly property int med: motion ? 220 : 0
148
+ readonly property int slow: motion ? 420 : 0
149
+ }
@@ -0,0 +1,14 @@
1
+ module Replicator.UI
2
+ singleton Theme 1.0 Theme.qml
3
+ Icon 1.0 Icon.qml
4
+ IconButton 1.0 IconButton.qml
5
+ Pill 1.0 Pill.qml
6
+ Segmented 1.0 Segmented.qml
7
+ Chip 1.0 Chip.qml
8
+ Kbd 1.0 Kbd.qml
9
+ NumField 1.0 NumField.qml
10
+ RSlider 1.0 RSlider.qml
11
+ RCombo 1.0 RCombo.qml
12
+ RMenu 1.0 RMenu.qml
13
+ DockHeader 1.0 DockHeader.qml
14
+ Swatch 1.0 Swatch.qml
@@ -0,0 +1,53 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // A one-line request to the local model about one part ("make the bell longer", "add 24 cooling tubes").
7
+ // The edit is scoped: the model may only change this component's ops, and anything else it touches is refused.
8
+ Popup {
9
+ id: box
10
+ property string cid: ""
11
+ property string label: ""
12
+ signal submitted(string cid, string text)
13
+ parent: Overlay.overlay
14
+ anchors.centerIn: parent
15
+ width: 560
16
+ modal: true
17
+ padding: 16
18
+ background: Rectangle { radius: Theme.r3; color: Theme.raised; border.color: Theme.accentLine }
19
+ onOpened: { field.text = ""; field.forceActiveFocus() }
20
+ function submit() {
21
+ if (field.text.trim() === "") return
22
+ box.submitted(box.cid, field.text.trim())
23
+ box.close()
24
+ }
25
+ contentItem: ColumnLayout {
26
+ spacing: 10
27
+ RowLayout {
28
+ spacing: 8
29
+ Icon { name: "sparkle"; size: 16; color: Theme.accentHi }
30
+ Text { text: "Rework " + box.label; color: Theme.text; font.pixelSize: Theme.fsLarge; font.family: Theme.sans; font.weight: Font.DemiBold
31
+ Layout.fillWidth: true; elide: Text.ElideRight }
32
+ Text { text: studio.busy === "" ? "" : "busy: " + studio.busy; color: Theme.inferred; font.pixelSize: Theme.fsTiny }
33
+ }
34
+ TextField {
35
+ id: field
36
+ Layout.fillWidth: true
37
+ placeholderText: "What should change? e.g. \"make it 20 % longer\", \"add 12 bolts around the flange\""
38
+ font.pixelSize: Theme.fs
39
+ onAccepted: box.submit()
40
+ }
41
+ Text {
42
+ Layout.fillWidth: true; wrapMode: Text.WordWrap
43
+ text: "Only this part's operations can change; an edit that touches anything else is refused. The result is one undo step."
44
+ color: Theme.dim; font.pixelSize: Theme.fsTiny; font.family: Theme.sans
45
+ }
46
+ RowLayout {
47
+ Layout.alignment: Qt.AlignRight
48
+ spacing: 8
49
+ Pill { text: "Cancel"; onHit: box.close() }
50
+ Pill { text: "Rework"; icon: "sparkle"; primary: true; enabled: studio.busy === "" && field.text.trim() !== ""; onHit: box.submit() }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,171 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // Attribute Manager: the selected step's parameters as real fields. Drag a number to scrub it.
7
+ Rectangle {
8
+ id: am
9
+ color: Theme.panel
10
+ function commit(key, value) { studio.setParam(studio.selected, key, JSON.stringify(value)) }
11
+
12
+ Column {
13
+ anchors.centerIn: parent; visible: studio.selectedOpKind === "" && studio.selectedComponent === ""; spacing: 8
14
+ Icon { name: "sliders"; size: 26; color: Theme.faint; anchors.horizontalCenter: parent.horizontalCenter }
15
+ Text {
16
+ text: "Nothing selected.\nClick a part in the viewport\nor a row in Objects."
17
+ horizontalAlignment: Text.AlignHCenter; color: Theme.faint; font.pixelSize: Theme.fs; font.family: Theme.sans; lineHeight: 1.3
18
+ }
19
+ }
20
+
21
+ Flickable {
22
+ anchors.fill: parent
23
+ contentHeight: col.implicitHeight + 20
24
+ clip: true
25
+ boundsBehavior: Flickable.StopAtBounds
26
+ ScrollBar.vertical: ScrollBar {}
27
+ visible: studio.selectedOpKind !== "" || studio.selectedComponent !== ""
28
+ ColumnLayout {
29
+ id: col
30
+ x: Theme.pad; y: 10
31
+ width: am.width - Theme.pad * 2
32
+ spacing: 7
33
+ RowLayout {
34
+ spacing: 8
35
+ Rectangle {
36
+ implicitWidth: kind.implicitWidth + 14; implicitHeight: 20; radius: 10
37
+ color: Theme.accentSoft
38
+ Text { id: kind; anchors.centerIn: parent
39
+ text: studio.selectedOpKind ? studio.selectedOpKind.toUpperCase() : "COMPONENT"
40
+ color: Theme.accentHi; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.Bold; font.letterSpacing: 1.2 }
41
+ }
42
+ Text { text: studio.selectedOpKind ? studio.selected : studio.selectedComponent
43
+ color: Theme.text; font.pixelSize: Theme.fs; font.family: Theme.mono; elide: Text.ElideRight; Layout.fillWidth: true }
44
+ }
45
+ Text {
46
+ visible: studio.selectedOpKind === ""
47
+ text: "A component groups parts. Pick one of its parts to edit parameters, or use the Materials tab to paint the whole component."
48
+ color: Theme.dim; font.pixelSize: Theme.fsSmall; font.family: Theme.sans; wrapMode: Text.WordWrap; Layout.fillWidth: true
49
+ }
50
+ Flow {
51
+ Layout.fillWidth: true; spacing: 6
52
+ visible: facts.size !== undefined || facts.kg !== undefined
53
+ readonly property var facts: studio.selectedFacts
54
+ Chip { visible: parent.facts.size !== undefined
55
+ label: "SIZE"; value: parent.facts.size ? parent.facts.size.map(v => Math.round(v)).join(" × ") + " mm" : "" }
56
+ Chip { visible: parent.facts.kg !== undefined
57
+ label: studio.selectedOpKind ? "PART MASS" : "MASS"
58
+ value: parent.facts.kg === undefined ? "" : parent.facts.kg < 1 ? Math.round(parent.facts.kg * 1000) + " g"
59
+ : parent.facts.kg.toFixed(parent.facts.kg < 10 ? 2 : 1) + " kg" }
60
+ Text { visible: studio.selectedOpKind !== "" && parent.facts.kg !== undefined
61
+ text: "of component " + parent.facts.component
62
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans }
63
+ }
64
+ Repeater {
65
+ model: studio.selectedParams
66
+ delegate: ColumnLayout {
67
+ id: rowc
68
+ required property var modelData
69
+ required property int index
70
+ Layout.fillWidth: true
71
+ spacing: 4
72
+ RowLayout {
73
+ visible: rowc.modelData.group === "Coordinates" && rowc.modelData.key === "translate"
74
+ Layout.topMargin: 8; spacing: 8
75
+ Text { text: "COORDINATES"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans
76
+ font.weight: Font.DemiBold; font.letterSpacing: Theme.caps }
77
+ Rectangle { Layout.fillWidth: true; height: 1; color: Theme.lineSoft }
78
+ }
79
+ RowLayout {
80
+ Layout.fillWidth: true
81
+ spacing: 6
82
+ Text {
83
+ text: rowc.modelData.key.replace(/_/g, " ")
84
+ color: Theme.dim; font.pixelSize: Theme.fsSmall; font.family: Theme.sans
85
+ Layout.preferredWidth: 100; elide: Text.ElideRight
86
+ }
87
+ Loader {
88
+ Layout.fillWidth: true
89
+ sourceComponent: ({ number: numC, vec3: vecC, enum: enumC, bool: boolC, text: textC,
90
+ json: jsonC })[rowc.modelData.kind]
91
+ property var row: rowc.modelData
92
+ }
93
+ }
94
+ }
95
+ }
96
+ Text {
97
+ visible: studio.selectedOpKind !== ""
98
+ Layout.topMargin: 8
99
+ text: "Drag a number to scrub (Shift fine, Ctrl coarse). Click to type. Edits rebuild at once; Undo walks back."
100
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; wrapMode: Text.WordWrap; Layout.fillWidth: true
101
+ }
102
+ }
103
+ }
104
+ Component {
105
+ id: numC
106
+ NumField {
107
+ property var row: parent ? parent.row : ({})
108
+ value: row.value
109
+ stepSize: row.step
110
+ decimals: row.integer ? 0 : Math.abs(row.value) >= 100 ? 1 : 2
111
+ onCommitted: (v) => am.commit(row.key, row.integer ? Math.round(v) : v)
112
+ }
113
+ }
114
+ Component {
115
+ id: vecC
116
+ RowLayout {
117
+ id: vecRoot
118
+ property var row: parent ? parent.row : ({})
119
+ spacing: 4
120
+ Repeater {
121
+ model: 3
122
+ NumField {
123
+ required property int index
124
+ Layout.fillWidth: true
125
+ label: ["X", "Y", "Z"][index]
126
+ labelColor: [Theme.axisX, Theme.axisY, Theme.axisZ][index]
127
+ value: vecRoot.row.value[index]
128
+ stepSize: vecRoot.row.key === "rotate" ? 1 : vecRoot.row.key === "scale" ? 0.01 : Math.max(studio.radius * 0.002, 0.1)
129
+ decimals: vecRoot.row.key === "scale" ? 3 : 1
130
+ onCommitted: (v) => { const a = vecRoot.row.value.slice(); a[index] = v; am.commit(vecRoot.row.key, a) }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ Component {
136
+ id: enumC
137
+ RCombo {
138
+ property var row: parent ? parent.row : ({})
139
+ implicitHeight: Theme.ctl - 2
140
+ model: row.options
141
+ currentIndex: Math.max(0, row.options.indexOf(row.value))
142
+ displayText: currentText === "" ? "inherit" : currentText
143
+ onActivated: am.commit(row.key, row.options[currentIndex])
144
+ }
145
+ }
146
+ Component {
147
+ id: boolC
148
+ Switch { property var row: parent ? parent.row : ({}); checked: row.value; onToggled: am.commit(row.key, checked) }
149
+ }
150
+ Component {
151
+ id: textC
152
+ TextField {
153
+ property var row: parent ? parent.row : ({})
154
+ implicitHeight: Theme.ctl - 2; text: row.value; font.pixelSize: Theme.fsSmall; font.family: Theme.sans; color: Theme.text
155
+ leftPadding: 8; selectionColor: Theme.accent; selectedTextColor: Theme.onAccent
156
+ background: Rectangle { color: Theme.field; radius: Theme.r1; border.color: parent.activeFocus ? Theme.accent : Theme.line }
157
+ onEditingFinished: if (text !== row.value) am.commit(row.key, text)
158
+ }
159
+ }
160
+ Component {
161
+ id: jsonC
162
+ TextArea {
163
+ property var row: parent ? parent.row : ({})
164
+ text: row.value; wrapMode: TextEdit.WrapAnywhere; font.family: Theme.mono; font.pixelSize: Theme.fsTiny
165
+ color: Theme.text; implicitHeight: Math.min(110, contentHeight + 12)
166
+ selectionColor: Theme.accent; selectedTextColor: Theme.onAccent
167
+ background: Rectangle { color: Theme.field; radius: Theme.r1; border.color: parent.activeFocus ? Theme.accent : Theme.line }
168
+ onEditingFinished: { try { am.commit(row.key, JSON.parse(text)) } catch (e) { } }
169
+ }
170
+ }
171
+ }
@@ -0,0 +1,136 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import Replicator.UI
4
+
5
+ // The Commander (Ctrl+K): one search box over everything Replicator can do. It lists the action registry, the
6
+ // examples and recent builds, the themes and the material library, and whatever you typed can be sent straight
7
+ // to the model as a dream or an edit. Up/Down to move, Enter to run, Esc to close.
8
+ Popup {
9
+ id: cmd
10
+ property var actions: []
11
+ signal openFile(string path)
12
+
13
+ parent: Overlay.overlay
14
+ // (a hidden window, as --shot uses, has a zero-size overlay at the window centre: centre on it then)
15
+ x: Math.round((parent.width - width) / 2)
16
+ y: parent.height > 0 ? Math.round(parent.height * 0.14) : -Math.round(height / 2)
17
+ width: 680
18
+ padding: 0
19
+ modal: true
20
+ focus: true
21
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
22
+ Overlay.modal: Rectangle { color: Theme.scrim }
23
+ background: Rectangle { radius: 16; color: Theme.raised; border.color: Theme.glassLine }
24
+ enter: Transition {
25
+ NumberAnimation { property: "opacity"; from: 0; to: 1; duration: Theme.fast }
26
+ NumberAnimation { property: "scale"; from: 0.97; to: 1; duration: Theme.med; easing.type: Easing.OutCubic }
27
+ }
28
+ onOpened: { query.text = ""; list.currentIndex = 0; query.forceActiveFocus() }
29
+
30
+ function ok(a) { return a.enabled === undefined || a.enabled() }
31
+ function match(hay, words) { hay = hay.toLowerCase(); for (const w of words) if (hay.indexOf(w) < 0) return false; return true }
32
+ readonly property var results: {
33
+ const q = query.text.trim()
34
+ const words = q.toLowerCase().split(/\s+/).filter(s => s.length)
35
+ const out = []
36
+ for (const a of actions)
37
+ if (match(a.group + " " + a.title, words))
38
+ out.push({ group: a.group, title: a.title, icon: a.icon || "", keys: a.keys || "", ok: ok(a), run: a.run })
39
+ if (studio.selected !== "")
40
+ for (const m of studio.materialLibrary)
41
+ if (words.length && match("material " + m.group + " " + m.label, words))
42
+ out.push({ group: "Material", title: m.label, icon: "material", keys: "", ok: true, run: () => studio.applyMaterial(m.id) })
43
+ for (const k in Theme.themes)
44
+ if (match("theme " + Theme.themes[k].label, words))
45
+ out.push({ group: "Theme", title: Theme.themes[k].label + " · " + Theme.themes[k].note, icon: "sun", keys: "", ok: true, run: () => Theme.themeName = k })
46
+ for (const k in Theme.accents)
47
+ if (words.length && match("accent colour color " + Theme.accents[k].label, words))
48
+ out.push({ group: "Accent", title: Theme.accents[k].label, icon: "dot", keys: "", ok: true, tint: Theme.accents[k].base, run: () => Theme.accentName = k })
49
+ for (const f of studio.examples.concat(studio.recents))
50
+ if (match("open " + f.kind + " " + f.name, words))
51
+ out.push({ group: f.kind === "example" ? "Example" : "Recent", title: f.name, icon: "folder", keys: f.steps + " steps", ok: true, run: () => cmd.openFile(f.path) })
52
+ if (q.length > 3) {
53
+ out.push({ group: "Specify", title: "Specify it: “" + q + "”", icon: "sparkle", keys: studio.busy === "" ? "" : "busy", ok: studio.busy === "", run: () => studio.dream(q) })
54
+ if (studio.stepCount > 0)
55
+ out.push({ group: "Edit", title: "Change this build: “" + q + "”", icon: "pencil", keys: "", ok: studio.busy === "", run: () => studio.edit(q) })
56
+ }
57
+ return out
58
+ }
59
+ function runAt(i) {
60
+ const r = results[i]
61
+ if (!r || !r.ok) return
62
+ cmd.close()
63
+ r.run()
64
+ }
65
+
66
+ contentItem: Column {
67
+ spacing: 0
68
+ Item {
69
+ width: parent.width; height: 54
70
+ Icon { x: 18; anchors.verticalCenter: parent.verticalCenter; name: "search"; size: 18; color: Theme.dim }
71
+ TextField {
72
+ id: query
73
+ anchors.fill: parent; anchors.leftMargin: 46; anchors.rightMargin: 60
74
+ background: null
75
+ color: Theme.text; font.pixelSize: 16; font.family: Theme.sans
76
+ selectionColor: Theme.accent; selectedTextColor: Theme.onAccent
77
+ placeholderText: "Search actions, builds, materials and themes, or describe something to build"
78
+ placeholderTextColor: Theme.faint
79
+ verticalAlignment: TextInput.AlignVCenter
80
+ onTextChanged: list.currentIndex = 0
81
+ Keys.onDownPressed: list.currentIndex = Math.min(list.count - 1, list.currentIndex + 1)
82
+ Keys.onUpPressed: list.currentIndex = Math.max(0, list.currentIndex - 1)
83
+ onAccepted: cmd.runAt(list.currentIndex)
84
+ }
85
+ Kbd { anchors.right: parent.right; anchors.rightMargin: 16; anchors.verticalCenter: parent.verticalCenter; keys: "Esc" }
86
+ }
87
+ Rectangle { width: parent.width; height: 1; color: Theme.line }
88
+ ListView {
89
+ id: list
90
+ width: parent.width
91
+ height: Math.min(contentHeight + 12, 420)
92
+ topMargin: 6; bottomMargin: 6
93
+ clip: true
94
+ model: cmd.results
95
+ boundsBehavior: Flickable.StopAtBounds
96
+ highlightMoveDuration: 0
97
+ ScrollBar.vertical: ScrollBar {}
98
+ delegate: Item {
99
+ id: row
100
+ required property var modelData
101
+ required property int index
102
+ width: list.width; height: 36
103
+ Rectangle {
104
+ anchors.fill: parent; anchors.leftMargin: 6; anchors.rightMargin: 6; radius: Theme.r2
105
+ color: list.currentIndex === row.index ? Theme.accentSoft : "transparent"
106
+ }
107
+ Icon { x: 18; anchors.verticalCenter: parent.verticalCenter; name: row.modelData.icon; size: 16
108
+ color: row.modelData.tint || (list.currentIndex === row.index ? Theme.accentHi : Theme.dim); opacity: row.modelData.ok ? 1 : 0.4 }
109
+ Text { x: 46; width: parent.width - 240; anchors.verticalCenter: parent.verticalCenter; elide: Text.ElideRight
110
+ text: row.modelData.title; color: Theme.text; opacity: row.modelData.ok ? 1 : 0.4
111
+ font.pixelSize: Theme.fsLarge - 1; font.family: Theme.sans }
112
+ Row {
113
+ anchors.right: parent.right; anchors.rightMargin: 18; anchors.verticalCenter: parent.verticalCenter; spacing: 10
114
+ Text { text: row.modelData.keys; visible: row.modelData.keys !== "" && row.modelData.keys.indexOf(" ") > 0
115
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.mono; anchors.verticalCenter: parent.verticalCenter }
116
+ Kbd { keys: row.modelData.keys.indexOf(" ") > 0 ? "" : row.modelData.keys; anchors.verticalCenter: parent.verticalCenter }
117
+ Text { text: row.modelData.group.toUpperCase(); color: Theme.faint; width: 62; horizontalAlignment: Text.AlignRight
118
+ font.pixelSize: 9; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: 1.1
119
+ anchors.verticalCenter: parent.verticalCenter }
120
+ }
121
+ MouseArea { anchors.fill: parent; hoverEnabled: true; onEntered: list.currentIndex = row.index; onClicked: cmd.runAt(row.index) }
122
+ }
123
+ }
124
+ Rectangle { width: parent.width; height: 1; color: Theme.line }
125
+ Item {
126
+ width: parent.width; height: 32
127
+ Row {
128
+ x: 16; anchors.verticalCenter: parent.verticalCenter; spacing: 14
129
+ Row { spacing: 5; Kbd { keys: "↑" } Kbd { keys: "↓" } Text { text: "move"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; anchors.verticalCenter: parent.verticalCenter } }
130
+ Row { spacing: 5; Kbd { keys: "Enter" } Text { text: "run"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; anchors.verticalCenter: parent.verticalCenter } }
131
+ }
132
+ Text { anchors.right: parent.right; anchors.rightMargin: 16; anchors.verticalCenter: parent.verticalCenter
133
+ text: cmd.results.length + " results"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.mono }
134
+ }
135
+ }
136
+ }
@@ -0,0 +1,117 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // Character sheets from a ComfyUI workflow ($REPLICATOR_SHEETS, newest first). Pick a sheet and turn it
7
+ // into a 3D model via Hunyuan3D in your ComfyUI: "Make 3D (sheet)" runs
8
+ // the multi-view model over the sheet's labelled views, "Front only" the single-image model on the front.
9
+ // The result loads as a reverse-engineering project. Shown in Reverse mode above the evidence ledger, collapsed
10
+ // until asked for: the newest sheet has nothing to do with whatever model is being reversed.
11
+ Rectangle {
12
+ id: hp
13
+ color: "transparent"
14
+ implicitHeight: open ? 188 : 34
15
+ property bool open: false
16
+ property int selected: 0
17
+ readonly property bool canRun: studio.busy === "" && studio.holodeckSheets.length > 0
18
+
19
+ function sheet() {
20
+ const rows = studio.holodeckSheets
21
+ if (!rows.length)
22
+ return null
23
+ return rows[Math.min(selected, rows.length - 1)]
24
+ }
25
+
26
+ Connections {
27
+ target: studio
28
+ function onHolodeckChanged() { // a sheet vanished: keep the selection on something
29
+ if (hp.selected >= studio.holodeckSheets.length)
30
+ hp.selected = Math.max(0, studio.holodeckSheets.length - 1)
31
+ }
32
+ }
33
+
34
+ Rectangle { anchors.top: parent.top; width: parent.width; height: 1; color: Theme.line }
35
+
36
+ ColumnLayout {
37
+ anchors.fill: parent
38
+ anchors.topMargin: 6; anchors.leftMargin: 10; anchors.rightMargin: 10; anchors.bottomMargin: 8
39
+ spacing: 6
40
+
41
+ RowLayout {
42
+ Layout.fillWidth: true
43
+ spacing: 6
44
+ Icon { name: hp.open ? "chevronDown" : "chevronRight"; size: 11; color: Theme.faint }
45
+ Text {
46
+ Layout.fillWidth: true
47
+ text: "MAKE 3D FROM A CHARACTER SHEET" + (studio.holodeckSheets.length ? " (" + studio.holodeckSheets.length + ")" : "")
48
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps
49
+ }
50
+ TapHandler { onTapped: hp.open = !hp.open }
51
+ }
52
+ Text {
53
+ visible: hp.open && studio.holodeckSheets.length === 0
54
+ text: "No character sheets in the sheets folder (REPLICATOR_SHEETS). File > Image to 3D… works with any picture."
55
+ color: Theme.faint; font.pixelSize: Theme.fsSmall; wrapMode: Text.WordWrap; Layout.fillWidth: true
56
+ }
57
+
58
+ Flickable {
59
+ Layout.fillWidth: true
60
+ Layout.preferredHeight: 56
61
+ clip: true
62
+ visible: hp.open && studio.holodeckSheets.length > 0
63
+ flickableDirection: Flickable.HorizontalFlick
64
+ boundsBehavior: Flickable.StopAtBounds
65
+ contentWidth: thumbs.width + 1
66
+
67
+ Row {
68
+ id: thumbs
69
+ spacing: 6
70
+ Repeater {
71
+ model: studio.holodeckSheets
72
+ delegate: Rectangle {
73
+ required property var modelData
74
+ required property int index
75
+ width: 56; height: 56; radius: Theme.r2
76
+ color: Theme.field
77
+ border.width: 2
78
+ border.color: hp.selected === index ? Theme.accent : Theme.line
79
+ Image {
80
+ anchors.fill: parent; anchors.margins: 2; clip: true
81
+ source: "file://" + modelData.path
82
+ asynchronous: true
83
+ cache: false // sheets are regenerated in place; a cached copy would be stale
84
+ fillMode: Image.PreserveAspectCrop
85
+ }
86
+ MouseArea { anchors.fill: parent; onClicked: hp.selected = index }
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ Text {
93
+ visible: hp.open && hp.sheet() !== null
94
+ text: hp.sheet() ? (hp.sheet().subject || hp.sheet().name) : ""
95
+ color: Theme.text; font.pixelSize: Theme.fsSmall; Layout.fillWidth: true
96
+ wrapMode: Text.WordWrap; maximumLineCount: 2; elide: Text.ElideRight
97
+ }
98
+
99
+ RowLayout {
100
+ visible: hp.open && studio.holodeckSheets.length > 0
101
+ spacing: 6
102
+ Pill {
103
+ icon: "sparkle"
104
+ text: "Make 3D (sheet)"
105
+ primary: true
106
+ enabled: hp.canRun
107
+ onHit: studio.imageTo3D(hp.sheet().path, false)
108
+ }
109
+ Pill {
110
+ icon: "image"
111
+ text: "Front only"
112
+ enabled: hp.canRun
113
+ onHit: studio.imageTo3D(hp.sheet().path, true)
114
+ }
115
+ }
116
+ }
117
+ }