Latest Threads |
Collisions do not happens...
Forum: Obi Rope
Last Post: josemendez
6 hours ago
» Replies: 1
» Views: 85
|
Unstable chain attachment
Forum: Obi Rope
Last Post: quent_1982
17-05-2025, 10:31 AM
» Replies: 13
» Views: 572
|
Memory leak warning with ...
Forum: Obi Fluid
Last Post: josemendez
16-05-2025, 02:07 PM
» Replies: 4
» Views: 471
|
the Obi cloth has some co...
Forum: Obi Cloth
Last Post: MakeLifeEasier
16-05-2025, 08:59 AM
» Replies: 3
» Views: 259
|
ObiCloth going through co...
Forum: Obi Cloth
Last Post: josemendez
16-05-2025, 08:10 AM
» Replies: 1
» Views: 105
|
Why does setting InverseM...
Forum: Obi Fluid
Last Post: nonnamed
13-05-2025, 12:41 PM
» Replies: 8
» Views: 11,840
|
Shaking problem when coll...
Forum: Obi Softbody
Last Post: webmagic
13-05-2025, 12:11 PM
» Replies: 6
» Views: 379
|
Obi Softbody IndexOutOfRa...
Forum: Obi Softbody
Last Post: Aroosh
11-05-2025, 11:37 AM
» Replies: 2
» Views: 234
|
Rope pinned to two dynami...
Forum: Obi Rope
Last Post: Crimson1462
09-05-2025, 07:51 PM
» Replies: 2
» Views: 328
|
Unity 6 Console Spam abou...
Forum: Obi Fluid
Last Post: josemendez
09-05-2025, 08:03 AM
» Replies: 3
» Views: 1,250
|
|
|
bend in a circle without resistence |
Posted by: frg_kova - 28-02-2019, 01:39 PM - Forum: Obi Rope
- Replies (2)
|
 |
Hello.
If I just have an extended rope 1m long, when I try to bend it in a circle, it resists it like a spring or elastic. I've disabled the Bend Twist constraint, in fact disabled all the constraints other then Distance, Particle Collision, Collision and Pin and still I can't get it to just coil in the game. When I coil it it really wants to force itself out of it, and if I let both ends go, it will jump away from the force as it's trying to uncoil.
My question, how do I enable it to bend without inner tension, without resistance? Is this some specific combination of constraints?
|
|
|
How to set Obi Shape Matching Constraints |
Posted by: suntabu - 28-02-2019, 11:02 AM - Forum: Obi Cloth
- Replies (4)
|
 |
Hi, as said in title.
Is there any demo scene to show me how to use this constraint?
I've tested many times, but it did not work at all.
I just wanna use it at the Sample Scene - ClothSoftBody on a ball.
|
|
|
Is there a way to pause simulation? |
Posted by: mmortall - 27-02-2019, 06:55 PM - Forum: Obi Cloth
- Replies (3)
|
 |
Is there a way to pause/continue simulation for particluar ObiActor?
Currently, I use RemoteFromSolver to stop simulation and AddToSolver to restart simulation.
AddToSolver() just restart simulation from start by using mesh in the actor topology.
Is there a way to Pause simulation for a particular actor and then Continue so it will continue to simulate this actor?
After I pause actor I can move it or rotate. So after continue it will continue simulation by having new orientation.
I was trying to recreate topology from simulated result after last RemoteFromSolver call.
It is working but mesh is already deformed during past simulation and is not looks like it should.
Thanks.
|
|
|
Loosing Shadow.... |
Posted by: gabibouty - 26-02-2019, 04:13 PM - Forum: Obi Fluid
- Replies (2)
|
 |
Hello everyone, I have a small question ... I could not have shadows of my fluid. After fex times of tests, I did a final test in a demo scene, and there, I saw that if we simply duplicate the original emitter, we lost the shadow of the fluid there too ! Someone has a solution?
Thanks !
|
|
|
App crash after RemoveFromSolver called [4.0.2 and older] |
Posted by: mmortall - 26-02-2019, 01:40 PM - Forum: Obi Cloth
- Replies (7)
|
 |
