Latest Threads |
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 11:27 AM
» Replies: 4
» Views: 76
|
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 06:34 AM
» Replies: 6
» Views: 190
|
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 855
|
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 208
|
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 272
|
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 793
|
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 263
|
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 160
|
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,306
|
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 271
|
|
|
Performance again |
Posted by: lacasrac - 22-10-2021, 10:34 AM - Forum: Obi Rope
- Replies (1)
|
 |
In debug mode I get a massive 17 FPS in fullscreen when I use 5 solvers/1 rope/chain with 8 subsets
So basically I have 5 solvers with 3 chains and 2 ropes
Is it normal?
Jobs/Leak detection is off
Burst-> Enable compilation on, Synchronous compilation on, others off
Jobsdebugger off
Any other thing that I can do to increase the FPS?
One more question:
If I have 5 solvers with 1 ropes -> basically 5 ropes with 5 solvers invidiudally that is good or bad for performance?
It will be better 1 solvers with 5 ropes?
|
|
|
Animate physics Lags my other animations |
Posted by: jeremy2132 - 20-10-2021, 08:42 PM - Forum: Obi Cloth
- Replies (7)
|
 |
In order to make the cloth simulation not lag behind the animation I need the Update Mode in the animator be set to animate physics. This makes all my character animations choppy and laggy as a result. Is there any that my character animations can be smooth like they are in the normal update mode wiithout making the physics lag one frame behind the animation simulation?
|
|
|
Any tutorial for stitcher? |
Posted by: Snail921 - 16-10-2021, 11:23 AM - Forum: Obi Softbody
- Replies (7)
|
 |
