Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  A Native Collection has not been disposed.
#1
Hi,
I tested Obi Cloth on Unity  2021.2.03 Beta and also the current 2020 LTS version and on both I'm getting error messages:  A Native Collection has not been disposed. (On raycast scene). I installed all the required packages. 

Also in the beta the simulation seems to break
Is it compatible with the 2021.2.03 Beta version?


Attached Files Thumbnail(s)
                   
Reply
#2
Hi there!

I'm unable to reproduce this issue on 2020 LTS, I assume you're using the Burst backend?


Quote:Is it compatible with the [/size]2021.2.03 Beta version?

Alpha/beta versions are not supported, precisely because they're only meant for testing/preview.
Only production versions are guaranteed to work.

On a side note, just in case: never use a beta release to do any real work. They might (and very often do) contain bugs/glitches.
Reply
#3
Hi Jose, thanks you for the quick response!

I'm not using beta for real work I was curious if it will work with the upcoming version... 

I created a clean project with LTS and on the sample scene "Cloth Raycast" I'm getting this error:

https://ibb.co/9rmCfBT

Here's a video of the clean install: https://www.youtube.com/watch?v=pWXhTJYqoDg

You can see the error at the end. I used Burst backend and I installed all packages.

Speaking of real work, we currently are developing an app to preview scanned data. Our scanner is generating a body shape with a rig (mixamo like) and then uploads it to a database. With the app I can then access to my account and view my scanned body with measures provided by the scanner... 

Her's how it works:
 

The goal is to use this library to generate a shirt and pants that adapts to the avatar but I'm a bit confused and I hope you will point me to the write direction  Sonrisa 

We have as an input a fully rigged avatar in T-pose, my plan was to create for example a T-shirt spawn it in the world and then I need to somehow match the body shape and then skin the shirt to the body. After this I would use the obi components (Obi Skinned Cloth) to simulate it because having a true simulation with obi colliders attached to all bones is too dangerous, I need to figure out how to wrap the body with the shirt, skin it and then apply Obi skinned cloth to simulate it.

Body Shape 1:https://ibb.co/vQWQDq3
Body Shape 2: https://ibb.co/m59LfZ5
Body Shape 3: https://ibb.co/phFcZq1

This is the feature that I need to implement. Since you are more experienced than me with this stuff could you give me some tips on how would you implement it, thanks!
Reply
#4
(15-07-2021, 02:48 PM)chris_stamati Wrote: You can see the error at the end. I used Burst backend and I installed all packages.

Will try to reproduce and provide a patch asap. Thanks!

(15-07-2021, 02:48 PM)chris_stamati Wrote: [....]because having a true simulation with obi colliders attached to all bones is too dangerous

...and expensive Guiño

(15-07-2021, 02:48 PM)chris_stamati Wrote: I need to figure out how to wrap the body with the shirt, skin it and then apply Obi skinned cloth to simulate it.
This is the feature that I need to implement. Since you are more experienced than me with this stuff could you give me some tips on how would you implement it, thanks!

The hardest part of this is skinning the cloth to the character's body at runtime, in an efficient way that also results in good enough skinning (generating the cloth from the skinned mesh is comparatively very easy). There's two feasible approaches for skinning that I can think of:

- Copy skin weights from the closest vertex in the body. This is conceptually simple and will work well if the amount of vertices in the body and the cloth is similar. You can either copy from the closest vertex in the body, or use a distance weighed average of the n closest vertices. To make this fast, you will have to put the body into some sort of spatial acceleration structure -grid or bvh, for instance- so that you don't need to check all body vertices for each cloth vertex (which would be quadratic cost).

- Use geodesic voxel skinning. This is the best entirely automatic skinning algorithm I've come across. The idea is to voxelize the volume occupied by the cloth mesh, then determine skin weights for each vertex by calculating the closest path from the vertex to each bone, traversing the voxel structure. You can think of this as bones emitting "heat" which gets diffused trough voxels, each vertex gets bound to the n "hottest" bones. Here's an article describing it:

http://www.delasa.net/data/sca2013_voxelization.pdf

I have a (working) rough implementation of this if you're interested.
Reply
#5
Hi Jose,

Thank you very much! 

I did some research on geodesic voxel skinning and I read the paper you sent me and It's very interesting unfortunately most of the stuff in that document I didn't understand it and it's ok I'm a dumb .NET developer  Sonrisa


Quote:I have a (working) rough implementation of this if you're interested.


But If you have an implementation I don't mind looking at it, I'm actually very curious to see how it works   Ángel

So I ended up with the first approach: 

Quote:Copy skin weights from the closest vertex in the body. 


I think I will stick to this approach, today I imported a shirt mesh in unity and I skinned to the mesh at runtime by copying the weights from the avatar and it gets the job done. After I added the obi cloth components and everything worked like magic  Gran sonrisa

Here's a test, it's still not perfect I have to tweak some stuff:



The shirt was already fitting the avatar size, and since the scanner will generate different body shapes in T-pose I need to make the shirt fit the body shape. Do you know any library or algorithm to wrap a mesh to a body?

Thanks again!
Reply
#6
Hi Chris,

Just sent you a PM with a link to the geodesic voxel skinning project.

let me know if I can be of any help!
Reply
#7
Thank you very much Jose!  Corazón
Reply