Skip to content

Instantly share code, notes, and snippets.

@AndrewHazelden
Last active December 9, 2015 11:37
Show Gist options
  • Save AndrewHazelden/13e988c70340acd96696 to your computer and use it in GitHub Desktop.
Save AndrewHazelden/13e988c70340acd96696 to your computer and use it in GitHub Desktop.
Use Python to separate a filepath into the base directory, the file, and the filename without an extension
import os
mxsFilePath = 'C:/Program Files/Next Limit/Maxwell 3/scripts/stereo/CubeX.mxs'
# Find out the current scene file
dirName = os.path.dirname(mxsFilePath)
sceneName = os.path.basename(mxsFilePath)
scenePathNoExt = os.path.splitext(mxsFilePath)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment