5 ms·
I love blender. Software developers on hackernews HAVE to try out the blender python api. It's just an integral part of my workflow especially for modding game
by norwalkbear 4y ago
I love blender.
Software developers on hackernews HAVE to try out the blender python api.
It's just an integral part of my workflow especially for modding games.
- coldpie 4y agoHaha the Blender Python API! Back in high school, a friend and I wrote a 3D platforming video game from scratch. The on-disk 3D model format we used was something I just came up with. It was plaintext ASCII where we would write in every vertex and tex coord by hand, and the engine would turn those over to the obvious OpenGL functions. That was obviously stupid, so my friend learned how to use Blender and wrote an exporter to my format using its Python API. You can read a bit about it here[1] on our old website, written in 2005 when we were around 17 years old. Memories. My friend eventually went on to develop & commercially release a 3D platforming game called Poi[2]. [1] https://brightnightgames.com/games.php?game=sa&sec=development https://brightnightgames.com/games.php?game=sa&sec=developme... [2] https://en.wikipedia.org/wiki/Poi_(video_game) https://en.wikipedia.org/wiki/Poi_(video_game)
- worldsayshi 4y agoWhat things do you typically use the API for? I can't come up with anything off the top of my head where you'd rather use the API than the GUI.
- norwalkbear 4y agoBasically automating variant creation and modifying assets for various level of details. Also automatic fixing of imported models from various game ripping sites.
- capableweb 4y agoLess useful since Geometry Nodes were included, but generative/procedural stuff was only possible via the API for a long time. Besides that, every single addon is leveraging the Python API, so basically any functionality you get from installing an addon. Besides that, I've written bunch of macros as basically python files I execute in Blender to do repetitive tasks. Another thing I've done is writing a distributed render queue for headless rendering, using the Python API.
- deleted 4y ago[deleted]
- lijogdfljk 4y agoI've been using it to automate behavior of an asset pipeline for a game. Basic stuff, like taking many assets and putting them in the right location, combining several things, rendering, on demand (not at runtime, but based on usage in the game), etc. Neat thing too is it's in Rust, not Python.. because, well, i prefer and know Rust, and by doing it in Rust it works with the rest of my game code so that on-demand stuff i mention plugs in nicely to my existing ecosystem. Note that i'm using Py03 for Rust, so it's just Rust<->Python. Not native Rust support or anything
- boppo1 4y agoSuppose I want to keyframe 200 birds or something, taking off two at at time about every second with a bit of randomness. Oh, I want there to be some variation in their colors. And I just realized I want the interpolation on all of them to be linear, not bezier. That's 50+hours of tedious gui work reduced to 4 hours with the API.
- aequitas 4y agoBlender’s API is the entire reason I started venturing into the Python ecosystem. Found out I was no good at designing 3D but a lot better at programming.
- pwenzel 4y agoI use Blender's Python API for transforming 3d objects to render on my analog oscilloscope. Demo: https://www.youtube.com/watch?v=thWgiEtQs7A https://www.youtube.com/watch?v=thWgiEtQs7A Blender Tutorial: https://www.youtube.com/watch?v=AQLimxRDFWc https://www.youtube.com/watch?v=AQLimxRDFWc
- smcnally 4y agoThe oscilloscope visuals makes everything more watchable. Everything on your SRS channel looks fun.
- afpx 4y agoApologies for the GPT hijack, but I've been having a lot of fun creating procedurally-generated scenes in blender using GPT Chat. For example "write code in python using blender libraries to create a scene that contains a procedurally-generated mobius strip" Usually the results are pretty good.
- norwalkbear 4y agoOhh nice. Have any links?
- runevault 4y agoI've pondered learning it but hadn't gotten around to it. Any particular resource you recommend as a starting point? Because being able to automate certain things myself sounds great, though I'm super rusty on python.
- tapia 4y agoI love blender, but the Python API is really unpythonic. I really wish you could treat the different things as objects and not by referencing then by their names. Nevertheless, it's pretty cool to automate some things I have to do at work (I am a civil engineer working in research)