Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiSofbody problems in runtime with separate solver and initialized state
#1
Hello

I am working with ObiCloth before but I wanted to switch to ObiSofbody. But it is not possible due to several critical programs and missing functionality.

1. I am not able to get it work in runtime when I have Solver separately. It seems like ObiSofbody required to have solver attached to it when it is instantiated. Because when I assign it later simulation is not working as it should. Looks like Skinner stop working.
In my application, I use lots of soft-bodies with just one solver as a prefab and I assign it in runtime for object I want to simulate. 
I've reproduces it on test scene (with blue Balls)

2. I also not able to get it work when ObiSofbody is not in initialized state in prefab. And I have problems with creating prefabs with Initializing state. This is not working in prefabs preview mode (Unity 2018.3 or later). So I do initialization in runtime by using GeneratePhysicRepresentationForMesh() and it is not working for ObiSoftbody but working great with ObiCloth.

3. It looks like ObiSofbody and ObiSofbodySkinner are know about each other in Awake method. I expect a problems with it because Unity is not guarantie Awake method calling order.

So what I need:
- Allow me to setup ObiSofbody with external Solver, Initlize it, change it fields ect. And then when I am done I can call AddToSolver to get it simulated. This is currently not working.

Thanks
Reply
#2
(07-05-2019, 06:37 PM)mmortall Wrote: 1. I am not able to get it work in runtime when I have Solver separately. It seems like ObiSofbody required to have solver attached to it when it is instantiated. Because when I assign it later simulation is not working as it should. Looks like Skinner stop working.
In my application, I use lots of soft-bodies with just one solver as a prefab and I assign it in runtime for object I want to simulate. 
I've reproduces it on test scene (with blue Balls)

I'm not able to reproduce this. Make sure that you're calling the skinner's BindSkin() coroutine, or else it won't work.

(07-05-2019, 06:37 PM)mmortall Wrote: 2. I also not able to get it work when ObiSofbody is not in initialized state in prefab. And I have problems with creating prefabs with Initializing state. This is not working in prefabs preview mode (Unity 2018.3 or later). So I do initialization in runtime by using GeneratePhysicRepresentationForMesh() and it is not working for ObiSoftbody but working great with ObiCloth.

I can't reproduce any of the above either. Initializing a softbody works fine for me regardless of it being a prefab or not. Also, GeneratePhysicRepresentationForMesh() works the same for all actors, there's no reason why it should work for some but not for others. Can you provide a repro scene/project, or at least share your initialization code?

(07-05-2019, 06:37 PM)mmortall Wrote: 3. It looks like ObiSofbody and ObiSofbodySkinner are know about each other in Awake method. I expect a problems with it because Unity is not guarantie Awake method calling order.

Nope. ObiSoftbodySkinner's Awake() method only takes care of finding a default value for the "Source" property, which is the first ObiSoftbody it finds up its hierarchy. This only done for convenience when manually adding a component in editor. You're supposed to provide a soft body yourself when using it programmatically:

Code:
skinner.Source = softbody;
StartCoroutine(skinner.BindSkin());
Reply
#3
(08-05-2019, 07:32 AM)josemendez Wrote: I'm not able to reproduce this. Make sure that you're calling the skinner's BindSkin() coroutine, or else it won't work.


I can't reproduce any of the above either. Initializing a softbody works fine for me regardless of it being a prefab or not. Also, GeneratePhysicRepresentationForMesh() works the same for all actors, there's no reason why it should work for some but not for others. Can you provide a repro scene/project, or at least share your initialization code?


Nope. ObiSoftbodySkinner's Awake() method only takes care of finding a default value for the "Source" property, which is the first ObiSoftbody it finds up its hierarchy. This only done for convenience when manually adding a component in editor. You're supposed to provide a soft body yourself when using it programmatically:

Code:
skinner.Source = softbody;
StartCoroutine(skinner.BindSkin());

Thanks. I am calling BindSkin() coroutine but it does not help me. Probably I am doing something wrong. I will send you a test project later this week.
Reply