top of page

Import ALL alembic to Maya | Rename and IMPORT alembic files to Maya as is | Using Python

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

Recent Posts

See All
Udemy - Houdini VEX Programming for Beginners

In this series of lessons we will learn basics of Python language. We start with installing and setting up Python and Visual Studio Code for programming. Then will cover types of variables in Python t

 
 
 

Comments


bottom of page