I had the same crash on older versions. And I already posted information about it in other my threads. But finally I was able to reproduce crash with 80-100% repo rate and I've found the source of it.
To reproduce open your example RuntimeCloth.scene. Replace SackGenerator.cs content with code in this post below.
This code just call RemoveFromSolver for all generated cloth after 2 seconds and you can add unlimited amount of cloth when press SPACE button.
Crash occurs after RemoveFromSolver called with some delay (1-5 sec) but you have to do it a couple of time to get crash 100%. On my PC it takes 1-4 tries.
Sometimes you will have some Unity errors popping up in random places. And then you get crash. Also occurs in standalone version. On Mac OS and Windows. My Unity is 2018.3.0f2
This is a very big blocker for us currently. Because we create lots of objects in runtime and we need to remove them from solver and add again for resimulation.
I am also not able to resimulate ObiActor in 4.0.2 using same solver but I will try some other ways and open a new thread about it if I fail. But first this issue need to be handled.
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
/**
* Generates a fully procedural cloth sack at runtime. This is done by generating two meshes
* and using RuntimeClothGenerator to create cloth out of both of them. Then they are sewn together using
* the ObiStitcher component.
*/
public class SackGenerator : MonoBehaviour {
public ObiSolver solver; /**< solver to add the sack to.*/
public ObiMeshTopology topology; /**< empty topology asset used to store sack mesh information.*/
public Material outsideMaterial; /**< material used for rendering the sack.*/
public Material insideMaterial; /**< material used for rendering the sack.*/
public float sackSize = 1; /**< size of the sack in world units.*/
public int resolution = 10; /**< resolution of sack mesh in quads per side.*/
private List<ObiCloth> _GeneratedActors = new List<ObiCloth>();
/**
* Generates and returns procedural tesselated square mesh.
*/
private Mesh GenerateSheetMesh(){
// create a new mesh:
Mesh mesh = new Mesh();
mesh.name = "sack_sheet";
float quadSize = sackSize/resolution;
int vertexCount = (resolution + 1) * (resolution + 1);
int triangleCount = resolution * resolution * 2;
Vector3[] vertices = new Vector3[vertexCount];
Vector3[] normals = new Vector3[vertexCount];
Vector4[] tangents = new Vector4[vertexCount];
Vector2[] uvs = new Vector2[vertexCount];
int[] triangles = new int[triangleCount * 3];
// generate vertices:
// for each row:
for (int y = 0; y < resolution+1; ++y){
// for each column:
for (int x = 0; x < resolution+1; ++x){
int v = y*(resolution+1)+x;
vertices[v] = new Vector3(quadSize*x,quadSize*y,0);
normals[v] = Vector3.forward;
tangents[v] = new Vector4(1,0,0,1);
uvs[v] = new Vector3(x/(float)resolution,y/(float)resolution);
}
}
// generate triangle faces:
for (int y = 0; y < resolution; ++y){
// for each column:
for (int x = 0; x < resolution; ++x){
int face = (y*(resolution+1)+x);
int t = (y*resolution+x)*6;
triangles[t] = face;
triangles[t+1] = face+1;
triangles[t+2] = face+resolution+1;
triangles[t+3] = face+resolution+1;
triangles[t+4] = face+1;
triangles[t+5] = face+resolution+2;
}
}
mesh.vertices = vertices;
mesh.normals = normals;
mesh.tangents = tangents;
mesh.uv = uvs;
mesh.triangles = triangles;
mesh.RecalculateBounds();
return mesh;
}
private void GenerateSack(){
Mesh mesh = GenerateSheetMesh();
// create and give a material to both sides of the sack:
GameObject sheet1 = new GameObject("sack_side1",typeof(MeshFilter),typeof(MeshRenderer));
sheet1.GetComponent<MeshRenderer>().materials = new Material[]{outsideMaterial,insideMaterial};
GameObject sheet2 = new GameObject("sack_side2",typeof(MeshFilter),typeof(MeshRenderer));
sheet2.GetComponent<MeshRenderer>().materials = new Material[]{outsideMaterial,insideMaterial};
// position both sheets around the center of this object:
sheet1.transform.parent = transform;
sheet2.transform.parent = transform;
sheet1.transform.localPosition = Vector3.forward;
sheet2.transform.localPosition = -Vector3.forward;
// generate cloth for both of them:
RuntimeClothGenerator generator1 = sheet1.AddComponent<RuntimeClothGenerator>();
generator1.solver = solver;
generator1.topology = topology;
generator1.mesh = mesh;
RuntimeClothGenerator generator2 = sheet2.AddComponent<RuntimeClothGenerator>();
generator2.solver = solver;
generator2.topology = topology;
generator2.mesh = mesh;
// sew both sides together:
ObiStitcher stitcher = gameObject.AddComponent<ObiStitcher>();
stitcher.Actor1 = sheet1.GetComponent<ObiCloth>();
stitcher.Actor2 = sheet2.GetComponent<ObiCloth>();
// add stitches: top and bottom edges:
for (int i = 1; i < resolution; ++i){
stitcher.AddStitch(i,i);
stitcher.AddStitch((resolution+1)*resolution + i,(resolution+1)*resolution + i);
}
// sides:
for (int i = 0; i <= (resolution+1)*resolution; i+=resolution+1){
stitcher.AddStitch(i,i);
stitcher.AddStitch(i + resolution ,i + resolution );
}
// adjust bending constraints to obtain a little less rigid fabric:
ObiCloth cloth1 = sheet1.GetComponent<ObiCloth>();
ObiCloth cloth2 = sheet2.GetComponent<ObiCloth>();
cloth1.BendingConstraints.maxBending = 0.02f;
cloth2.BendingConstraints.maxBending = 0.02f;
cloth1.BendingConstraints.PushDataToSolver(ParticleData.NONE);
cloth2.BendingConstraints.PushDataToSolver(ParticleData.NONE);
_GeneratedActors.Add(cloth1);
_GeneratedActors.Add(cloth2);
}
public void Update(){
if (Input.GetKeyDown(KeyCode.Space))
{
GenerateSack();
Invoke("RemoveAllGenerated", 2.0f);
}
}
public void RemoveAllGenerated()
{
foreach (var actor in _GeneratedActors)
{
actor.RemoveFromSolver(null);
}
}
}
I am not attaching a Crash Log because all times it is different because of memory corruption. But it happens 100% after RemoveFromSolver was called.
|
|
|
Normalized rope position? |
Posted by: camirving - 25-02-2019, 09:29 PM - Forum: Obi Rope
- Replies (1)
|
 |
