Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mesh creating
#1
Pregunta 
Can I create a mesh of the created rope to use it as a simple model?
Reply
#2
(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.
Reply
#3
(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.
Reply
#4
(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?
Reply
#5
(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
Reply
#6
(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.
Reply
#7
(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?
Reply
#8
(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.
Reply
#9
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.


Attached Files
.cs   ObiEditorUtils.cs (Size: 1.6 KB / Downloads: 10)
.cs   ObiRopeEditor.cs (Size: 5.9 KB / Downloads: 8)
Reply
#10
(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?
Reply