Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compilation error in Obi Softbody 6.3
#1
Hello!
Today I have updated to last version of Obi Softbody (6.3). Now I have compilation error: 

Assets\Obi\Scripts\Softbody\Rendering\ObiSoftbodySkinner.cs(341,103): error CS1061: 'NativeSlice<BoneWeight1>' does not contain a definition for 'Sort' and no accessible extension method 'Sort' accepting a first argument of type 'NativeSlice<BoneWeight1>' could be found (are you missing a using directive or an assembly reference?)

Unity 2020.3.20f1. I tried to create new 3D project, still have the same error.

Best Regards,
Andrey Sasin
Reply
#2
(23-11-2021, 04:05 PM)sasinandrei Wrote: Hello!
Today I have updated to last version of Obi Softbody (6.3). Now I have compilation error: 

Assets\Obi\Scripts\Softbody\Rendering\ObiSoftbodySkinner.cs(341,103): error CS1061: 'NativeSlice<BoneWeight1>' does not contain a definition for 'Sort' and no accessible extension method 'Sort' accepting a first argument of type 'NativeSlice<BoneWeight1>' could be found (are you missing a using directive or an assembly reference?)

Unity 2020.3.20f1. I tried to create new 3D project, still have the same error.

Best Regards,
Andrey Sasin

Hi Andrey,

Make sure you've installed the package dependencies, specifically the Collections package. See:
http://obi.virtualmethodstudio.com/manua...setup.html
http://obi.virtualmethodstudio.com/manua...kends.html

Open up the package manager, click the "+" sign at the top and select "Add package from git url". Then, type com.unity.collections and install it. That should solve this.

Let me know how it goes!
Reply
#3
I just made a slight modification so that you don't need to install the collections package just because of this (normally it would only be required in order to use the Burst backend, that while highly recommended, is not mandatory). Replace the ObiSoftbodySkinner component with the one you will find attached to this post. It will fallback to another sorting method in case the collections package is not installed.

cheers,


Attached Files
.cs   ObiSoftbodySkinner.cs (Size: 18.02 KB / Downloads: 5)
Reply
#4
Thank you for your response. After updating package one more time it started works. But with Oni backend. I tried to install dependencies for burst as it's described in documentation but I have the same error as in this topic:
Issues getting Softbody working (virtualmethodstudio.com)
I tried Unity 2020.3.20f1 and 2021.2.3f1.
Updated. Added screenshot.


Attached Files Thumbnail(s)
   
Reply
#5
Not sure if it helps, but I tried to fix it by myself. I looked at error in Visual Studio, and it has some more details.
The type 'T' must be valid unmanaged type....or struct type with all fields of unmanaged types...
I just changed 
Code:
where T : struct

to
Code:
where T : unmanaged
for RemoveRangeBurst and now it works fine for me.
Reply
#6
(23-11-2021, 11:42 PM)sasinandrei Wrote: Not sure if it helps, but I tried to fix it by myself. I looked at error in Visual Studio, and it has some more details.
The type 'T' must be valid unmanaged type....or struct type with all fields of unmanaged types...
I just changed 
Code:
where T : struct

to
Code:
where T : unmanaged
for RemoveRangeBurst and now it works fine for me.

Yes, that should do it. The latest version of the collections package (1.1.0, released yesterday) changed the constraints for NativeArrays, so its generic type must now be unmanaged, instead of struct. Thanks to TimConkling for alerting of this:
http://obi.virtualmethodstudio.com/forum...l#pid11286

Will upload a patch to the store asap.
Reply
#7
(23-11-2021, 11:50 PM)josemendez Wrote: Yes, that should do it. The latest version of the collections package (1.1.0, released yesterday) changed the constraints for NativeArrays, so its generic type must now be unmanaged, instead of struct. Thanks to TimConkling for alerting of this:
http://obi.virtualmethodstudio.com/forum...l#pid11286

Will upload a patch to the store asap.

What about: Assets\Obi\Scripts\Softbody\Blueprints\ObiSoftbodyVolumeBlueprint.cs(62,32): error CS1503: Argument 1: cannot convert from 'UnityEngine.Vector3' to 'UnityEngine.Matrix4x4 and Assets\Obi\Scripts\Softbody\Blueprints\ObiSoftbodyVolumeBlueprint.cs(65,56): error CS0122: 'MeshVoxelizer.voxels' is inaccessible due to its protection level

Only updating the 4 obi assets to 6.3 errors start to pop up Triste
Reply
#8
(24-11-2021, 10:29 AM)manurocker95 Wrote: What about: Assets\Obi\Scripts\Softbody\Blueprints\ObiSoftbodyVolumeBlueprint.cs(62,32): error CS1503: Argument 1: cannot convert from 'UnityEngine.Vector3' to 'UnityEngine.Matrix4x4 and Assets\Obi\Scripts\Softbody\Blueprints\ObiSoftbodyVolumeBlueprint.cs(65,56): error CS0122: 'MeshVoxelizer.voxels' is inaccessible due to its protection level

Only updating the 4 obi assets to 6.3 errors start to pop up Triste

Hi Manu!

ObiSoftbodyVolumeBlueprint has been removed, as they're now integrated into surface blueprints. Please check the changes list:
http://obi.virtualmethodstudio.com/forum...-3196.html


Either remove ObiSoftbodyVolumeBlueprint .cs from your project if you're installing on top of an older version, or do a clean install.
Reply