wavezz1 / import_osu_addon

Imports Osu! Beatmaps and Replays into Blender
1 stars 0 forks source link
addon beatmap blender import osu replay

Blender Importer for osu! Beatmaps and Replays

First and foremost, I don’t know what I’m doing, but I had a goal: importing osu! beatmaps and replays into Blender, ready for Geometry Nodes, so I can create some fancy simulation node setups.

That’s where trusty ol’ ChatGPT came into play. The code is roughly based on 90% of GPT’s work and 10% me banging my head against the wall trying to fix things after GPT broke them.

This addon builds on osrparse, which helped with parsing .osr files.

CAUTION: Replays with the intro skipped are broken due to an issue in osrparse's latest versions. osrparse v6.0.2 is currently used

What it Does

This addon imports a rough version of both the replay and the beatmap, applying a Geometry Nodes modifier that stores attributes based on drivers referencing offset variables for keyframe timings, etc.

You can then add a separate Geometry Nodes object that, for example, takes all hitobjects and spawns them in a simulation zone according to the "show" attributes.

The Driver system is based on the properties of individual hitobjects, whose values can be keyframed. I wanted to avoid using viewport and render keyframes and instead used a more flexible solution.

Installation

  1. Download the Addon:

    • Download the .zip file of this addon from the Releases page.
  2. Install the Addon in Blender:

    • Open Blender.
    • Go to Edit > Preferences > Add-ons.
    • Click Install... at the top-right corner.
    • Select the downloaded .zip file.
    • Enable the addon by checking the box next to its name.
  3. Install osrparse:

    • Within the addon, click the "Install osrparse" button if you don't have it installed already. This ensures that the addon can correctly parse .osr replay files.

Blender Proof of Concept v0.6

  1. Import osu! Beatmaps and Replays:

    • Use the addon interface to select and import your .osu beatmap and .osr replay files.
  2. Geometry Nodes Setup:

    • The addon will create Geometry Nodes modifiers for different hitobject types (Cursor, Circle, Slider, Spinner), each storing relevant attributes.
  3. Access the Attributes:

    General Geometry Nodes Setup General Geometry Nodes setup.

    Circle Geometry Nodes Setup Geometry Nodes setup for Circle hitobjects.

    Slider Geometry Nodes Setup Geometry Nodes setup for Slider hitobjects.

    Spinner Geometry Nodes Setup Geometry Nodes setup for Spinner hitobjects.

Geometry Nodes Attributes

Cursor Attributes

Circle Attributes

Slider Attributes

Spinner Attributes

Current Features

Known Issues

Ending Words

I only have basic Python knowledge, so please don’t murder me over bad code. Any help to make this work correctly is highly appreciated. Feel free to do whatever you want with the code.

At the end of the day, getting osu! replays and beatmaps into Blender for dynamic 3D replays would be really cool, right?