Skip to content

A Blender console reader for Linux. Hacked together using hopes and dreams, guided only by "trust me bro" at 3am

License

Notifications You must be signed in to change notification settings

OwenTheProgrammer/Blender-Linux-Terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blender-Linux-Terminal

A Blender console reader for Linux. Hacked together using hopes and dreams, guided only by "trust me bro" at 3am

Tip

Yes, I was hungry when I named this project (still am..)

If you have ever worked with Blenders python API, you will find yourself in one of two seats, depending on which platform you work with:

  • Windows developer: You're living the luxury of Topbar > Window > Toggle System Console. This project will be useless to you.
  • Linux developer: Eyyyyy don't you love opening Blender from a terminal just to see whats yelling at you? Better yet, do you have Blender installed on Steam? making it a royal pain in the ass to launch with a shell?

I've been both classes, but tonight I've had enough of the second.

What does the BLT do?

BLT automatically finds and displays blenders log file in realtime, without the need to open blender through a command line.

Note

To avoid ironic situations, BLT reopens in a shell if you run it like an executable, so you don't have to open a terminal to run the terminal reader.

It does this by

  • Searching for Blenders PID using pgrep -ni blender, checking again once every second to not max the hell out of your poor CPU thread
  • Reading the symlink filepath of fd/1 using readlink -f /proc/<pid>/fd/1, blindly assuming thats the log output path
  • Opening that log file and immediately reading its contents to the stdout of the shell/terminal
  • Starting an inotify watchdog, waiting for the log file to change or close
  • Reading the new log data when the watchdog says something happened

That's literally it. In all seriousness, this is just a glorified bash script that automatically finds Blenders log file and executes tail -f path/to/blender/log. I'd personally recommend having a skim through the source code (it's not that much) just to verify with yourself that this project isn't doing something horrible. If it is though, that was definitely not my intention lol

The projects built off hack-code and probably the most "trust me bro" programming I've ever done.. but if it works, it works! 👍

Compilation

Compiling is pretty standard cmake stuff

# Debug is default
cmake -S . -B bin/

# Release
cmake -S . -B bin/ -DCMAKE_BUILD_TYPE=Release
cmake --build bin/ -j16

aaaaaaaaaaaaaaannd enjoy I guess.. Imma go make food now.

About

A Blender console reader for Linux. Hacked together using hopes and dreams, guided only by "trust me bro" at 3am

Topics

Resources

License

Stars

Watchers

Forks