Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

FBX import with merge

FBX import with merge

Anonymous
Not applicable
7,107 Views
22 Replies
Message 1 of 23

FBX import with merge

Anonymous
Not applicable

I think there may be a bug in Maya 2018 related to merging an imported FBX into an existing one and specifying a custom namespace.

Running the operation manually, using File->Import... works as expected.

However, if I copy the resulting file command from the script editor (see below) and run again, in a fresh target file, the operation does not work as expected. It's as though the target namespace is being ignored, but only when run from the script editor.

 

Here's the mel command that fails:

file -import -type "FBX" -ignoreVersion -ra true -mergeNamespacesOnClash true -namespace ":mocap" -options "v=0" -pr -importFrameRate true -importTimeRange "override" "C://TestFiles/mocapSource.fbx";

 

This is directly copied from the script editor after successfully merging an animated skeleton with bones in namespace "mocap" into a non-animated rig file which has the same hierarchy.

The problem is that when run from the script editor, the keyframes on matching bones are not copied as expected. Only if I first delete the namespace does it work. And yet, manually, it works great....weird.

 

Any ideas? Would really appreciate any help! Thank you!

 

-Len

 

 

 

0 Likes
Accepted solutions (1)
7,108 Views
22 Replies
Replies (22)
Message 21 of 23

Anonymous
Not applicable

Hey, I already have two solutions:

 

1. Before import set a current namespace and then import, after import you can set it again to root for example

 

import maya.cmds as cmds

NameOfNamespace = "test"

cmds.namespace( set=NameOfNamespace)

 

cmds.file(animationPath, i=True, ignoreVersion=True, importTimeRange="override", namespace=":", mergeNamespacesOnClash=True, ra=True, prompt=False)

 

cmds.namespace( set=':' )

 

 

2. You can also use FBX SDK with Python bindings for delete/add namespace in source fbx file

Message 22 of 23

Anonymous
Not applicable

Same here not working. Using:

cmds.file(ImportPath, i=True, renameAll=True, mergeNamespacesOnClash=False);

0 Likes
Message 23 of 23

Anonymous
Not applicable

It works like I said, you have to set current namespace before import, just follow my previous post

 

and make sure you have checked "update animation"

 

import maya.mel as mel

mel.eval('FBXProperty Import|IncludeGrp|MergeMode -v "Update animation";')

mel.eval('FBXProperty Import|IncludeGrp|Animation -v true;')

0 Likes