ImAnim: Modern animation capabilities to ImGui applications
52 points
3 hours ago
| 5 comments
| github.com
| HN
jandrese
1 hour ago
[-]
I was interested and wanted to see how much the animations burn CPU and whatnot, so I cloned the repo and went to try to build the demo but everything went to hell. The build environment is some .net thing written in C#. It comes with a "bootstrap.sh" file to get it going that immediately fails, even after installing the dotnet development environment. I fiddled around with it for some time before giving up because I was hitting an error about a Targeting Pack that was going to require me to hit a Microsoft website to fix.

But the README says the build process it just a couple of files so I figured I could just build it by hand. This involved downloading a couple more repos from the author's repo and setting up some symlinks, includes, and defines that I figured out through trial and error, but in the end I was not successful in getting the demo to build. I tried a combo of SDL2 and OpenGL3 but it bombed out with a C++ error about too many initalizers. The only good news is that I was able to cleanly build the demo_im_app code, but the main requires the ImPlatform which appears to be buggy.

Update: I figured out that you need to run a git submodule update command first. The shell script is supposed to tell you this but it is broken. This does a bunch of work but then dies because g++ doesn't stick the string ".exe" on the end of executibles. Also, the script looks in the wrong place for the output. A few text fixes in the bootstrap.sh and generate_projects.sh files and it gets to a point where the build is dying due to not having "main" or "sharpmake" objects in the current context, whatever that means. I don't know enough about C# to go further, especially for what was supposed to be a quickie 10 minute test. I'm hoping someone else figures this out and updates the repo.

reply
mwkaufma
38 minutes ago
[-]
Bliss:

  Installation
  
  Add two files to your project:
  
  src/im_anim.h
  src/im_anim.cpp
  
  That's it. No build system changes, no external dependencies.
reply
SoufianeGfx
34 minutes ago
[-]
Exactly! And add the demo file to see it in action.
reply
elpocko
2 hours ago
[-]
ImGui is great if you need an ad-hoc UI for development/debug tools, but it's not meant to be used in actual applications aimed at end-users. I can't speak for other devs but I certainly wouldn't want my development tools waste time with pointless animations. I hope this doesn't encourage even more devs to build inaccessible software featuring ImGui's idiosyncratic, non-standard UX.
reply
hilti
2 hours ago
[-]
I agree with your points about ImGui's intended use case, though I think the landscape is a bit more nuanced. You're right that ImGui excels for dev tools and that its non-standard UX isn't ideal for end-user apps. That said, devs reach for ImGui in end-user apps because lightweight cross-platform alternatives are scarce. Qt is heavy, Electron is heavier, native toolkits mean multiple codebases. I built a techy tool with ImGui (JSONL Viewer Pro) and it works well enough for users who care more about functionality than polish. Not saying it's right for consumer apps, but for technical tools it can be pragmatic.
reply
Froztnova
15 minutes ago
[-]
I know that at least one modding framework for a certain online game makes use of ImGui (or some equivalent thereof). Given the use case it does make a lot of sense, considering they're essentially strapping a third party UI onto an existing 3D accelerated application, not sure what else you'd use for that. Since the users are technical enough to install the mod framework anyways, they tend to be the sort that can handle the UI.

It can be a bit wonky though, I regularly spot UI/UX decisions that seem to map more closely to what the developer is doing under the hood, or their own mental model of the problem, than what one might consider to be an intuitive way of interacting with the system.

reply
embedding-shape
1 hour ago
[-]
It also have bindings for a ton of languages, so for people who jump languages a lot, it's always nice to be able to reach for something more familiar that you can learn across different codebases but same concepts. Same thing for the backend/engine, UI code remains the same, but easy to switch to others or even wrapping it yourself for platforms that are under NDA.
reply
swatcoder
2 hours ago
[-]
For applications where the aim is high sales volume and low support, you're absolutely right.

But "development/debug tools" is actually just a subset of professional or industrial utility applications where user count is low and support is on the extremes (either "capable self-support" or "Yes, Bob, of course we'll add that for you").

And in those utility applications, you probably don't need the noisy toy animations associated with modern consumer software, but animated data representations can be really valuable.

reply
dymk
1 hour ago
[-]
IME, it's great for building full standalone applications. I've used it to build several internal tools for non-engineers. A tool like that doesn't need to work with a screen reader, or have native buttons, etc. It needs to be easy to build and iterate on.

This isn't to say a tool for non-engineers should have animations to make it useful. ImAnim should probably be used sparingly, if at all.

If you need the features of a full GUI toolkit, then by all means use Qt or wxWidgets etc, but that's a very big jump in project complexity.

reply
klaussilveira
2 hours ago
[-]
imgui success is a silent protest from tons of C++ developers, fed up with the over-engineering and enterprise-ification of everything in this bloated ecosystem.
reply
binary132
18 minutes ago
[-]
“and that’s a bad thing!”
reply
ryanmcbride
3 hours ago
[-]
oh wow this timing is incredible for me thank you, this is exactly the type of thing I needed and this is EXACTLY my aesthetic
reply
erichocean
3 hours ago
[-]
If the author is around, can you do a short writeup on how this implemented? I've got my own immediate-mode UI framework and am curious how you did it.
reply
SoufianeGfx
1 hour ago
[-]
The author here. You have various concepts but overall we store the start time and that's it :D the rest are details, clip, tween, easing function, anchor have surviving resizing, stagger to generate the same anim with variations. Or variations of clips, loop. Proper anim of colors in oklab, oklch, linear srgb, hsl, ... Anyway I cannot explain much it's really simple code with a userfriendly front-end.
reply
erichocean
26 minutes ago
[-]
Thanks, I had Claude walk me through the code if anyone is curious:

https://claude.ai/share/12357895-d585-4475-93fb-cdb5eba5dd76

tl;dr It's not an implicit animation framework like Core Animation or CSS animations. Instead, each frame you get the current value which is then used, and the actual tween curve only changes when you call a tween function with a new target; otherwise, you get the current (tweened) value since the last time the target changed (which might be the final value).

reply
hilti
2 hours ago
[-]
Not the author but it‘s implemented in only two files which can be studied on Github.
reply