Obi Official Forum

Full Version: Tutorial?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello all,

Maybe I am missing something, but all I see are two very basic tutorials :
1)https://www.youtube.com/watch?v=ikjHVxO3Fks
2)https://www.youtube.com/watch?v=PBcIC1-ENAI

The second one doesn't even seem current to match my inspector.
I don't see anything that installed with the pack?

I've managed to make a cylinder as a temp garbage can but it looks horrible when the game starts 

Before: 
https://i.imgur.com/tNbSnem.png
Scene Start: 
https://i.imgur.com/npzvb7Q.png


Theres a ton of settings on this the ObiSolver, ObiSoftBody, Obi Softbody Skinner.
I'm not even sure where to begin with making this less giggly.

The idea behind the project Im working on is a ball will hit the trash can and the impact will deform the mesh. I am not trying to have it deform from the ground?

Also getting this error
https://i.imgur.com/8YLnsyF.png

Any advice would be much appreciated.
Hi Havie,

The second tutorial you link to is for Obi 4.1, as stated in the video title. 5.X underwent a large revamp in workflow, API, and interface.

The official manual can be found here: http://obi.virtualmethodstudio.com/tutorials/index.html
It describes in detail what types of blueprints are, how to set them up, as well as all solver parameters, etc. I'd recommend starting by reading these:
http://obi.virtualmethodstudio.com/tutor...cture.html <--- regarding Obi's overall architectural design
http://obi.virtualmethodstudio.com/tutor...olver.html  <--- regarding ObiSolver, the component in charge of performing the actual simulation.
http://obi.virtualmethodstudio.com/tutor...gence.html <--- regarding how the simulation is performed.
http://obi.virtualmethodstudio.com/tutor...setup.html <--- regarding ObiSoftbody blueprints and softbody setup.
http://obi.virtualmethodstudio.com/tutor...aints.html <--- regarding shape matching constraints.
http://obi.virtualmethodstudio.com/tutor...inner.html  <--- regarding ObiSoftbodySkinner.

Obi is a really large and complex system, aimed at advanced users. It assumes you're pretty comfortable with basic 3D and physics concepts such as vector spaces, triangle mesh structure, mass, forces, torques, timestep, etc, so what these are is not explained in detail. If you're starting out with 3D or physics it will take some time to get up and running.

Code:
I've managed to make a cylinder as a temp garbage can but it looks horrible when the game starts 
No wonder it looks bad, the built-in cylinder mesh in Unity has no subdivisions along its length. So it won't be able to bend or deform in any meaningful way, as you can't bend a single triangle:
[Image: ti72x4g.png]


[Image: npzvb7Q.png]
Looks like your constraints have quite high plasticity. That, or the skinner is not correctly bound to the softbody. You might want to click the "bind skin" button in the ObiSoftbodySkinner, as warned in the manual:

http://obi.virtualmethodstudio.com/tutor...inner.html
Quote:If you re-generate the softbody blueprint but do not re-bind the skin, skinning will look incorrect. You want to Generate the blueprint first, then Bind the skinner, in that order.

You can add a ObiParticleRenderer component to the softbody to visualize and debug the underlying particles. (see http://obi.virtualmethodstudio.com/tutor...ering.html)

Quote:I'm not even sure where to begin with making this less giggly.

Increase the amount of shape matching constraint iterations (found in the solver's constraints foldout) and/or reduce the physics timestep. A quick way to do this is to use more updater substeps. The effect of iterations/substeps on the resulting simulation is discussed in great detail here: http://obi.virtualmethodstudio.com/tutor...gence.html

Note this applies to all iterative physics engines, so the same can be done with Unity, Havok, etc.

Code:
The idea behind the project Im working on is a ball will hit the trash can and the impact will deform the mesh. I am not trying to have it deform from the ground?
You can't filter out which objects deform the softbody, as deformation happens purely due to strain (as a result of forces being applied to it), not due to contact with a particular body: If you hit the trashcan with a ball, depending on their relative mass the trashcan will deform a lot or not deform at all. But if there's a wall/ground that the ball can press the trashcan against, the trashcan will noticeably deform even if the ball is relatively light.


Quote:Also getting this error
https://i.imgur.com/8YLnsyF.png

Make sure you don't have multiple inspector tabs open, the blueprint editor currently does not support multiple editor inspector instances.
Thanks for the reply, 
I've begun reading all the material (I'm taking my 1st PHY class now)

What's concerning me though is that I'm following the tutorial and doing the base steps and something is wrong.

Would you mind taking a look at this 1min video?

https://youtu.be/_1qY8V4qQbA
(16-09-2020, 09:00 PM)Havie Wrote: [ -> ]Thanks for the reply, 
I've begun reading all the material (I'm taking my 1st PHY class now)

What's concerning me though is that I'm following the tutorial and doing the base steps and something is wrong.

Would you mind taking a look at this 1min video?

https://youtu.be/_1qY8V4qQbA

Chances are the skinning max distance in your ObiSoftbodySkinner is too low (see http://obi.virtualmethodstudio.com/tutor...inner.html ).The particle representation of your sphere looked quite sparse to me, many vertices are far away fron the closest particle.

SkinnedMeshRenderer will render unskinned vertices at the local origin of the mesh, which is what is shown in your video. So cranking up the skinning max distance will ensure all vertices are skinned, no matter how far away from a particle.
(16-09-2020, 10:18 PM)josemendez Wrote: [ -> ]Chances are the skinning max distance in your ObiSoftbodySkinner is too low (see http://obi.virtualmethodstudio.com/tutor...inner.html ).The particle representation of your sphere looked quite sparse to me, many vertices are far away fron the closest particle.

SkinnedMeshRenderer will render unskinned vertices at the local origin of the mesh, which is what is shown in your video. So cranking up the skinning max distance will ensure all vertices are skinned, no matter how far away from a particle.

Skinning max distance was at 0.5. I changed to 0.1 did not make a difference. 

Not sure about my particle representation of my sphere being sparse? Im literally just following the tutorial on YT and it generated as such.

Addiontally,

Ive tried making a new scene, repeated all the same steps and now the ball flies in the air..
https://youtu.be/XgF25AqMkUQ
SO,

I've fixed the flying in the air issue,
it was a combination of having a rigidbody with Gravity and an Obi Collider .
For whatever reason this would enact all sorts of weird force onto the ball,
So ive removed the Collider entirely.

However, I can no longer enact force on this ball.
Prior to adding the OBISoftbody I was moving my ball through the scene with :

_rigidbody.AddForce(direction * BallFireForce, ForceMode.Impulse);

However, this no longer does anything. Probably being prevented from the OBI system.

I tried adding an ObiRigidBody to my script instead, but it does not have a AddForce method?

I went looking for docs on ObiSoftBodies how to move them, and ObiRigidBodies, but all i could find was : 
UpdateVelocities(linearDelta, angularDelta)

http://obi.virtualmethodstudio.com/api.html

I have no clue how to use these, it says it gets the velocities back from the solver? Is the Solver keeping track of my base rigidbodies velocity? This doesnt feel right

Thanks
(17-09-2020, 08:10 PM)Havie Wrote: [ -> ]Skinning max distance was at 0.5. I changed to 0.1 did not make a difference. 

Not sure about my particle representation of my sphere being sparse? Im literally just following the tutorial on YT and it generated as such.

Addiontally,

Ive tried making a new scene, repeated all the same steps and now the ball flies in the air..
https://youtu.be/XgF25AqMkUQ

In my book 0.1 < 0.5, so if anything this would have worsened the result Sonrisa. You need to increase the skin radius so that vertices far away from a particle actually get skinned, so try using 1 or 1.5 instead, then hit "bind skin".

The tutorial on YT uses a different mesh than the one you’re using, you need to adjust parameters according to your mesh of course. The defaults will work for reasonably sized/tesselated meshes, but won't work for any mesh. What each parameter does and how to adjust them is explained in the manual.
(18-09-2020, 12:14 AM)Havie Wrote: [ -> ]SO,

I've fixed the flying in the air issue,
it was a combination of having a rigidbody with Gravity and an Obi Collider .
For whatever reason this would enact all sorts of weird force onto the ball,
So ive removed the Collider entirely.

However, I can no longer enact force on this ball.
Prior to adding the OBISoftbody I was moving my ball through the scene with :

_rigidbody.AddForce(direction * BallFireForce, ForceMode.Impulse);

However, this no longer does anything. Probably being prevented from the OBI system.

I tried adding an ObiRigidBody to my script instead, but it does not have a AddForce method?

I went looking for docs on ObiSoftBodies how to move them, and ObiRigidBodies, but all i could find was : 
UpdateVelocities(linearDelta, angularDelta)

http://obi.virtualmethodstudio.com/api.html

I have no clue how to use these, it says it gets the velocities back from the solver? Is the Solver keeping track of my base rigidbodies velocity? This doesnt feel right

Thanks

I sense a LOT of confusion here, so I'll try my best to explain.

Mixing rigidbody and softbody components together in the same object doesn't make much sense. This isn't even specific to Obi, but a basic concept in physics: a rigidbody, as the name implies, approximates the dynamics of an object assuming it cannot deform as a result of stress. So, it's a rigid object.

On the other hand, a softbody also approximates the dynamics of an object but does not assume it will be rigid. The object is allowed to deform due to stress, it's a soft object.

So placing both a rigid and a soft body component on a single object serves no purpose whatsoever and doesn't even make sense. It's like saying an object is liquid and solid at the same time, and applying both liquid and solid physics to it. An object is either a softbody or a rigidbody, can't be both at once. (In real life though, all objects are "softbodies" as anything will deform under a high enough amount of stress. The "rigidbody" mathematical model is a huge simplification that works well in many cases, and is used instead because it is much cheaper to calculate compared to most softbody models).

Take a look at the API docs: Softbodies (actually, all actors) have the same AddForce() method that rigidbodies do, as softbodies are basically an "upgrade" from rigidbodies. So you should be able to just do softbody.AddForce() ("softbody" being of type ObiSoftbody). Note that an impulse takes object mass into account -as an impulse is basically an instant force-, so the effect on your softbody depends on how heavy it is. You can control particle mass individually in the blueprint editor.

The ObiRigidbody component is just a wrapper over Unity's rigidbody component, and is used to make rigidbodies "visible" to Obi so that they can interact with softbodies in the scene. It's automatically added when needed so you shouldn't bother. See: http://obi.virtualmethodstudio.com/tutor...sions.html
Ahh thank you for clearing that up.

This makes a lot more sense.

Next I need to get my ball and trash can to collide.

So reading the section about collisions here : 
http://obi.virtualmethodstudio.com/tutor...sions.html

I've gone ahead and added a box collider to my trash can , a sphere collider to my ball, and an Obi Collider to both.

However, when the scene starts my ball starts flying up and into the sky, and the trash can falls over despite being on the ground.

https://youtu.be/5_4LOnsog_g

any idea whats causing this?
(18-09-2020, 09:12 PM)Havie Wrote: [ -> ]Ahh thank you for clearing that up.

This makes a lot more sense.

Next I need to get my ball and trash can to collide.

So reading the section about collisions here : 
http://obi.virtualmethodstudio.com/tutor...sions.html

I've gone ahead and added a box collider to my trash can , a sphere collider to my ball, and an Obi Collider to both.

However, when the scene starts my ball starts flying up and into the sky, and the trash can falls over despite being on the ground.

https://youtu.be/5_4LOnsog_g

any idea whats causing this?

Again, mixing colliders and softbodies in the same object makes no sense. Collider components are used in Unity to define the shape of rigidbodies, so there’s no use adding them to a softbody. A softbody does not need any collider component to interact with other objects, as it is represented by a bunch of particles, and particles already can collide between them.

You really  need to establish a clear cut between rigidbodies and softbodies in your mind. Haphazardly mixing their components together will always  result in weird behavior. In your video, you’ve added a collider to the sphere softbody. So the sphere is colliding with itself, trying to get away from its current position in any way possible, that’s why it floats: the poor thing is literally running from itself Guiño.

-Rigidbody: shape defined by collider component(s), dynamics driven by rigidbody component. You can think of colliders/rigidbodies as two sides of the same coin: collider components define shape, rigidbody components apply dynamics (motion). See the Unity manual for more info.

-Softbody: shape and dynamics are both defined by particles. Particles act as “atoms” in a sense. No need to add rigidbodies or colliders, as these are reserved for rigidbody interaction/dynamics.

For a softbody to collide with a rigidbody, the rigidbody colliders need to have a ObiCollider component so that the softbody “sees them”. ObiCollider and ObiRigidbody are just wrappers, that allow Unity’s rigidbody engine to interact with Obi’s particle engine.

For a softbody to collide with another softbody (this is called intercollision) their particles just need to have different phase values. This is explained in the manual. No need for colliders or rigidbodies to be involved.

Note most of this information is applicable to all game/physics engines. Rigid and softbodies are simulated in different ways, and while there are mechanisms to make them interact with each other (in this case, ObiCollider and ObiRigidbody, that allow Obi particles to collide with and apply forces to rigidbodies) mixing rigidbody and softbody bits in the same object serves no practical purpose.
Pages: 1 2