Import ALL alembic to Maya | Rename and IMPORT alembic files to Maya as is | Using Python
- Deepak KG
- Jul 17, 2021
- 1 min read
A small python snippet to IMPORT all Alembics from a Folder into Maya and rename them as per the File Name

Code :
import maya.cmds as cmds
pathOfFiles = "J:/ROOT/Project/SC001/SH001/FX/UserName/ABC_path/"
files = cmds.getFileList(folder = pathOfFIles, filespec = '*.abc')
if len(files) == 0:
cmds.warning("No ABC Files")
else:
for f in files:
returnedFiles = cmds.file(pathOfFile + f, i = True, rnn = True)
allABCs = cmds.ls(returnedFiles, type = 'transform')
print f
### To Rename the Files
for i in allABCs:
fileRename = f[4:]
fileRename = fileRename[:-4]
cmds.rename(i, fileRename)
#### Happy Coding Python
Comments