GithubHelp home page GithubHelp logo

semagnum / blint Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 2.0 2.99 MB

Blender project linter

Home Page: https://semagnum.github.io/blint/

License: GNU General Public License v3.0

Python 100.00%
blender blender-addon blender3d linter

blint's Introduction

Hello, welcome to my page!

Blender

Within Blender, I create art as well as develop tools, some of which I sell online. You can find my art at portfolio.pixelfed.social/smagnusson, but my free tools live here, including:

  • Light Painter - "turns light design in Blender on its head: instead of manipulating the lights, you indicate how you want them to appear on your models by painting their influence. Very cool and innovative!" - Blender Nation
  • Scene Complexity - convenience add-on that retrieves scene statistics to better understand geometry and node tree complexity.
  • BLint - automate standardization and file conventions on the Blender projects.

semagnum's Github grade

blint's People

Contributors

semagnum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blint's Issues

Use UI List template

  • filtering based on description
  • sort by severity type

Currently, the rows are dynamically made from the rules, so multiple rows can be made from one rule. So it doesn't work with the panel for the iterative rules. Need to create a separate class for the issues themselves.

More accessible creation of rules: UI-based

Need a sort of creation system for rules:

  • for issue detection, could copy and paste data path(s) into rule, check for specific value.
  • for the auto-fix, ideally macro-based. User starts recording, does the fix, stops recording.
  • iterative rules and fixes would get more complicated - research needed

Right click context menu option

I would like to hover over a field/property, and in the context menu, have the option to BLint issue with this rule. The following options would be available:

  • "custom", opens up preferences with fields auto-filled
    • category icon based on area/region or property path
    • bpy.data is in property path, add it to iterable expression
  • "must be this value", creates a rule where the property must be the current value

Pre-render check

Add an option to throw an error/warning prior to rendering if any errors or info's exist.

Enable/disable rules

  • add a UI list in the preferences to enable/disable different rules
  • must be able to persist during reloads - make a cache right before clearing. Based on description, or make a "rule id" of sorts"

GUI version of offline linter

Add a button and file/folder selection form field so users can run the offline linter without needing to open up the terminal. Use Blender's own Python executable.

  • Add operator to run offline linter. Use Blender' own Python executable.
  • In the preferences, add said operator as a button and a StringProperty as a file/folder field to select where to run it
  • Convert operator to modal so it doesn't block/freeze UI

Some Index errors in the console

Doesn't seem to break anything (ie being caught), but there's some index out of bounds errors in the console for some issues. Will try to replicate it again and figure out the root cause.

Github Pages

Especially for newcomers, there's enough learning and documentation to be more than a README.

  • Installation
  • Creating rules
  • How to enable/disable or delete rules

Offline linter

It'd be good to have a script that runs the linting process offline on a Blender file or directory full of Blender files.

Config settings:

  • from the addon

  • from an external config in Blender preferences

  • from a separate config file

  • Powershell

  • Python

Edit existing rules within the preferences

There's currently no way to edit an existing rule. It would need to be a subpanel for editing rules (or "replaces" the new rule subpanel) - a modal would disappear as the user leaves the area. And being able to copy-and-paste from other areas of Blender is essential.

New default rule: texture checks

A new rule to include in the internal config: for every image texture, check that it has a valid path or it's packed into the file

Better iterable_var name replacement in issue expression and fix statements

Smaller variable names can be problematic as the current name replacement is a simple replaceAll, especially for smaller names. For example, an iterable var of s with an issue expression of:
s.cycles.use_preview_adaptive_sampling
would become:
bpy.data.scenes['Scene'].cyclebpy.data.scenes['Scene'].use_preview_adaptive_bpy.data.scenes['Scene']ampling

Can use regex with boundaries to ensure that it's a whole word and not just part of one.

Update Fix button arrangement

Currently there is a "Fix" button on each row of the issues list. To relax the UI space, I should:

  • add a "Fix selected" button below the list, which will run a fix on the issue currently selected
  • add a "Fix All" button below the list, which will run the fix on all issues that can be auto-fixed
  • remove the "fix" button for each row, but have an icon for issues that have an auto-fix

Convert print statements to logging

In most cases, I'd say convert these print statements to actual exceptions. But in this case, there's few operators included where it makes sense to put them. So instead, any print statements not underneath an operator should be put within a logger.

Error after installing the plugin and enabling it!

Blender3.6/BLint-0.31
Traceback (most recent call last):
File "G:\Blender Program\stable\blender-3.6.0-windows-x64\3.6\scripts\modules\addon_utils.py", line 369, in enable
mod.register()
File "C:\Users\CP\AppData\Roaming\Blender Foundation\Blender\Big addons\addons\BLint_init_.py", line 64, in register
model.register()
File "G:\Blender Program\stable\blender-3.6.0-windows-x64\3.6\scripts\modules\bpy\utils_init_.py", line 744, in register
register_class(cls)
ValueError: register_class(...): already registered as a subclass 'LintIssue'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.