Post #1054: ![](https://blenderartists.org/user_avatar/blenderartists.org/frankieh/48/670768

📋 Metadata

  • Author: roaoao
  • Date: 2017-10-16 09:53:08
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_01053

🏷️ Tags

macro python-scripting intermediate solved

  • Macro Editor
  • Python Scripting
  • execute_script function

💬 Content

FrankieH:

Hi Roaoao thanks for all your previous help.

I’m trying to make a script run from pie menu editor (99% not mine)

https://pastebin.com/u3dTB8Gs

works fine when I run from the text editor but says this when I use pme with this command ‘execute_script(“scripts/vertex_color_objects_gradient_blue.py”)’

NameError: name ‘Vector’ is not defined

Hi, FrankieH.
Copy this line to remap function:

def remap(current, lower_old, upper_old, lower_new, upper_new):
     from mathutils import Color, Vector

Will try to fix this issue in the next version.


🔗 View on Blender Artists