automatic joint MEL ncloth bake not working

automatic joint MEL ncloth bake not working

yyumii
Advocate Advocate
2,279 Views
8 Replies
Message 1 of 9

automatic joint MEL ncloth bake not working

yyumii
Advocate
Advocate

Hello, I have an ncloth animation and I am following a tutorial to bake the ncloth and export as an fbx.

when I apply the script it seams to work with the joints moving with the cloth (screenshot below).

However, when i bake the joints, it does not look the same as the tutorials the joints separate from the mesh and when I test the exported, baked animation in another scene, there is no animation.  Am attaching my scene below. would appreciate any help.

 

https://www.youtube.com/watch?v=98KFcWcEuok

https://www.youtube.com/watch?v=ZjVbelfowpM&t=849s     at18min

0 Likes
Accepted solutions (1)
2,280 Views
8 Replies
Replies (8)
Message 2 of 9

Kahylan
Advisor
Advisor

Hi!

 

I tried it out, and for me it worked fine. I used used the (Animation Toolset, Keys-> Bake Animation) command and reset the settings before doing so and that worked. Ofcourse the joints and the cloth separated from each other when scrolling through the timeline, since that skipped some nucleus calculations, but when playing back the scene they stayed on the cloth. If it separates for you when playing back, make sure that you have the Animation playback setting on "play every frame", as you always should when doing simulation.

 

Now to the export/import issue. If you want to export animation with FBX, you need to make sure to have the "Animation" option checked in the FBX exporter Window, and to also check it on the FBX importer window when importing the FBX.

 

I attached the FBX that I created when trying this out.

 

Hope this helps!

0 Likes
Message 3 of 9

yyumii
Advocate
Advocate

Hello, Thanks so much for checking out my issue. 

I used keys>bake simulation. Is that the same as bake animation? 

I do have 'play every frame' checked. and have 'animation' option checked when exporting. 

I checked out your fbx and when i opened it. there was no plane, just the rig. Is that correct? 

I read online that the script only works with python2 or something like that. Did you use python2 or 3, because I think I have python3 in use. Will try it out again, maybe I missed something. Thanks so much for your help

0 Likes
Message 4 of 9

Kahylan
Advisor
Advisor

In Maya 2016 and higher, "Bake Simulation" and "Bake Animation" is basically the same, since both trigger the "bakeResults" command. Maybe the default Settings are slightly different, I'm not quite sure about that.

I used Maya 2018, which has Python 2.7 implemented and not Python 3. But I doubt that it is a Python issue, since Maya is Based on C++ and so are almost all plugins you can load in the Plugin Manager, so the python version doesn't really matter unless you use Python Plugins, which are mostly 3rd Party.

 

As to the FBX. Yes, it is only the Joints. The next step in you tutorials is to delete the history on the simulated cloth and skin bind it to the joints. So I didn't really see the use in making the FBX larger by adding simulated Geometry, just add the animated joints into your scene, delete the history on you plane (Edit->Delete By Type->History) and skinbind your plane to you joints (Rigging Toolset, Skin->Bind Skin), and it should work as desired.

 

Hope this helps!

0 Likes
Message 5 of 9

yyumii
Advocate
Advocate

So I just tried again, but each time I've done it, once i delete the history or remove the ncloth components, the rigs stop animating as well. when i press play, there is nothing. If i try binding anyways and press play, there is  still no animation. 

This time when I tried binding even though the animation stopped, I realized that the mesh that I thought was dissapearing just moved out of view in my scene. so something is there but its distorted. I tried it twice and got the same results. vid1 and 2. The I tried binding with default settings. The mesh plane looked fine but again, the rig was not animating. I tried to show all of my setting in the recording. If you could check it out I would really appreciate it. I don't know what I 'm missing...

again, thanks for checking this out.

0 Likes
Message 6 of 9

Kahylan
Advisor
Advisor

I looked at your videos, and you are skipping the step of baking the Animation to the joints, thats why nothing is moving after you delete the history, because your joints aren't animated, they are still following the constraints on the Plane.

The reason why your plane exploded in the second video, is because you scrolled through the timeline before you deleted the nucleus. As I already mentioned, when doing simulation, you shouldn't scroll through your timeline, you should play it back, because the nucleus can't handle frame skipping. So in that case, your nucleus skipped calculating the simulation, but when you deleted it, it was forced to provide the current state of the cloth at Frame you were at. Which is why you should always reset your timeline to Frame 1 whenever doing anything on your Simulation.

 

As you will see in the two videos I linked, I always play back the Animation and I always reset my Timeline to 1 before making the next step, as long as there is active Simulation in the Scene.

 

When I said that all you need to do is delete the History and bind the Skin, I meant using the animated FBX I provided. Like this:

 

https://youtu.be/WrjDqAfGxRI

 

But if you want to do it from scratch, you need to bake your animation first, before you delete the History. Like This:

 

https://youtu.be/NXYoFM5WJGQ

 

I hope this helps

0 Likes
Message 7 of 9

yyumii
Advocate
Advocate

Hi, So I followed your video and did not scrub through the timeline but used the playback button instead. Still, the rig is not animated after baking. I recorded my steps if you could take a look. apologies if I'm missing something really simple, but can't get it to work...

At this point I think I will try to install maya 2018 and see if that makes a difference.

really appreciate your videos, thanks.

0 Likes
Message 8 of 9

Kahylan
Advisor
Advisor
Accepted solution

I found the Problem!

I looked at your video and I saw that you are doing all the steps right, so I checked what settings are different in your Maya compared to mine. And I realised that you have "Cached Playback Mode" turned on (small blue glowing button at the bottom right of your timeline). So I turned it on as well and the Animation didn't bake for me either. I normally don't use this option so I didn't know it causes this problem.
If you turn off cached playback, it all should work fine.

 

Have a nice day!

0 Likes
Message 9 of 9

Anonymous
Not applicable

It works after turning that off! thanks you so much for you help!! I am now able to successfully apply the script /workflow to my actual scene.🙏

0 Likes