Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Cloth stop working once adding another solver/mesh
#1
Hi there
I have a cloth mesh in my scene as a hair simulation (local space).
 when i try to add another cloth component to the scene (this time in the pants of the character) the hair stops working, i've tried to add another solver for the new cloth but without help. when adding another solver/cloth comp to the scene the first cloth stop working. 
and ideas what can cause that? 

(we've purchase both cloth and softbody, the guy in charge of purchasing them will send me the invoice/order number later today)
Reply
#2
(24-02-2019, 09:45 AM)drorlazar Wrote: when i try to add another cloth component to the scene 

I was running into a similar issue. I started tracing the issue from an ObiHandle and found that (in my particular case) the handle was not applying its behavior because the callback delegate was not being called.

I believe this is because the ObiSolver component is using a static boolean variable('frameBegan') to track the beginning frame (since physics may tick multiple times).

However, when I spawn more than 1 cape, it's random which one will actually stay on the character's back. Consider the following code snippets; when one of the capes Enters its Update, it prevents the following capes from having their 'OnBeginFrame' delegate being called back for ObiHandles to function.

I'm curious if there's a bug or pending refactor, I'm not to a point where I can start making assumptions  Sonrisa (but this seems like a similar symptom)

ObiSolver.cs
Code:
void Update(){

    if (Application.isPlaying){
        BeginFrame(false);
        //...
    }
}
void BeginFrame(bool fixedUpdate){

    if (!frameBegan){
    frameBegan = true; //<^ only 1 solver in the scene will exhibit full behavior
        //..
        if (OnFrameBegin != null)
        OnFrameBegin(this,EventArgs.Empty);
    //...
    }
}
Reply
#3
(24-02-2019, 06:55 PM)scripts Wrote: I was running into a similar issue. I started tracing the issue from an ObiHandle and found that (in my particular case) the handle was not applying its behavior because the callback delegate was not being called.

I believe this is because the ObiSolver component is using a static boolean variable('frameBegan') to track the beginning frame (since physics may tick multiple times).

However, when I spawn more than 1 cape, it's random which one will actually stay on the character's back. Consider the following code snippets; when one of the capes Enters its Update, it prevents the following capes from having their 'OnBeginFrame' delegate being called back for ObiHandles to function.

I'm curious if there's a bug or pending refactor, I'm not to a point where I can start making assumptions  Sonrisa (but this seems like a similar symptom)

ObiSolver.cs
Code:
void Update(){

   if (Application.isPlaying){
       BeginFrame(false);
       //...
   }
}
void BeginFrame(bool fixedUpdate){

   if (!frameBegan){
    frameBegan = true; //<^ only 1 solver in the scene will exhibit full behavior
       //..
       if (OnFrameBegin != null)
        OnFrameBegin(this,EventArgs.Empty);
    //...
   }
}

This is a known bug and has been fixed in 4.0.3 (yet unreleased). You can find the fix in this thread:

http://obi.virtualmethodstudio.com/forum...hp?tid=887
Reply
#4
(25-02-2019, 07:36 AM)josemendez Wrote: This is a known bug and has been fixed in 4.0.3 (yet unreleased). You can find the fix in this thread:

http://obi.virtualmethodstudio.com/forum...hp?tid=887

thanks for the quick reply, 
I've tried to update those two scripts, now the pants (2nd cloth) at play won't behave like cloth, once I tick the cloth component on them off and on again during playback they are behaving like cloth. 
(i've tried with single solver and solver per cloth component) 
any ideas?
Reply