Blint - customizable Blender "linter" for project standardization

Ever hit “Render” but realized you forgot to revert a setting? Wished Blender would automatically check certain settings in your blend file for you, before sending off to a render farm? Well, look no further than blint!
semagnum/blint: Blender project linter (github.com)

Once installed, you can find blint in the scene properties:

image

How does it work?

It lists each rule (or instance of each rule, will get to that), and if configured, an “auto fix” option - change that setting or remove the default cube with just a click!

You can not only create a rule for a given setting, but a rule for checking collections of settings, such as names of each object in your project, or each material. In this example, blint checks for all objects that have numeric suffixes resulting from duplication:

Creating your own rules

You can manage your rules and even append an external json in the preferences:
image

An external config JSON allows you to make your own rules. You want to forbid objects named “Maya?” Go ahead! For each rule, you get to customize:

  • If the rule is enabled by default
  • Rule description
  • Icons correlating to the rule severity and category (object, mesh, etc.)
  • Simple Python expressions for detecting the issue, and optionally for the fix

Check out the README for specifics and how to create them.

Offline linter

For those who want to run a lint check without even opening the file, I included an offline Python script to run blint. Give it your Blender executable path and a path to your blend file (or folder of blend files) and run it!

If you find this useful, please let me know! I believe this has a lot of potential for team projects and project standardization.

7 Likes

Very interesting idea. It reminds me of autocad templates that enforce using certain layer names, line types, colors, etc.

I can see this being very useful in team projects where it’s important that everyone shares the same workflow / naming conventions.

The json configuration file semantics means that only python and blender-API savvy people will be able to configure it to their need though. But great potential !

PS I know this was for demo purposes but FWIW this
"bpy.ops.object.select_all(action='DESELECT'); bpy.context.scene.objects['Cube'].select_set(True); context.view_layer.objects.active = bpy.context.scene.objects['Cube']; bpy.ops.object.delete()"

can be reduced to "bpy.data.objects.remove(bpy.data.objects['Cube'])"

1 Like

Thank you, and those were my thoughts exactly!

The json configuration file semantics means that only python and blender-API savvy people will be able to configure it to their need though.

Yes, that is something I did notice and would like to be more accessible - maybe a UI or right-click menu of sorts. For simple checks and fixes, the right click “Copy Full Data Path” on properties will suffice, but I agree that only those already familiar with Python and bpy would be able to fully utilize this.

I know this was for demo purposes but FWIW this can be reduced to…

Ahh, I changed it in the actual config json but forgot to update it in the README, thank you!

Very interesting… have to read this later (my brain is shutting off although it isn’t that late :sleepy:)

1 Like

Update: blint’s offline linter now supports auto fixing of issues. If the rule has an automated fix, then you can add a “–fix” or “-f” flag to fix these issues as it goes. Oh, and the argument parser is standardized and way better :smile:

Update: you can now create rules within the add-on preferences section!

You can choose the type of blend data you want to check (objects, scenes, cameras, etc.), select relevant severity and category icons, and copy-and-paste expressions by right clicking on properties in Blender (the last part is built-in to Blender, this add-on just takes advantage of that). It even has a debug panel so you can test to see if it’s detecting (and fixing) the issue correctly.

1 Like