0

Working on a batch exporter that is able to export different objects into different files at the same time (with one button). I am using cmds.file or mel.eval('FBXExport') to export the fbx files. I got trouble with exporting a specific object based on its name. Like no matter whether I select anything or how many objects I select, it only exports the object named 'cube'. Is there any way to achieve this goal?

The python code I used to export. They can only export my selected objects.

cmds.file(filepath, force = True, options = "v = 0", type = "FBX export", exportSelected = True) 

mel.eval('FBXExport -f "%s" -s'%(filepath) )

When I used the code above to export, it exports all objects I selected, not the one named 'cube'.

ZTZML
  • 11
  • 1
  • 5

1 Answers1

1

I solved the problem right after I asked this question! just adding cmds.select command.

for obj in sel:
    **cmds.select(obj)**
    cmds.file(filepath, force = True, options = "v = 0", type = "FBX export", exportSelected = True) 

Hope it can help other people who have the same question.

ZTZML
  • 11
  • 1
  • 5