# Importing multiple object files in Maya-mel script

**URL:** https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881
**Category:** Maya
**Tags:** mel
**Created:** [March 8, 2005, 10:01pm UTC](https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881 "2005-03-08T22:01:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sanjana2509](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@sanjana2509](https://forum.highend3d.com/u/sanjana2509)
#### Post date: [March 8, 2005, 10:01pm UTC](https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881/1 "2005-03-08T22:01:41Z")

</div>

Hi ,

I'm trying to import 1500 odd object files from XSI to Maya..so that I can do a blend shape and recreate the animation....I'm using a linux machine so I can't do a shift select...So im trying to write a mel script that will do that...I'm fairly new to maya and I'm get an error on this script..hope someone can help me

int $i;  
for($i=1;$i\<=1500;$i++)  
file -import -type "OBJ" -namespace "oo" -options "mo=1" -pr "/masters/srajendran/test/oo." &$i& ".obj";

my files name is oo.1.obj etc....I get an error in line 3..Hope someone can help me out..My projects due in 3 days so im really desperate!!  
sanjana

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [March 8, 2005, 10:32pm UTC](https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881/2 "2005-03-08T22:32:02Z")

</div>

just out of curiosity why even bother to create the blendshape?

---

<div class="post-metadata">

### Author: ![sanjana2509](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@sanjana2509](https://forum.highend3d.com/u/sanjana2509)
#### Post date: [March 8, 2005, 11:25pm UTC](https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881/3 "2005-03-08T23:25:16Z")

</div>

I'm trying to import animation from XSI to maya..and fbx doesnt work coz one of our characters has a tail rig which gets screwed up...my prof suggested this alternative method..where u export every frame of animation from xsi to maya as a obj file and do a blend shape of each body part and key frame the first and last key to play back the animation...hope that answers ur question

---

<div class="post-metadata">

### Author: ![amitc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@amitc](https://forum.highend3d.com/u/amitc)
#### Post date: [March 10, 2005, 11:55pm UTC](https://forum.highend3d.com/t/importing-multiple-object-files-in-maya-mel-script/3881/4 "2005-03-10T23:55:11Z")

</div>

try this  
int $i;  
for($i=1;$i\<=1500;$i++)  
{  
//String concatenation uses +   
$name="/masters/srajendran/test/oo." + $i + ".obj";   
file -import -type "OBJ" -namespace "oo" -options "mo=1" -pr $name;   
}