Hi.
I have been struggling to figure out how to use stitch constraints properly to connect multiple softbodies.
Is there any video or tutorial of stitch constraints?
[EDIT]
Here are some more info regarding the problem I am struggling with.
The obi stitcher has been set as you see in the image below. Each stitch has been set by AutoStitcher.cs which helps me to find indices of particle pairs and set all stitches in the Editor. (For better visualization of each stitch, I set each cube apart along X axis but they were located right next to each other when I set their stitches and hit play.)
![[Image: gs9zU7V.png]](https://i.imgur.com/gs9zU7V.png)
They looks ok to me but when I hit play, I get the result like the image below (Shown in wireframe mode). As you can see, the stitched particles are not lined up smoothly and they seem they are fighting (colliding) each other.
Their softbody surface blueprint's Shape Smoothing and Anisotropy Neighborhood have been set to 0 so that I get all particles right on the mesh vertices.
What else I should look into to make connect them seamlessly?
By the way, this is the code I use to set stitches. It figure out all pairs and export them to a xml file in the play mode, then use the xml file to set stitches in the Editor. I know the workflow is a bit too cumbersome but I could not figure out how to get particle positions without running it. Is there any better way?
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
using UnityEditor;
public class AutoStitcher : MonoBehaviour
{
[System.Serializable]
public struct STITCH_PAIR
{
public int index1;
public int index2;
}
public List<STITCH_PAIR> stitchPairList = new List<STITCH_PAIR>();
[SerializeField]
ObiActor actor1;
[SerializeField]
ObiActor actor2;
[SerializeField]
float stitchMergin = 0.001f;
private Mesh mesh1;
private Mesh mesh2;
// Start is called before the first frame update
void Start()
{
FindPairs();
}
public void FindPairs()
{
stitchPairList.Clear();
for (int i = 0; i < actor1.particleCount; i++)
{
int index1 = actor1.GetParticleRuntimeIndex(i);
Vector3 pos1 = actor1.GetParticlePosition(index1);
for ( int l = 0; l < actor2.particleCount; l++)
{
int index2 = actor2.GetParticleRuntimeIndex(l);
Vector3 pos2 = actor2.GetParticlePosition(index2);
float distance = Vector3.Distance(pos1, pos2);
if (distance < stitchMergin)
{
//obiStitcher.AddStitch(i, l);
STITCH_PAIR newPair;
newPair.index1 = i;
newPair.index2 = l;
stitchPairList.Add(newPair);
Debug.Log($"Index1: {i}, Index2: {l} Distance: {distance}");
}
}
}
}
public void SaveStitchData()
{
string name = actor1.name + "_" + actor2.name;
XmlUtil.Seialize<List<AutoStitcher.STITCH_PAIR>>("./Assets/" + name + ".xml", stitchPairList);
}
public void StitchActors()
{
string name = actor1.name + "_" + actor2.name;
stitchPairList.Clear();
stitchPairList = XmlUtil.Deserialize<List<AutoStitcher.STITCH_PAIR>>("./Assets/" + name + ".xml");
ObiStitcher obiStitcher = gameObject.AddComponent<ObiStitcher>();
obiStitcher.Actor1 = actor1;
obiStitcher.Actor2 = actor2;
foreach(STITCH_PAIR pair in stitchPairList)
{
obiStitcher.AddStitch(pair.index1, pair.index2);
}
}
}
[CustomEditor(typeof(AutoStitcher))]
public class AutoStitcherEditor : Editor
{
AutoStitcher obj;
public void OnEnable()
{
obj = (AutoStitcher)target;
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (GUILayout.Button("Save Stitches(Only in Play Mode"))
{
if (!Application.isPlaying)
{
Debug.LogError("Only works when editor is playing.");
return;
}
bool go = EditorUtility.DisplayDialog(
"Save Stitches to xml file.",
"This will save particle pairs data to .xml file. " +
"Do you wish to continue?",
"Go Ahead",
"Cancel"
);
if (!go)
{
return;
}
obj.SaveStitchData();
}
if (GUILayout.Button("Bake Stitches(Only in Editor Mode"))
{
if (Application.isPlaying)
{
Debug.LogError("Only works when editor is not playing.");
return;
}
bool go = EditorUtility.DisplayDialog(
"Bake Stitches from xml file.",
"This will add obiStitch constraints to obi actors. " +
"Do you wish to continue?",
"Go Ahead",
"Cancel"
);
if (!go)
{
return;
}
obj.StitchActors();
}
}
}
|
|
|
How to tune/set constraints of a particle group from an obiActor during runtime |
Posted by: Jschol - 15-10-2021, 01:07 PM - Forum: General
- Replies (4)
|
 |
Hi all,
I am trying to write a script, that allows me to tune/set the constraints of a selected obi particle group at runtime.
If I understood correctly, I should know the offset of that actor's particle group constraints, inside the solver batch, to set the constraints.
The problem that I am facing, is that I am not able to locate the constraints from the particle group in the solver.
My idea was to loop through the constraints of the actor, and if the constraint is also present in the particle group, set the constraints.
Is this the way to go? (As I cannot seem to figure that part out).
Any help would be greatly appreciated.
- Jasper
My current implementation on setting a softbody ShapeMatchingConstraints look something like this, where I still need to fill in the "ConstraintIsInParticleGroup()" function:
Code: using Obi;
using System.Collections.Generic;
using UnityEngine;
public class ParticleGroupTest : MonoBehaviour
{
[SerializeField] private ObiActor obiActor = null;
[SerializeField] private ObiParticleGroup obiParticleGroup = null;
private ObiSoftbody obiSoftbody = null;
bool ConstraintIsInParticleGroup()
{
// ???
return true;
}
void Start()
{
obiSoftbody = obiActor.GetComponent<ObiSoftbody>();
}
void Update()
{
// get constraints stored in the actor:
var actorConstraints = obiSoftbody.GetConstraintsByType(Oni.ConstraintType.ShapeMatching)
as ObiConstraints<ObiShapeMatchingConstraintsBatch>;
// get runtime constraints in the solver:
var solverConstraints = obiSoftbody.solver.GetConstraintsByType(Oni.ConstraintType.ShapeMatching)
as ObiConstraints<ObiShapeMatchingConstraintsBatch>;
// get batches and offsets
List<ObiShapeMatchingConstraintsBatch> actorSoftBodyBatches = actorConstraints.batches;
List<ObiShapeMatchingConstraintsBatch> solverSoftBodyBatches = solverConstraints.batches;
List<int> offsets = obiSoftbody.solverBatchOffsets[(int)Oni.ConstraintType.ShapeMatching];
for (int i_batch = 0; i_batch < actorConstraints.batches.Count; ++i_batch) // loop over batches
for (int i_constraint = 0; i_constraint < actorSoftBodyBatches[i_batch].activeConstraintCount; ++i_constraint) // loop over constraints
if (ConstraintIsInParticleGroup())
{
int index = i_constraint + offsets[i_batch]; //apply offset to constraint index per batch
solverSoftBodyBatches[i_batch].materialParameters[index * 5] = 0.0f; // deformation resistance
solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 1] = 1.0f; // plasticYield
solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 2] = 1.0f; // plasticCreep;
solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 3] = 1.0f; // plasticRecovery
solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 4] = 1.0f; // maxDeformation
}
}
|
|
|
Rope goes inside collider when stretched |
Posted by: davidsedrakyan - 14-10-2021, 12:55 AM - Forum: Obi Rope
- Replies (6)
|
 |
Hello, I'm using Obi Rope for simulating wrapping around pins, gameplay and the problem is that my rope goes inside collider, I will attach screenshots of settings and also a video of the problem!
I'm pretty sure that I need to activate some setting to have maybe more "stretchy" or more "Wrappy" rope but I can't exactly understand shat should I activate for that
https://www.youtube.com/watch?v=5HnJi0pdI0I
Here is a link for the problem in the video, also I'm attaching my settings.
I tried moving my sphere with rigid body and with transform in both cases it's same, I assume that there is some setting to turn on on the rope.
|
|
|
Internal Collision Detection? |
Posted by: Dave LeDev - 13-10-2021, 09:19 AM - Forum: Obi Softbody
- Replies (2)
|
 |
I've not yet purchased to find out-- does this asset only support external collisions or can it also handle internal?
Example use cases:
- A creature trying to get out of a closed, deformable container
- Bubble Boy
- Realistic skin deformation caused by internals
|
|
|
|