Search Forums

(Advanced Search)

Latest Threads
can you remove particles ...
Forum: Obi Softbody
Last Post: josemendez
1 hour ago
» Replies: 1
» Views: 127
Ladder made by Ropes (Rat...
Forum: Obi Rope
Last Post: josemendez
2 hours ago
» Replies: 3
» Views: 49
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 11:27 AM
» Replies: 4
» Views: 447
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 06:34 AM
» Replies: 6
» Views: 614
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 1,365
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 392
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 467
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 1,285
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 461
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 263

 
  Upgrading version 4 code (esp. GetConstraintsInvolvingParticle)
Posted by: itkdk - 09-05-2022, 02:15 PM - Forum: Obi Cloth - Replies (1)

Hi,

I recently took over a project (from people no longer at my company) and am trying to upgrade Obi (Cloth and Rope) from version 4.0 to 6.4. I get a handful of errors because of API changes and managed to adjust most of the code, but one method in particular is hard to update. One part of the problem is that our code is not well documented (or well written, sadly), but also I'm having trouble finding info on how to replace methods that no longer exist, especially ObiConstraint(s)Batch#GetConstraintsInvolvingParticle(int particleIndex). In the old version, our method borrowed heavily from ObiTearableCloth#ApplyTearing(), but it changed drastically after the upgrade. Our method was added to ObiTearableCloth and is called from within a solver collision callback with the index of a ParticleInActor for each contact in the ObiCollisionEventArgs.
Here's the method, I added comments behind the lines I believe to be unnecessary:
DistanceConstraints.AddToSolver(this); // unnecessary? ApplyTearing() no longer calls it

Code:
public void CustomCut(int index)
{
    ObiDistanceConstraintBatch distanceBatch = DistanceConstraints.GetFirstBatch();
    float[] forces = new float[distanceBatch.ConstraintCount]; // unnecessary and...
    Oni.GetBatchConstraintForces(distanceBatch.OniBatch, forces, distanceBatch.ConstraintCount, 0); // unnecessary, because "forces" isn't used

    List<TornEdge> tornEdges = new List<TornEdge>();

    foreach (ObiConstraintBatch batch in DistanceConstraints.GetBatches())
    {
        List<int> affectedConstraints = batch.GetConstraintsInvolvingParticle(index);

        for(int i = 0; i<affectedConstraints.Count; i++)
        {
            Tear(affectedConstraints[i]);
        }

        //Tear(affectedConstraints[0]);

        DistanceConstraints.AddToSolver(this); // unnecessary? ApplyTearing() no longer does this in new version

        // update active bending constraints:
        BendingConstraints.SetActiveConstraints(); // unnecessary? ApplyTearing() no longer does this in new version

        // update solver deformable triangle indices:
        UpdateDeformableTriangles();

        // upload active particle list to solver:
        solver.UpdateActiveParticles(); // unnecessary? ApplyTearing() no longer does this in new version
    }
}

Here's where I'm at right now, stuck on how to replace GetConstraintsInvolvingParticle() and construct the correct StructuralConstraints for the Tear() call:

Code:
public void CustomCut(int index)
{
    var distanceConstraints = GetConstraintsByType(Oni.ConstraintType.Distance) as ObiDistanceConstraintsData;
    foreach (ObiConstraintsBatch batch in distanceConstraints.batches)
    {
        List<int> affectedConstraints = batch.GetConstraintsInvolvingParticle(index);
        
        for(int i = 0; i < affectedConstraints.Count; i++)
        {
            Tear(affectedConstraints[i]);
        }
        // update solver deformable triangle indices:
        UpdateDeformableTriangles();
    }
}
Any hints on how to rewrite this or confirmation on the three calls after the loop I marked no longer being necessary?
Thanks!

Print this item

  Question about calculating lambda
Posted by: littleaa - 09-05-2022, 02:32 AM - Forum: Obi Fluid - Replies (1)

Question about calculating lambda
According to the formula in PBD, we just use the sum of the square of gradient to calculate the lambda, but in the code of CalculateLambdasJob in BurstDensityConstraint, it adds the square of the sum of gradient(data[2] * data [2]) too. Is there some reason to add this term ?

Code:
// self particle contribution to density and gradient:
data += new float4(densityKernel.W(0, radii[i]), 0, grad, grad * grad + data[2] * data[2]);

Print this item

  Color
Posted by: Domtav - 08-05-2022, 05:38 PM - Forum: Obi Fluid - Replies (12)

Hello,

I am currently taking my head on an effect that I do not understand.

In editor mode, I get a fluid that suits me on the color side. It's a beautiful green (with very little transparency).... a bit slim like ghostbuster if you see the thing :p
When I compile the game and launch it I end up with a sort of translucent and darker green... yuck... well, it's not ugly, but nothing to do with the expected effect.

I did several tests and the one that seems the most representative is by simply trying to make white. In editor mode I get a suberde milky white (very slight transparency) and in runtime I end up with greyish water! (very transparent and gray).

Among the different tests:

- Change the transparency parameters (alpha of the disk or of the obi particle renderer: no effect.

- Modification refraction / transparency on the obi fluid renderer, besides the fact that it impacts me all the fluids of the scene at the same time, the effect is far from ok. Play on the other parameters (reflection/metalness...) without success.

On the parameter side, in URP, I have of course the same configuration (defined by default) between the two modes. I turned off all other post-process graphical processing (volume, etc....).
I even changed the color of the skybox to have white and limit the edge effects. I also have remove all the other light sources, nothing to do... of course the directional light is white...

So my questions are:

- How do I ensure that the color in execution mode is identical to the color obtained in edit mode ("game" window) ?

- How I remove the transparency without having to play on the obi fluid renderer which affects all the fluids ?

thank you !

D.

Print this item

  Updated obi rope and no methods or variables are valid anymore
Posted by: Newmagicstudio - 08-05-2022, 02:00 PM - Forum: Obi Rope - Replies (1)

Hello,
I am using obi rope, updated to latest version, i see all the methods and variables are not valid and give me tons of errors like ObiPinConstraints or ObiPinConstraintBatch don't exist. I used "using Obi;"
Have to rewrite completely everything again?

Print this item

  Radius 0, but cloth fall
Posted by: Celes - 06-05-2022, 10:23 AM - Forum: Obi Cloth - Replies (2)

Hello,
I don't see what I missed, but I definitely missed something sorry !
I have a travel cloak and I want the upper part of it to not be "obi simulated", so I put the particules radius to 0 to make them stick to the initial skinned mesh like I read in the documentation.
But unfortunately, the modified particules are still dropping down, probably affected by the gravity.
So my question is : what did I do wrong? or is there another way to remove some particules from the simulation?

test assets (unity)
Ah ! Stupid me, I forgot the burst collision world in the scene... Sorry for the bad package !

Thanks !
Have a nice day ^^

Print this item

  Is there a way to build blueprints at runtime?
Posted by: altalias - 06-05-2022, 02:51 AM - Forum: Obi Softbody - Replies (1)

I have a use case in which I need to create a softbody from a mesh that doesn't exist until runtime. Is this at all possible and if so how would I go about doing this?

Print this item

  Long app launch
Posted by: Lazy_Redpaw - 05-05-2022, 03:22 PM - Forum: Obi Softbody - Replies (2)

The app takes a long time to launch with Obi Softbody. Different devices launch it from 20s to 120s. How can I boost it?

Print this item

  Help needed in finding someone to build using Obi cloth
Posted by: drip3dfashion - 04-05-2022, 05:46 PM - Forum: General - No Replies

Hi
   We are doing a retail fashion company and  I am looking for some one with unity and Obi Cloth experience for developing a feature in  our virtual fitting room app. We do have a very high quality 3d models of the garments we sell and we want to accurately reflect the fabric and the garment in physics. Can any one point me to where I can find some one to help us build this feature using obi cloth.

Print this item

  Is there a way to kill fluid particles on contact with a different fluid?
Posted by: locque - 04-05-2022, 09:45 AM - Forum: Obi Fluid - Replies (4)

I would like to have one fluid dissolve almost immediately after coming in contact with a different fluid rather than the two of them mixing, ideally with a short delay of around 0.5-1 second so it looks a bit more like they're mixing rather than the particles being killed.

Is this possible? I suppose this would require creating a script that talks to individual particles, which are probably not exposed by the backend.

If it's not possible, any ideas on how to achieve a similar effect? The scenario is mixing a small amount of very high resolution fluid into a large volume of low resolution fluid. The highres fluid is taken from a bottle with a dropper that has an emitter and added to the pool of lowres fluid, which needs to have basically no effect on the volume of that lowres fluid.

If I don't destroy the highres fluid on contact with other fluids I get nothing but problems:

- Even though the resolution ratio is very high and the amount of added fluid is very low, there still is a disproportionately large increase in total volume

- I'm already hitting the particle budget on my machine, so the highres fluid staying around creates a lasting performance hit that doesn't serve any purpose.

- Since the highres fluid is being sourced from a different emitter pool in the bottle, the script that controls the emitter on the dropper also needs to selectively destroy particles from the bottle pool to account for the fluid that is now stored as a value in the script. This means I run into the exact same issue again, I either have to destroy the dropper particles on contact with the bottle particles or the other way around. The only way to fix that I can see would be to remove the dropper emitter and instead create a script that moves the emitter from the bottle to the dropper after a few seconds and the sets the emission speed to 0, which is not exactly ideal either.

Print this item

  sewing simulator
Posted by: maygdirf - 04-05-2022, 09:27 AM - Forum: Obi Cloth - Replies (1)

Hi again,
I would like developing a sewing simulator with ObiCloth and ObiRope/Rod in order to emulate a piece of cloth and a needle with its thread. 
I was wondering if it's possible to create like a "sliding constraint" to simulate the movement of the needle and the thread when they pierce the cloth.

Thanks!

Print this item