ModelWorkbench is a macOS app for editing procedural Swift-based 3D models and generating the matching artifact files in the same folder.
Each model lives in its own folder anywhere on disk:
MyModel/
MyModel.swift
MyModel.3mf
MyModel.usda
MyModel.usdc
MyModel.usdz
You can start with only MyModel.swift. Saving in the app regenerates the rest of the files into that same folder.
ModelWorkbench can open either:
- a model folder, or
- the
.swiftfile inside that folder
When you create a new model, the app asks for a parent folder and a model name, then creates:
- a new folder named after the model
- a starter Swift source file inside it
The model source file must define a type named WorkbenchEntryPoint that conforms to WorkbenchModelDefinition.
Starter files created by the app already use that shape:
import Foundation
import WorkbenchModelRuntime
enum WorkbenchEntryPoint: WorkbenchModelDefinition {
static func generate3MF(named modelName: String, at outputURL: URL) async throws {
try FileManager.default.createDirectory(
at: outputURL.deletingLastPathComponent(),
withIntermediateDirectories: true
)
let modelFile = try await ModelFileGenerator.build(named: modelName, options: .format3D(.threeMF)) {
Metadata(title: modelName, author: "ModelWorkbench")
Environment { $0.segmentation = .fixed(96) }
Box(40)
}
try await modelFile.write(to: outputURL)
}
}- Typing edits only the in-app buffer.
Saveformats the source when possible, writes it to disk, and rebuilds the artifacts.Formatupdates the editor buffer without saving.- Opening a model performs an initial sync build so preview files stay current.
- External file saves are detected and rebuilt after the file changes on disk.
The app no longer depends on repo-local scripts or a fixed repo layout.
The built .app bundles:
- the runtime framework used by model source files
- Swift module metadata needed by runtime compilation
- header and module-map support files needed by the Cadova dependency stack
That makes it suitable to copy into /Applications and use against model folders stored anywhere on disk.
ModelWorkbench still uses the system Swift toolchain and Apple USD command-line tools at runtime. In practice that means:
- Xcode or the Xcode command line tools must be installed
/usr/bin/usdchecker/usr/bin/usdcat/usr/bin/usdzip
Repo structure:
ModelWorkbench/Sourcescontains the macOS app target.Packages/ThreeDModels/Sourcescontains the local Swift package targets used by the app.Design/AppIconcontains the icon source artwork.Toolscontains repo maintenance scripts such as icon generation.
Regenerate the Xcode project after editing project.yml:
xcodegen generateBuild the app:
xcodebuild -project ModelWorkbench.xcodeproj \
-scheme ModelWorkbench \
-configuration Debug \
build CODE_SIGNING_ALLOWED=NO