Dynamically checking the correctness of an expression in the IDE (Blender):
- Not a complete expression.
cis specified, but it is not added by the
- The value of the
Floattype is not completed.
- There is no closing parenthesis.
- Limit in 10 input variables (I don’t think I will need more):
- Validation occurs when entering values in the expression field. Therefore, in order to fix the 2nd situation, you need to click on
Add Value, and then click on the expression input field again. Otherwise, the verification algorithms will be executed every time the node interface is drawn, or it is necessary to replace the button handlers.
The task is divided into 2 parts: checking the correctness through python in the Blender interface and when performing calculations when the application is running in haxe.
The following decisions are taken as a basis:
- python - http://repl.it/3xv/1
- haxe - https://github.com/maitag/formula (added all the necessary classes to the node code)
If you have any ideas for optimization and algorithms, I’d love to hear (I’m not that good with Python and Haxe).
- There is a lot of code than usual. Nobody minds that?
- I will optimize this node, but it’s not fast, is there a need to lay it out like this?
- I’m waiting for suggestions and can anyone test and look for errors in the processing.