Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/script_node.py
Created April 17, 2014 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/11002522 to your computer and use it in GitHub Desktop.
Save zeffii/11002522 to your computer and use it in GitHub Desktop.
import ast
t = """
# here is where one might create polygon index loops
types = int, int
vert_indices = [(i, i+1, i+7, i+6) for i in range({0}) if (i-{1}) % ({1}+1)]
"""
def local_temp(variable_inputs):
t = bpy.data.texts[self.text].as_string()
exec(t.format(*variable_inputs))
return vars()
a = local_temp((30, 5))
print(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment