Library
Asset browser for quickly adding objects to the scene
Overview#
The Library panel is an asset browser for quickly adding objects to your scene. Located on the left side (alternative to Hierarchy), it provides categorized access to primitives, lights, cameras, and custom assets with click or drag-and-drop creation.
Panel Layout#
┌─────────────────────────────┐
│ [Search...] │
├──────┬──────────────────────┤
│ │ │
│ Cat. │ Item Grid │
│ Tabs │ │
│ │ [Cube] [Sphere] │
│ │ [Plane] [Cylinder] │
│ │ │
└──────┴──────────────────────┘Default Categories#
| Category | Contents |
|---|---|
| Basic | Primitives: Cube, Sphere, Plane, Cylinder, Cone, Torus |
| Lights | Point Light, Directional Light, Spot Light, Area Light |
| Cameras | Camera, Orthographic Camera |
| RF/Wireless | Transmitter, Receiver, Radar, Antenna |
| Empty | Empty Object (for grouping) |
Adding Objects#
Click to Create#
Click any item to create it in the scene:
- Object appears 10 meters in front of camera
- Automatically selected after creation
- Name auto-incremented (e.g., "Cube", "Cube_1", "Cube_2")
Drag and Drop#
Drag an item onto the Viewport:
- Raycast Hit: Creates at intersection point with existing object
- Ground Plane: Creates at Y=0 if no object hit
- Fallback: Creates 10m from camera if no hit
Search#
The search box filters items across all categories:
- Type to filter items
- Shows "Search Results" header
- Clear to return to category view
- Case-insensitive matching
Python API#
Register Custom Categories#
from witwin import Library
# Register a new category
Library.register_category(
id="custom",
name="Custom Objects",
icon="box" # Lucide icon name
)Register Custom Items#
from witwin import Library
# Register a primitive item
Library.register_item(
id="my_cube",
name="My Cube",
category="custom",
mesh_type="Cube"
)
# Register a custom model
Library.register_item(
id="my_model",
name="My Model",
category="custom",
model_path="/models/custom.obj"
)Item Options#
Library.register_item(
id="configured_cube",
name="Configured Cube",
category="custom",
mesh_type="Cube",
# Optional parameters
default_material={
"color": "#ff0000",
"metalness": 0.5,
"roughness": 0.5
},
default_transform={
"position": [0, 1, 0],
"rotation": [0, 0, 0],
"scale": [1, 1, 1]
}
)Available Mesh Types#
| Mesh Type | Description |
|---|---|
Cube | Box primitive |
Sphere | Sphere primitive |
Plane | Flat plane |
Cylinder | Cylinder primitive |
Cone | Cone primitive |
Torus | Torus (donut) primitive |
Circle | Circle plane |
Ring | Ring plane |
Available Icons#
The Library uses Lucide icons:
| Icon | Typical Use |
|---|---|
box | Generic 3D object |
lightbulb | Light sources |
camera | Cameras |
radio | RF/Wireless |
folder | Empty/Group |
Usage Examples#
Setting Up a Custom Library#
from witwin import Library
# Create a category for building components
Library.register_category("building", "Building", icon="building")
# Register building items
Library.register_item("wall", "Wall", "building", mesh_type="Cube",
default_transform={"scale": [5, 3, 0.2]})
Library.register_item("floor", "Floor", "building", mesh_type="Plane",
default_transform={"scale": [10, 10, 1]})
Library.register_item("pillar", "Pillar", "building", mesh_type="Cylinder",
default_transform={"scale": [0.3, 3, 0.3]})RF Simulation Library#
from witwin import Library
# Custom RF category
Library.register_category("rf_custom", "Custom RF", icon="radio")
# Register RF components
Library.register_item("mimo_antenna", "MIMO Antenna", "rf_custom",
model_path="/models/mimo_antenna.obj")
Library.register_item("reflector", "Reflector Panel", "rf_custom",
mesh_type="Plane",
default_material={"metalness": 1.0, "roughness": 0.1})