Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fbx exporter - Maya file naming #10

Open
smarcosanderson opened this issue May 5, 2018 · 9 comments
Open

Fbx exporter - Maya file naming #10

smarcosanderson opened this issue May 5, 2018 · 9 comments

Comments

@smarcosanderson
Copy link

First of all thanks for the initiative and the project!!

Well, I am facing some problems with the fbx export.
For a simple file, it is taking over 1 hour to complete the process, and failing in the last stage.

I changed a bit your code, since it was hanging my Unity.
the cause of that was the while loops being executed (and called through the Update function)

If you have a sample of fbx would be helpful. I tested with some from Mixamo, after open them in Maya and export as ASC II.

Many Thanks,
Marcos

Ps. I should mention that I notice that for Maya files, whenever some Transform is named with special character such as : the process fail showing the error: Could not find part of "transformName"_dataX

@newyellow
Copy link
Owner

Thanks for the report!
The naming issue is due to the naming limitations on the operating system though (windows / osx). Because the system not allowed characters like ':' or ']' as file's name, and my script is using your gameobject's name in Unity (which might include those characters), so the data writing process is failed.

And the FBX Export part, since the ASCII structure is a bit complicated to deal with, I have not complete the function yet (still lots of bugs). But I just found another way to export FBX very successfully.

Unity now offers "FBX Exporter" in AssetStore, and it can also export animations. You can use the UnityAnimationRecorder to record animations into Unity's .anim file format. And then you use the Unity's FBX Exporter to export the model with the animation. I've just test it and it was fast and successful. Please have a try!

@smarcosanderson
Copy link
Author

Wow!!
Thanks so much...
I will take a look on that.

I actually was coding on top of your code... I can send you later.
The problem with the long time was "for some reason" the IEnumerator.
So I took out put in another thread, and also changed a bit the way for getting nodes.
Now is much faster.
But I still need to get the animation... I hope I can get this working today... hahaha

@newyellow
Copy link
Owner

Sure, please feel free to make a pull request when you done, I will definitely look into it.

When I was doing the FBX part, I found there are some setting are really tricky. For example, the time unit FBX use to store the animation key frames, it is a very large number.

So I was thinking about using FBX SDK to export, rather than reading the ASCII code by myself. But I didn't want to learn FBX SDK that time lol. But after completing the very simple version of FBX exporter, I found there were too many problems, so I was thinking about the SDK again.

But ... now Unity release the FBX Exporter, and it's totally free. So maybe there's no reason to reinvent the wheel now though. :P

@smarcosanderson
Copy link
Author

smarcosanderson commented May 8, 2018

Hi, newyellow,

Well, for some reason I am getting some problems when I try to record Humanoid animation ( in .anim files) and then playing then in the same character.
Do you know how I could fix that?
image

Ah, also, do you know if it is possible to use the FBX Exporter in realtime? I dont think so, but...

About the fbx, I think I could export the information, however, the character seems broken... like all the bones were mixed...
image

@smarcosanderson
Copy link
Author

Nevermind!
I figured out!
The animation clip should be set as Legacy.

However, seems like it is not possible to have the runtime FbxExporter working.
Only working at UnityEditor... =/

@newyellow
Copy link
Owner

@smarcosanderson alright I will do some test today!

@smarcosanderson
Copy link
Author

Well, I did not actually do a pull, so my scripts are kind messy... but I zipped them here, so you can take a look if you want to....

I just change the ones in FbxExporter folder and also the TransformTracker, in order to use another thread.

General.zip

FbxExporter.zip

@newyellow
Copy link
Owner

@smarcosanderson thank you, I definitely check them out. I've done some test with the Unity's FBX Exporter , but it seems that humanoid animation is not supported for now (do not support hierarchy bones). So for now maybe the best way to export humanoid animation is through Maya Exporter.

@smarcosanderson
Copy link
Author

@newyellow sorry, but what you mean by, humanoid animation is not supported?

Because I could animate through your script (since setting the clip as Legacy) and then export it as a fbx at runtime, but only in the editor... I am looking for a way I could export it from the standalone player.

But, yes.. Maya has "less" complications, however, the application I am builting requires load and export of models at runtime... I could not find any runtime importer for Maya. otherwise, I would use it.
Do you know any?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants