Help Export Obi Cloth Simulation as Alembic File - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html) +--- Thread: Help Export Obi Cloth Simulation as Alembic File (/thread-2929.html) |
Export Obi Cloth Simulation as Alembic File - orestissar - 13-05-2021 Hello there, I have a scene with a human avatar wearing a shirt(the garment is divided in separate parts like: front/back torso, sleeves etc). I have succesfully created (you helped me in another thread !) a script that creates all obi components and adds them to the Shirt. Everything is working fine so far. Using the Alembic library from the package manager, im able to export the scene into an alembic format. However, when i load and play the new alembic object in the scene the shirt dissapears in the alembic animation after a while. I tried to export the same avatar/shirt before adding the OBI components and in this case the alembic animation works fine. What i mean is that when the shirt is OBI, it dissapears from the alembic. Do you possibly have any idea/solution of why this happens? Thanks a lot beforehand! RE: Export Obi Cloth Simulation as Alembic File - josemendez - 21-05-2021 (13-05-2021, 01:28 PM)orestissar Wrote: Hello there, Hi, It's hard to say without taking a direct look at it. Maybe you're using the same (shared) mesh for both Alembic and Obi? If you could send a repro project to support(at)virtualmethodstudio.com I'll be glad to take a look. RE: Export Obi Cloth Simulation as Alembic File - orestissar - 21-05-2021 (21-05-2021, 08:49 AM)josemendez Wrote: Hi,Hi, I m not sure how i can actually do that. I can try export it as unity package but i dont think it will make much sense to you. I ll try share some screenshots with you. So in the first one, u can see the object's hierarchy i try to export as alembic. The Object named OBI is the solver component and all the children are working OBI's. The alembic exporter script is the official script from the Unity Packages. I just feel like the "OBI information" is lost during the alembic export process. and this results into the shirt dissapearing. My goal is to export an alembic file, that contains the same animation as if it was a runtime obi simulation. RE: Export Obi Cloth Simulation as Alembic File - josemendez - 24-05-2021 I can't see anything wrong with your settings. Tried this myself, but can't reproduce any weird behavior. Quote:I just feel like the "OBI information" is lost during the alembic export process. and this results into the shirt dissapearing. Obi stores all information as particle data. Unless Alembic is purposely tinkering with particles (which is likely not the case), I can't think of any reason for this data to be lost. I think the only way to solve this is for me to take a loot at your scene/project directly. If possible share a unity package, will see if I can help you that way. RE: Export Obi Cloth Simulation as Alembic File - orestissar - 24-05-2021 (24-05-2021, 09:04 AM)josemendez Wrote: I can't see anything wrong with your settings. Tried this myself, but can't reproduce any weird behavior.Hey again! I will try send you my unity package with WeTransfer! Thank you so much for your time and help! RE: Export Obi Cloth Simulation as Alembic File - orestissar - 01-06-2021 (24-05-2021, 11:22 AM)orestissar Wrote: Hey again! I will try send you my unity package with WeTransfer!Hello ! Do you have any update on this? RE: Export Obi Cloth Simulation as Alembic File - josemendez - 01-06-2021 (01-06-2021, 09:32 AM)orestissar Wrote: Hello ! Hi, I see you're using skinned cloth instead of regular cloth. Unity's SkinnedMeshRenderer does not accept meshes with no bone weights, which is required for cloth simulation. So Obi removes the mesh from the SkinnedMeshRenderer and renders it itself using Graphics.DrawMesh. You can see the code for this is ObiSkinnedClothRenderer's UpdateRenderer() method. What Alembic does is it exports SkinnedMeshRenderer's sharedMesh data (since it knows nothing about Obi). So once you enable Obi's LateFixedUpdater component in your code, Alembic will cease to export data for the mesh (as it has moved from SkinnedMeshRenderer's sharedMesh to ObiSkinnedClothRenderer's clothMesh). This is why the cloth disappears from alembic file after a while: you enable the updater after a while using a coroutine, and right at that moment, Obi "hijacks" mesh rendering and Alembic loses track of the mesh. There's several possible solutions. One would be modifying the AlembicExporter_impl to deal with ObiSkinnedClothRenderer. Another, simpler possibility is to write a simple component that takes the cloth mesh and puts it in a regular MeshRenderer so that Alembic can pick it up. Like this: Code: using UnityEngine; Adding this to each of your cloth SkinnedMeshRenderers, it will create a child gameobject with a MeshRenderer and feed it Obi's clothMesh so that Alembic can pick it up. Remember to untick AlembicExporter's Static MeshRenderers checkbox, or it will ignore MeshRenderers too. kind regards, RE: Export Obi Cloth Simulation as Alembic File - orestissar - 03-06-2021 Thank you so much for all this feedback! I need to check all these and i will get back to you with updates! I hope I will make it work! Thank you a lot and I appreciate the help! |