Skip to content

Commit

Permalink
Math Formula: Fix small bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
WannesMalfait committed Mar 27, 2021
1 parent fd69eb8 commit d41b3fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion math_formula/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
bl_info = {
"name": "Node Math Formula",
"author": "Wannes Malfait",
"version": (1, 2, 0),
"version": (1, 2, 1),
"location": "Node Editor Toolbar and SHIFT+F or ALT+F",
"description": "Quickly add math nodes by typing in a formula",
"category": "Node",
Expand Down
4 changes: 4 additions & 0 deletions math_formula/changes.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.2.1
- Fix vector math `fract` not working.
- Fix separate xyz with one component always returning `x`.

v1.2.0
- Update positioning algorithm to work better with multiple outputs.
- Add support for the new vector math functions: 'Refract' and 'Faceforward'.
Expand Down
6 changes: 5 additions & 1 deletion math_formula/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ def execute(self, context):
a if a in data else None for a in ('x', 'y', 'z')]
node = self.add_separate_xyz_node(
context, nodes, name, components)
stack.append('x')
best_name = 'x'
for comp in components:
if comp is not None:
best_name = comp
stack.append(best_name)
if props.add_frame and nodes != []:
# Add all nodes in a frame
frame = tree.nodes.new(type='NodeFrame')
Expand Down
2 changes: 1 addition & 1 deletion math_formula/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
'normalize': ('NORMALIZE', 1),
'vfloor': ('FLOOR', 1),
'vceil': ('CEIL', 1),
'vfract': ('FRACT', 1),
'vfract': ('FRACTION', 1),
'vabs': ('ABSOLUTE', 1),
'vabsolute': ('ABSOLUTE', 1),
'vsin': ('SINE', 1),
Expand Down

0 comments on commit d41b3fd

Please sign in to comment.