Skip to content

Instantly share code, notes, and snippets.

@fereria
Created March 11, 2014 14:31
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 fereria/9486924 to your computer and use it in GitHub Desktop.
Save fereria/9486924 to your computer and use it in GitHub Desktop.
importExpression
def importExpression(exp_path):
if os.path.exists(exp_path) == True:
expName = os.path.splitext(os.path.basename(exp_path))[0]
if pm.objExists(expName) == True:
expObj = pm.PyNode(expName)
else:
expObj = pm.nodetypes.Expression(n=expName)
exp_io = fileIO.fileIO(exp_path)
flag,lists = exp_io.readLines()
expObj.setString("\n".join(lists))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment