Obi Official Forum
Mesh creating - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Mesh creating (/thread-846.html)

Pages: 1 2


Mesh creating - Evgenius - 29-01-2019

Can I create a mesh of the created rope to use it as a simple model?


RE: Mesh creating - josemendez - 29-01-2019

(29-01-2019, 12:48 PM)Evgenius Wrote: Can I create a mesh of the created rope to use it as a simple model?

Nope, as far as I know Unity does not allow to serialize assets created at runtime. You cannot use AssetDatabase.CreateAsset to save something created at runtime, I might be wrong about this though.


RE: Mesh creating - Evgenius - 29-01-2019

(29-01-2019, 01:25 PM)josemendez Wrote: Nope, as far as I know Unity does not allow to serialize assets created at runtime.  You cannot use AssetDatabase.CreateAsset to save something created at runtime, I might be wrong about this though.

Not necessary in runtime. It's just much easier to make a static rope coil using ObiRope, than modeling it from scratch.


RE: Mesh creating - josemendez - 29-01-2019

(29-01-2019, 01:40 PM)Evgenius Wrote: Not necessary in runtime. It's just much easier to make a static rope coil using ObiRope, than modeling it from scratch.

Oh, so you mean creating a mesh by simply using the curve component, not after simulating the resulting rope?


RE: Mesh creating - Evgenius - 29-01-2019

(29-01-2019, 01:55 PM)josemendez Wrote: Oh, so you mean creating a mesh by simply using the curve component, not after simulating the resulting rope?

Exactly Sonrisa


RE: Mesh creating - josemendez - 29-01-2019

(29-01-2019, 02:21 PM)Evgenius Wrote: Exactly Sonrisa

This is not supported right now, but should be doable. I'll see if I can hack something together.


RE: Mesh creating - Evgenius - 07-02-2019

(29-01-2019, 03:30 PM)josemendez Wrote: This is not supported right now, but should be doable. I'll see if I can hack something together.

Hello again! Did you find any solution?


RE: Mesh creating - josemendez - 07-02-2019

(07-02-2019, 09:52 AM)Evgenius Wrote: Hello again! Did you find any solution?

Hi there!

We ended up implementing something similar not in ObiRope, but in our trail renderer (Ara). You can now select an arbitrary shape to be extruded along the trail. Still, this is not quite the use case you wanted (create a completely static mesh from the cable in editor, for using it like a regular mesh), as this recomputes the mesh every frame.

We are looking into your specific use case, expect an answer very soon.


RE: Mesh creating - josemendez - 07-02-2019

Here's it, turned out to be simpler than expected.

Replace ObiEditorUtils.cs and ObiRopeEditor.cs with the ones I'm providing. Then, a new button "Bake Mesh" in the ObiRope inspector will appear below the "Initialize" button. Upon clicking it, Unity will ask you for a folder to save the mesh to. Then you can use this mesh in any scene as a regular static mesh.

Only works with ObiRopeExtrudedMeshRenderer and ObiRopeMeshRenderer (since ObiRopeLineRenderer is view-dependent and ObiRopeChainRenderer is made up of static meshes).

This functionality will be included in ObiRope,ObiCloth and ObiSoftbody in the next update.


RE: Mesh creating - Evgenius - 07-02-2019

(07-02-2019, 11:31 AM)josemendez Wrote: Here's it, turned out to be simpler than expected.

Replace ObiEditorUtils.cs and ObiRopeEditor.cs with the ones I'm providing. Then, a new button "Bake Mesh" in the ObiRope inspector will appear below the "Initialize" button. Upon clicking it, Unity will ask you for a folder to save the mesh to. Then you can use this mesh in any scene as a regular static mesh.

Only works with ObiRopeExtrudedMeshRenderer and ObiRopeMeshRenderer (since ObiRopeLineRenderer is view-dependent and ObiRopeChainRenderer is made up of static meshes).

This functionality will be included in ObiRope,ObiCloth and ObiSoftbody in the next update.

Works like a charm, thanks a lot! Is there a possibility for the same feature for chains in the future?