← Blender.Today
  • 2
  • Published 3 Sep 2023

Been iterating on Conditional Formatting for Blender

Been iterating on the idea of Conditional Formatting in Blender a little more.

I made it so that the entire rule list is recalculated when making a change. This includes changes elsewhere in Blender, and not just when editing rules – thanks to depsgraph_update_post handler.

I also tried implementing a collection-based condition that operates on objects in the specified collection like you see in the GIF. And, I have moved all conditions to a separate dictionary from which the enums are generated for the properties.

Still haven’t figured out how to introduce weighted evaluation, i.e., not just depending on the order of the rules and preferring specific rules over broad selection even if they appear later down in the list. I think this would require some kind of tree building exercise to do this correctly.

Similar to the dictionary that houses all conditions, it would be useful to move all actions/outputs to a separate dictionary as well so they can be added easily.

One thing I am particularly interested in is reversing the changes when deleting a rule. Currently if we delete a rule, the changes introduced by the rule will stay. But I am wondering how we can reverse those changes, similar to how modifiers work. Lets see where it goes.

P.S For those who are interested in looking into the code, here is the link to the GitHub repo:

github.com/salaivv/blender-conditional-formatting/tree/main

salaivv
3 Sep 2023