Drag and Drop MilkDrop Preset (.milk) feature!
OfficialIncubo opened this issue · 3 comments
Milkdrop2077 (a.k.a. serge000) posted a latest tweet that supports drag and drop feature of presets and custom shapes/waves code.
If you drag and drop any files, such as .obj, .png .gdb etc, the Standalone Visualization gives an error (like Pixel Shader Error) that said "Error: Failed to load preset (.milk) or format. [.extension] not supported.".
All I need is to use 'case WM_DROPFILES' or drag and drop implementation technique like, and accept it to load .milk preset files.
Well, the Drag and Drop implementation worked with an help of ChatGPT (told me on DMs by @milkdrop2077), but something happened when I load a preset with any files except .milk file.
The thing I'd say is:
- Add a logic that if the file extension is
.milk, then load it, else get an error.
The part of code that didn't work and needs to be modified:
if (len < 5 || wcsicmp(convertedFileName + len - 5, L".milk") != 0)
g_plugin.LoadPreset(convertedFileName, 0.0f);
else
{
wchar_t buf[1024], tmp[128];
swprintf(buf, L"Error: Failed to load dropped preset file: %s", wchar_t(convertedFileName), tmp, 128);
g_plugin.AddError(buf, 5.0f, ERR_NOTIFY, true);
}
ssstwitter.com_1709670932359.mp4
I'll close the issue after this fix. ;)
The Drag and Drop MD Preset Feature now working than intended, but here are some issues:
- It doesn't load some presets if the file name has unsupported characters, e.g. £, В
- It retrieves a full path of the dropped file as an error. We need to retrieve only the file name and extension.
In conclusion, this feature will remain as BETA. I'll close this issue for now because it's fully working.

