Is it possible to import a .fbx file without overwriting the same meshes already in the scene?

Is it possible to import a .fbx file without overwriting the same meshes already in the scene?

malcolm_341
Collaborator Collaborator
1,416 Views
15 Replies
Message 1 of 16

Is it possible to import a .fbx file without overwriting the same meshes already in the scene?

malcolm_341
Collaborator
Collaborator

With most import file types if you export a file and then import that same file, it will create a duplicate in the scene. With .fbx for some reason if you do that it deletes the meshes you currently have in the scene and "updates" them to what you imported if the names are shared. Is there anyway around this with code, ideally I'd just like .fbx import to work the same as .ma import.

0 Likes
Accepted solutions (1)
1,417 Views
15 Replies
Replies (15)
Message 2 of 16

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

If you want to solve this using code you can use the FBXImporter MEL command:

 

https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2023/ENU/Maya-Dat...

 

the "FBXImportMode" flag must be set to "add" to stop it from overwriting existing nodes.

 

But it can also be done using the UI, by setting the "Include>File Content" option to "Add" instead of the default "Add and uptdate animation".

 

I hope it helps!

Message 3 of 16

malcolm_341
Collaborator
Collaborator

That's prefect, that's exactly what I needed. I can get it working through code, but I coldn't find it when using the file import options, what part of the UI does the preference exist in?

0 Likes
Message 4 of 16

Kahylan
Advisor
Advisor

It's part of the FBX import window that automatically opens when a FBX File gets opened.

 

Setting_FBX.png

 

I hope it helps!

Message 5 of 16

malcolm_341
Collaborator
Collaborator

I've been looking for that menu for a literal 10+ years, thank you very much, that clears up everything.

File Menu> Import Options Box> File Type fbx> Edit Preset

0 Likes
Message 6 of 16

MayaNZ01
Enthusiast
Enthusiast

I'm sitting here wondering how to get it to overwrite as currently it just doesn't import 😆 Overwrite would be much more useful when updating the model in other software and bringing it back, albiet more destructive 

0 Likes
Message 7 of 16

MayaNZ01
Enthusiast
Enthusiast

maya_q0tOnGPQQH.png

 Just curious where that is? Maybe this a new thing for 2023

0 Likes
Message 8 of 16

malcolm_341
Collaborator
Collaborator

@MayaNZ01change file type to .fbx as mentioned in my above post and then edit preset to reveal the .fbx import options.

0 Likes
Message 9 of 16

damaggio
Mentor
Mentor

one more...Import_Add.jpg

Message 10 of 16

MayaNZ01
Enthusiast
Enthusiast

I found that menu but still can't get it to actually update the geometry, even tried with code but it just doesn't import over something that exists. I want it to overwrite the geometry with any changes. I'm probably doing it wrong because even swapping to add does nothing

 

 

FBXImportMode -v merge;
FBXImport -f "E:/Users/OEM/Desktop/WORK/fbx.fbx";

 

 

0 Likes
Message 11 of 16

malcolm_341
Collaborator
Collaborator

The names have to be the same as far as I know, I think for whatever part you want to update the name in Maya and the name in the .fbx has to be exactly the same when you import the .fbx file it will then update the mesh in place in Maya.

Message 12 of 16

MayaNZ01
Enthusiast
Enthusiast

I guess it's just a 2018 bug or a bug with my maya specifically then as it will only import if I rename the object I want to update to prevent the name clash

Message 13 of 16

malcolm_341
Collaborator
Collaborator

Should work the same in 2017 to current because the default setting of update in place has annoyed me for 10+ years.

 

If you want to import the mesh and have it added to the scene no matter what set File Content to Add

 

If you want to import the mesh and have it update the current mesh in the scene the names must match exactly between the two files and you need to set File Content to Add and Update Animation which should be the default

 

A good way to test this is make a sphere in Maya, export selected as .fbx and turn on triangulate in the exporter then just import that file you just exported and you should see the sphere in Maya be triangulated because it was updated in place.

Message 14 of 16

malcolm_341
Collaborator
Collaborator

@MayaNZ01 

Nevermind, I just tested this and it doesn't update the mesh like I thought, making the default setting really confusing. It appears only some attributes on the mesh are updated like scale, so I guess this is more for importing animation? But, the mesh can get out of sync easily so I'm not really sure why you'd want this setting, maybe for a one way animtion pipeline? Either way, the only time I can get the new mesh into the scene is by changing the setting to add and then it will import the mesh, but you have to delete the current mesh before or after import.

Message 15 of 16

MayaNZ01
Enthusiast
Enthusiast

It is truly bizarre. And the mesh replacement is just what I'm used to with zbrush importing which is why I like it, regardless of if it's destructive. Most of the software bridges do the same, updating the mesh with the same name. The issue is some of these bridges are quite buggy which is why I was hoping default fbx importing would be able to do the same without having to make a complicated batch obj importer, but it doesn't

0 Likes
Message 16 of 16

malcolm_341
Collaborator
Collaborator

I actually created a tool by request for Zbrush users so they could send  .obj files between Zbrush and Maya reliably. I guess GoZ is buggy or something. Here's what I came up with if you're interested in having a look https://youtu.be/5ALeT_VyqKE?list=PLAUgGUDpaMENfz8Nd7Zw-LxDK_v5ZflY6

0 Likes