diff options
author | Vladimir Spivak(cwolf3d) <cwolf3d@gmail.com> | 2021-04-11 20:46:12 +0300 |
---|---|---|
committer | Vladimir Spivak(cwolf3d) <cwolf3d@gmail.com> | 2021-04-11 20:46:12 +0300 |
commit | adb9e98dd4a7b7d586b054d1559db977caf920f0 (patch) | |
tree | 5be589681370eeaa0304ab6427933b90bf07c414 /add_mesh_extra_objects | |
parent | ededc65bec57881c54b101ce6cb4b337705849f3 (diff) |
Fix T87212: Multiple-Parameter Functions for Math Surfaces in Extra Objects
Diffstat (limited to 'add_mesh_extra_objects')
-rw-r--r-- | add_mesh_extra_objects/add_mesh_3d_function_surface.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/add_mesh_extra_objects/add_mesh_3d_function_surface.py b/add_mesh_extra_objects/add_mesh_3d_function_surface.py index 2faae605..c4520adc 100644 --- a/add_mesh_extra_objects/add_mesh_3d_function_surface.py +++ b/add_mesh_extra_objects/add_mesh_3d_function_surface.py @@ -1,6 +1,8 @@ # GPL # original by Buerbaum Martin (Pontiac), Elod Csirmaz import bpy +import math +import numpy from mathutils import * from math import * from bpy.types import Operator @@ -13,13 +15,18 @@ from bpy.props import ( # List of safe functions for eval() -safe_list = ['math', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'cosh', +safe_list = ['acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod', 'frexp', 'hypot', 'ldexp', 'log', 'log10', 'modf', 'pi', 'pow', 'radians', - 'sin', 'sinh', 'sqrt', 'tan', 'tanh'] + 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'gcd'] # Use the list to filter the local namespace safe_dict = dict((k, globals().get(k, None)) for k in safe_list) +safe_dict['math'] = math +safe_dict['numpy'] = safe_dict['np'] = numpy +safe_dict['lcm'] = numpy.lcm +safe_dict['max'] = max +safe_dict['min'] = min # Stores the values of a list of properties and the |