✨ Shader Code Generation Tool for Visual Effects Developers
中文版本 | English
Magicka Creator is a plugin developed for JetBrains IDEs, designed to simplify the Shader development workflow. By integrating the Magicka CLI tool, it provides automated Shader template generation, supports multiple file formats, and helps developers quickly complete the conversion from Shader configuration to code.
- 🎯 Multiple File Format Support - Process
.sl.json,.spv.vert,.spv.fragfiles - ⚡ Keyboard Shortcuts -
Ctrl+Alt+Meta+L(Mac:Cmd+Ctrl+Alt+L) for quick file processing - 🔧 Automatic Environment Detection - Automatically check Node.js, npm, and Magicka CLI environment
- 📦 Version Management - Automatically detect CLI version, friendly prompt for upgrade when lower than 0.37.2
- 🌍 Internationalization Support - Complete Chinese and English interface support
- 🚀 Background Execution - Non-blocking command execution that doesn't affect IDE usage
- JetBrains IDE 2023.3 or newer (IntelliJ IDEA, PyCharm, WebStorm, CLion, etc.)
- Node.js and npm - Download and install
- Magicka CLI tool (plugin will automatically detect and prompt installation)
npm install -g @ks-facemagic/magicka --registry https://npm.corp.kuaishou.com# Clone the repository
git clone https://github.com/wysaid/magicka-intellij.git
cd magicka-intellij
# Build the plugin
./gradlew buildPlugin
# Plugin ZIP file located at: build/distributions/- Download the plugin ZIP file
- Open JetBrains IDE, go to
Settings/Preferences → Plugins - Click the gear icon ⚙️ →
Install Plugin from Disk... - Select the downloaded ZIP file
- Restart IDE
Right-click on a .sl.json file in your project, select Magicka → Process Shader Configuration, or use the shortcut Ctrl+Alt+Meta+L.
Configuration File Format Example:
{
"data": [
{
"vsh": "shader.spv.vert",
"fsh": "shader.spv.frag"
}
]
}The plugin will call the npx magicka generate-starlight-template command to generate the corresponding Shader template code.
Right-click on an SPV shader file, the plugin will:
- Automatically find all
.sl.jsonconfiguration files in the same directory - Filter configuration entries that contain references to the current file
- Generate temporary files for each matched configuration and call Magicka CLI to process
- Display processing result notifications
The plugin will automatically check on first run:
- ✅ Whether npm is installed (prompt to install Node.js if not)
- ✅ Whether
@ks-facemagic/magickapackage is globally installed - ✅ Whether Magicka CLI version >= 0.37.2 (checked once per IDE startup)
In the IDE, go to Tools → Magicka → About Magicka to view the plugin version and detailed information.
- Language: Kotlin 2.1.21
- Build Tool: Gradle 9.5
- Plugin Framework: IntelliJ Platform Plugin SDK (IntelliJ Platform Gradle Plugin 2.18.1)
- Target Platform: JetBrains IDEs 2023.3 or newer (automatically verified against the latest stable CLion)
- JDK: 17
# Build the plugin
./gradlew buildPlugin
# Launch test IDE (uses IntelliJ IDEA by default, can be tested in CLion)
./gradlew runIde
# Run tests
./gradlew test
# Clean build artifacts
./gradlew cleanmagicka-clion/
├── src/
│ ├── main/
│ │ ├── kotlin/org/magicka/
│ │ │ ├── MagickaBundle.kt # Internationalization resource loader
│ │ │ ├── MagickaIcons.kt # Icon resources
│ │ │ ├── HelpAction.kt # Help menu
│ │ │ └── action/
│ │ │ ├── MagickaOptionsGroup.kt
│ │ │ └── ProcessShaderJsonAction.kt # Core processing logic
│ │ └── resources/
│ │ ├── META-INF/
│ │ │ ├── plugin.xml # Plugin configuration
│ │ │ └── pluginIcon.svg # Plugin icon
│ │ ├── icons/
│ │ │ └── magicka_13x13.svg # Menu icon
│ │ └── messages/
│ │ ├── MagickaBundle.properties # English resources
│ │ └── MagickaBundle_zh_CN.properties # Chinese resources
│ └── test/
├── build.gradle.kts
├── settings.gradle.kts
└── .gitlab-ci.yml # CI/CD configuration
The project uses GitLab CI/CD for continuous integration:
- build - Compile and build the plugin
- test - Execute unit tests
- package - Package the plugin distribution
- release - Automatically archive artifacts on release
Right-click → Environment Check → Call npx magicka generate-starlight-template → Display Result
Right-click
→ Environment Check
→ Find .sl.json files in same directory
→ Parse JSON and filter matches
→ Generate temporary .processing.sl.json
→ Call Magicka CLI to process
→ Clean up temporary files
→ Display unified result notification
- All user-visible errors are displayed via dialogs or notifications, not exposed as IDE exceptions
- Log messages are recorded in English for development debugging
- Command execution timeout is set to 60 seconds to prevent long-term blocking
Go to https://nodejs.org/ to download and install Node.js, then restart the IDE after installation.
Run in terminal: npm install -g @ks-facemagic/magicka --registry https://npm.corp.kuaishou.com
A: Execute in terminal: npm update -g @ks-facemagic/magicka --registry https://npm.corp.kuaishou.com
A: Ensure that a .sl.json file exists in the same directory, and that the data array in the file contains the corresponding vsh or fsh field references.
Issues and Pull Requests are welcome!
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project is maintained by the Kuaishou FaceMagic Team.
- Organization: Kuaishou FaceMagic Team
- Email: [email protected]
- Repository: magicka-intellij
We welcome contributions from the community! See the Contributing section for more details.
Magicka - Making Shader Development Easier ✨
Made with ❤️ by Kuaishou FaceMagic Team