Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Fluid 3: Obi Solver Modes
#1
Hi,

I am trying to change ObiSolver Component's/ Parameters/ Mode to "2Dmode" or "3Dmode" with different buttons during gameplay. Actually with a script I was able to change it, however it just changes Parameters/ Mode dropdown menu in apparent, it doesn't effect the solver in real. On the other hand, when I try to change it from the Mode - dropdown directly during the gameplay (without script, just mouse click), it works surprisingly. Is there any other method?

This is the code line that I used:

public ObiSolver solver;
solver.GetComponentInParent < ObiSolver> ().parameters.mode = Oni.SolverParameters.Mode.Mode3D;

Thanks for your support (I have sent this via email before, however it may be helpful for others, so I have decided share my problem here, too).
Reply
#2
I have seen that it results from Serialize line for solver parameters on the Oni script. I have commented this line, however it makes the solver parameters static, I mean takes the values from Oni script directly, so via another script it cannot be changed. In brief, still waiting for your support.
Reply
#3
(22-10-2017, 07:48 AM)mimarilker Wrote: I have seen that it results from Serialize line for solver parameters on the Oni script. I have commented this line, however it makes the solver parameters static, I mean takes the values from Oni script directly, so via another script it cannot be changed. In brief, still waiting for your support.

Hi, you need to call solver.UpdateParameters() after changing the mode (or any other value of the parameters).

cheers!
Reply
#4
(22-10-2017, 12:40 PM)josemendez Wrote: Hi, you need to call solver.UpdateParameters() after changing the mode (or any other value of the parameters).

cheers!

Thanks a lot for your continuous support.
Reply