Latest Threads |
Can softbody not deform b...
Forum: Obi Softbody
Last Post: josemendez
Yesterday, 03:53 PM
» Replies: 1
» Views: 37
|
Broken scripts with updat...
Forum: Obi Rope
Last Post: hariedo
23-12-2024, 05:44 PM
» Replies: 2
» Views: 198
|
Garment explodes on Andro...
Forum: Obi Cloth
Last Post: CptnFabulous
19-12-2024, 07:16 AM
» Replies: 4
» Views: 701
|
Calculating and Reproduci...
Forum: Obi Fluid
Last Post: ZacharyP
18-12-2024, 05:49 PM
» Replies: 2
» Views: 812
|
Null Reference, actor not...
Forum: Obi Rope
Last Post: josemendez
13-12-2024, 12:39 PM
» Replies: 1
» Views: 201
|
Issue with Grasping ObiRo...
Forum: Obi Rope
Last Post: josemendez
12-12-2024, 12:00 PM
» Replies: 5
» Views: 535
|
Changing extruded rendere...
Forum: Obi Rope
Last Post: aderae
10-12-2024, 07:35 PM
» Replies: 2
» Views: 278
|
Baking a rope is causing ...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 11:06 AM
» Replies: 6
» Views: 703
|
Barrier belt - changing l...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 10:42 AM
» Replies: 1
» Views: 250
|
Path editor gizmo's appea...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 09:50 AM
» Replies: 1
» Views: 245
|
|
|
Slowed Simulation Problems |
Posted by: Reiffer - 16-08-2018, 11:37 AM - Forum: Obi Cloth
- Replies (2)
|
|
Hello!
I've recently started using ObiCloth to enhance some of my characters' clothing and I'm in the process of integrating my own slo-mo logic into it (as I'm avoiding using Unity's own timescale).
Recently I've been running into a problem with the clothing deforming and "crinkling" during this slo-mo process. You can see this effect in this gif. You can also see the change that I've made to ObiSolver's LateUpdate (as I saw you recommended in a previous thread) posted below.
Any insight into this would be welcome (I'm also having problems with collisions and clipping but that's a separate issue that I'll bugfix later)!
Code: private void LateUpdate(){
if (Application.isPlaying && simulationOrder == SimulationOrder.LateUpdate){
// smooth out timestep and accumulate it:
if (SlowTimeManager.fTimeScaleGlobal != 0)
{
smoothDelta = Mathf.Lerp(Time.deltaTime / SlowTimeManager.fTimeScaleGlobal, smoothDelta, 0.95f);
}
else
{
return;
}
AccumulateSimulationTime(smoothDelta);
SimulateStep(smoothDelta);
}
if (!Application.isPlaying)
return;
EndFrame (simulationOrder == SimulationOrder.LateUpdate ? smoothDelta : Time.fixedDeltaTime);
if (OnFrameEnd != null)
OnFrameEnd(this,null);
}
|
|
|
Removing Cloth Component |
Posted by: jaleopold - 11-08-2018, 01:17 AM - Forum: Obi Cloth
- Replies (1)
|
|
When a cloth component is removed from a piece of skinned geometry it makes the mesh disappear with no apparent way to bring it back. The node is still there with the mesh renderer enabled, but its invisible.
|
|
|
Making Obi cloth work with sleeves |
Posted by: Bob San - 09-08-2018, 06:58 PM - Forum: Obi Cloth
- Replies (1)
|
|
Hey!
I have a question regarding obi cloth working with an animated character.
Below you can see the sleeves of the character working fine, just like the asset intends:
[attachment=163]
But since the mesh requires a skinned mesh renderer, that part of the robe is bound to the elbow joint.
My problem is that when I rotate the elbow in any way (with animations or directly from the inspector) the simulation works as if gravity was tied to the orientation of the elbow.
[attachment=164]
Hoping there's a way of fixing this directly from the inspector, I guess i can fix it with some rigging trick, but that's not why I bought the asset.
|
|
|
Tearing cloth via code (Finding constraintIndex) |
Posted by: Cadpeople - 08-08-2018, 09:11 AM - Forum: Obi Cloth
- Replies (1)
|
|
Hey so I'm trying to tear a ribbon in half at a specific point. I've been doing as described on this page http://obi.virtualmethodstudio.com/tutor...aints.html but I'm haivng a hard time figuring out where to tear. How do I figure out what the constraintindex of a specific point is? So far I've managed to guess my way to two out of three tear spots, but I've been guessing for a while now with no luck figuring out the last one...
Code: public void CutAtPoints()
{
cloth.DistanceConstraints.RemoveFromSolver(null);
cloth.BendingConstraints.RemoveFromSolver(null);
for (int i = 0; i < constraintsToCut.Count; i++)
{
cloth.Tear(constraintsToCut[i]);
}
cloth.BendingConstraints.AddToSolver(cloth);
cloth.DistanceConstraints.AddToSolver(cloth);
cloth.BendingConstraints.SetActiveConstraints();
cloth.UpdateDeformableTriangles();
cloth.Solver.UpdateActiveParticles();
}
|
|
|
Destroying objects improperly? |
Posted by: Lluluien - 07-08-2018, 08:31 PM - Forum: Obi Cloth
- Replies (1)
|
|
Edit: I consistently crash now even before I destroy any of the objects I describe below, so there must be something else (or additional) going on. See next post as well.
----------------------
I'm trying to use the Obi Cloth asset for simulations on two different objects in my game.
One of them is statically created in the editor and built directly into the scene. I'm really happy with how these look so far, and I had no problem at that point.
However, one of them is dynamically created, and when I started trying to run my game after I got it set up to use Obi Cloth for this object, it started crashing my game, seemingly at random.
I've been chasing this down for about 3 days: I've updated Unity, updated Visual Studio, rebooted several times, read through your forums, looked at log files from Unity and the crashes, and so on. I've come to believe the problem has to do with destroying one of these dynamically instantiated prefabs.
I've got this prefab set up with everything my static objects have except for the Obi Solver, which I assign when the object is created. The solver in the gameMaster singleton is the same one I am using for the static objects:
Code: protected void Start()
{
obiCloth = GetComponentInChildren<ObiCloth>();
obiCloth.Solver = gameMaster.obiSolver;
}
Several of the Unity logs right before the crash have references to the \Obi\Scripts\Actors\ObiActor.cs script at line 474:
Code: // check if any of the involved transforms has changed since last time:
if (!transform.hasChanged && !Solver.transform.hasChanged)
return;
When I found this, I thought, okay, maybe this is as simple as just some kind of object destruction race condition and I can fix it with a couple easy changes. I turned the previous code into this:
Code: if (null == Solver || null == transform || null == Solver.transform) {
return;
}
// check if any of the involved transforms has changed since last time:
if (!transform.hasChanged && !Solver.transform.hasChanged)
return;
and then added this to top of the OnDestroy() call on the object being destroyed:
Code: obiCloth.RemoveFromSolver(null);
obiCloth.Solver = null;
However, I'm still getting crashes, so I wonder if there is something I am missing about the proper methodology for destroying an actively simulated ObiActor. I've looked around on the tutorials page and don't see anything about destroying objects, even though there is information about spawning them. I looked around in the API docs, but they're not very helpful - for instance, what are the (object item) parameters I see in there? I had to google "obi removefromsolver" to find out I could just pass null to the ObiActor.RemoveFromSolver() function by looking at some other piece of sample code you have on the site.
Here is the error that I'm sure is precipitating the latest crash I had that is still referencing the null checks I added in the code block above. See the 5th line, the first call to Obi.ObiActor.OnSolverStepBegin() line 473:
Code: NullReferenceException: Object reference not set to an instance of an object
at UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) [0x0001d] in C:\buildslave\unity\build\Runtime\Export\UnityEngineObject.bindings.cs:179
at UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) [0x0003a] in C:\buildslave\unity\build\Runtime\Export\UnityEngineObject.bindings.cs:141
at UnityEngine.Object.op_Equality (UnityEngine.Object x, UnityEngine.Object y) [0x00003] in C:\buildslave\unity\build\Runtime\Export\UnityEngineObject.bindings.cs:401
at Obi.ObiActor.OnSolverStepBegin () [0x00019] in D:\unity\projects\Tapestry\Tapestry\Assets\Obi\Scripts\Actors\ObiActor.cs:473
at Obi.ObiCloth.OnSolverStepBegin () [0x00014] in D:\unity\projects\Tapestry\Tapestry\Assets\Obi\Scripts\Actors\ObiCloth.cs:564
at Obi.ObiSolver.SimulateStep (System.Single stepTime) [0x00052] in D:\unity\projects\Tapestry\Tapestry\Assets\Obi\Scripts\Solver\ObiSolver.cs:545
at Obi.ObiSolver.LateUpdate () [0x00056] in D:\unity\projects\Tapestry\Tapestry\Assets\Obi\Scripts\Solver\ObiSolver.cs:775
I'm not sure what sorcery goes on in the manipulation of your backend C++ objects in the Unity C# code, but that "IsNativeObjectAlive" call sure looks like there's something going wrong in the destruction of this object that isn't letting the ObiSolver know that it can forgo simulating the object in this frame when it's about to die. The crash always immediately follows this NullReferenceException error in OnSolverStepBegin().
The question is: Am I doing something wrong in how I'm either allocating or destroying the gameobject which is causing this, or is it a bug in the ObiCloth/ObiActor/ObiSolver code somewhere?
While we're on the topic, I have a question about when I'm instantiating the object and getting it to run. In the same ObiActor code, it looks like the object gets added to the Obi Solver here:
Code: public virtual void Start(){
if (Application.isPlaying)
AddToSolver(null);
}
I don't see anywhere else when the solver gets assigned that this would happen:
Code: public ObiSolver Solver{
get{return solver;}
set{
if (solver != value){
RemoveFromSolver(null);
solver = value;
}
}
}
So I'm probably just getting lucky that this race condition between my object's Start() and the ObiCloth() start hasn't bitten me. It looks like my code should actually be:
Code: protected void Start()
{
obiCloth = GetComponentInChildren<ObiCloth>();
obiCloth.Solver = gameMaster.obiSolver;
obiCloth.AddToSolver(null);
}
Correct?
Thanks ahead of time for your help!
Quick edit: Everything works fine until the game crashes - the dynamically instantiated object is simulated the way I expect it to be, the static ones are still working, etc. The game sometimes crashes in 15 seconds, sometimes in 10 minutes, and everywhere in between. This is why I suspect a race condition.
|
|
|
Obi Rope and VR |
Posted by: Peny22 - 05-08-2018, 04:48 PM - Forum: Obi Rope
- Replies (6)
|
|
Hello, I am developing a VR application in which its user will connect different kinds of cables to appropriate devices. I wonder whether to buy your ObiRope asset. I have a couple of questions.
1. How will a created rope/wire behave during a teleportation if an application user holds it in his hands when: a) one end of it is connected to an unmovable object while the other one is movable b) both ends are movable? The user will only be able to grip a connector - e.g. a HDMI connector instead of a jacket of the wire.
2. How much does the asset affect efficiency? Are 30 wires able to make a significant difference to efficiency? How much is a cpu used by the asset?
3. Will it be possible to get a refund if the asset doesn't work well with my application?
4. Is it hard to use Obi Rope for a beginner in Unity?
|
|
|
Cloth is very stretchy and elastic |
Posted by: adami - 05-08-2018, 01:17 PM - Forum: Obi Cloth
- Replies (2)
|
|
Hi,
I've been reading the forum, documentation and watched the youtube videos but despite generating my tether constraints, increasing my obi solver > constraints > iterations to 50 my cloth really appears very very elastic and stretchy. What are the settings that I need to change to reduce this?
Any advice on this would be greatly appreciated.
thanks.
|
|
|
|