Post #3098: bl

📋 Metadata

🏷️ Tags

python-scripting intermediate solved

  • Python Scripting
  • Macro Editor
  • execute_script

💬 Content

blndrusr:

Hey @roaoao,
When I run a any script by execute_script("..."), all variables and their values are lost once the script is executed. Is there a way to preserve all variables together with values so they are still accessible when the script gets executed next time?

You can store your variables in pme.context.globals dict:

pme.context.globals.get("my_var_name", "my_default_value")
pme.context.globals.update(my_var_name="my_value")

❤️ 3 likes


🔗 View on Blender Artists