Chord Serialization (Copy/Paste)¶
Chord Song supports atomic chord serialization for easy sharing and backup of chord snippets. This feature enables you to copy selected chord mappings to your clipboard and paste them into another configuration or share them with others.
Full Configuration Management
For complete configuration backup and restore, use Import & Export. Copy/Paste is designed for quick sharing of specific chords.
Overview¶
The serialization format uses compact JSON designed to be:
- Minimal and human-readable: Easy to inspect and understand
- Validatable: Clear structure with version tracking
- Forward-compatible: Designed to handle future format changes
- Atomic: Can represent single chords or sequences
Copy/Paste Operations¶
Selecting Chords¶
Each chord mapping has a checkbox on the left side that allows you to select it for copy operations:
- Individual Selection: Click the checkbox next to any chord to select/deselect it
- Select All: Click the "Select All" button to select all visible chords in the current context
- Deselect All: Click the "Deselect All" button to clear all selections
Copying Chords¶
There are two ways to copy chords:
- Copy Selected: Select one or more chords using checkboxes, then click "Copy Selected"
- Copy Single: Click the copy icon (📋) next to any chord to copy just that chord
The chord data is copied to your clipboard as JSON.
Pasting Chords¶
- Copy chord data to your clipboard (from Chord Song or another source)
- Click the "Paste" button
- The chords will be added to your current configuration
- A conflict check runs automatically to detect any duplicate chord sequences
JSON Format¶
Structure¶
{
"version": 1,
"chords": [
{
"chord": "g g",
"label": "Frame Selected",
"icon": "󰆾",
"group": "View",
"context": "VIEW_3D",
"mapping_type": "OPERATOR",
"enabled": true,
"operator": "view3d.view_selected",
"call_context": "EXEC_DEFAULT"
}
]
}
Required Fields¶
Every chord must have:
chord: The key sequence (e.g.,"g g")mapping_type: One ofOPERATOR,PYTHON_FILE,CONTEXT_PROPERTY, orCONTEXT_TOGGLE
Optional Common Fields¶
label: Display name (default: empty)icon: Nerd Font icon (default: empty)group: Category name (default: "Ungrouped")context: Editor context (default:"VIEW_3D")enabled: Whether the chord is active (default:true)
Mapping Type-Specific Fields¶
Operator Mappings¶
{
"mapping_type": "OPERATOR",
"operator": "view3d.view_selected",
"call_context": "EXEC_DEFAULT",
"kwargs_json": "use_all_regions=False"
}
operator: Blender operator IDcall_context:"EXEC_DEFAULT"or"INVOKE_DEFAULT"kwargs_json: Optional operator parameterssub_operators: Optional array of additional operators to chain
Script Mappings¶
{
"mapping_type": "PYTHON_FILE",
"python_file": "/path/to/script.py",
"kwargs": {
"param1": "value1",
"param2": 42
}
}
python_file: Path to Python scriptkwargs: Optional parameters dict (keys prefixed with_start new rows)
Property Mappings¶
{
"mapping_type": "CONTEXT_PROPERTY",
"context_path": "space_data.shading.type",
"property_value": "'SOLID'",
"sub_items": [
{
"path": "space_data.shading.light",
"value": "'STUDIO'"
}
]
}
context_path: Property pathproperty_value: Value to set (Python expression)sub_items: Optional array of additional properties
Toggle Mappings¶
{
"mapping_type": "CONTEXT_TOGGLE",
"context_path": "space_data.overlay.show_face_orientation",
"sync_toggles": false,
"sub_items": [
{
"path": "space_data.overlay.show_wireframes"
}
]
}
context_path: Toggle property pathsync_toggles: Whether to sync all sub-toggles (default:false)sub_items: Optional array of additional toggles
Use Cases¶
Sharing Chord Presets¶
Share your favorite chord configurations with others:
- Select the chords you want to share
- Click "Copy Selected"
- Paste the JSON into a text file, Discord, GitHub, etc.
- Others can copy the JSON and use "Paste" to add them
Backup Specific Chords¶
Quickly backup important chords before experimenting:
- Select the chords you want to backup
- Click "Copy Selected"
- Save the JSON to a text file
Migrating Between Contexts¶
Copy chords from one context to another:
- Switch to the source context tab
- Select and copy the chords
- Switch to the target context tab
- Paste the chords
- The chords will be added with their original context, or you can edit them
Validation¶
When pasting chords, the system validates:
- JSON syntax
- Required fields presence
- Mapping type validity
- Version compatibility
Warnings are shown for any issues, but the paste operation continues for valid chords.
Conflict Detection¶
After pasting, the conflict checker runs automatically to detect:
- Duplicate chords: Same chord sequence in the same context
- Prefix conflicts: One chord is a prefix of another (e.g.,
gandg g)
Conflicted chords are highlighted in red in the UI.