Hi there!
I have a rope and i've expanded its length.
I want to get the position of the particle that sits in the very middle of the rope, in normalized 0.5.
How can I retrieve a particle position via normalized value?
|
|
|
Obi 4.0.2 compile errors |
Posted by: mmortall - 25-02-2019, 03:01 PM - Forum: General
- Replies (4)
|
 |
Adding Obi 4.0.2 to new project got compile errors in Editor:
Assets\Plugins\Obi\Scripts\Actors\ObiEmitter.cs(296,73): error CS0426: The type name 'MaterialChangeEventArgs' does not exist in the type 'ObiEmitterMaterial'
Assets\Plugins\Obi\Scripts\Actors\ObiEmitter.cs(91,24): error CS0115: 'ObiEmitter.Awake()': no suitable method found to override
Assets\Plugins\Obi\Scripts\Utils\ObiClothDragger.cs(45,9): error CS0117: 'Oni' does not contain a definition for 'GetParticlePositions'
Unity 2018.3.0f2
|
|
|
particles wont stop moving |
Posted by: drorlazar - 24-02-2019, 09:51 AM - Forum: Obi Cloth
- Replies (4)
|
 |
Hi there
I'm using cloth as a hair simulation. i'm trying to achieve a smooth grad of movement so it'll look organic and no matter how i try to reduce the particles mass/skin radius/ backstop/backstop radius/skin stiffness and what not, they are still getting a lot of motion.
any ideas /tutorials about how to create a smooth transition from a skinned vertices to a simulated ones?
(we've purchase both cloth and softbody, the guy in charge of purchasing them will send me the invoice/order number later today)
|
|
|
Cloth stop working once adding another solver/mesh |
Posted by: drorlazar - 24-02-2019, 09:45 AM - Forum: Obi Cloth
- Replies (3)
|
 |
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)
|
|
|
|