Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Curvy in Prefabs
#1
Sad 
We've been looking into Curvy for the splines in our game, but we've been hitting some big issues with the way it seems to serialize generated meshes.

Part of the benefit of the 2018.3 prefab model is that you can have multiple people working on separate prefab files, without having to modify (or checkout) the main scene. This makes it really easy to collaborate on smaller bits of a bigger level.

From what I can tell, Curvy saves all generated meshes into the Scene file you currently have open, even if that spline/generator is in a Prefab. This makes for a lot of source control churn, and lots of merge conflicts, even if the change you made was quite small. Based on the way Curvy uses game objects to store spline data, it really *should* be possible to even have multiple people edit the same spline without issues! 

Is there any way to set Curvy to either:
 - Save the generated meshes to the lowest parent prefab.
 - Don't serialize/cache the generated meshes, and instead mark them with hideflags.DontSave

I like Curvy a lot, generally speaking, but it's pretty unworkable given how much it saves globally.  

Sad
Reply
#2
I've done a bit more digging, and have turned another highly related issue: generators in prefab instances generate unique meshes. 

This means that if I make a simple extruded hoop generator within a prefab, and instantiate that prefab 50 times in a scene, each individual hoop has an entirely different mesh generated and saved to the Scene file. Sad

That'd absolutely crash the performance of anything using generators heavily. :\


I've just found out that Curvy's source is included. I'm going to take a dive and see if I can pin down more information.
Reply
#3
Hi,
I did the simple test of making a prefab of a generator (including the generated mesh gameobject), and then modifying the prefab. The generated mesh being part of the prefab, the scene was not modified. So you can modify prefabs without having to modify the scene. Your use case being more complicated than this simple example, I might have missed something.

Here is more information that might help you:
  1. You can export the generated mesh as an asset using the export tab: https://curvyeditor.com/documentation/generator/modules/createmesh?#export
  2. If you need 50 copies of the same generator, generating the same mesh, then you should have only one generator which result is copied 50 times
  3. The Volume Mesh module has a split option that allows to subdivide the generated volume into smaller parts. That helps if you want to modify a small part without having to regenerate the whole mesh: https://curvyeditor.com/documentation/generator/modules/volumemesh?s[]=split#general
  4. About the DontSave flag, there is nothing in the UI that allows that, but you can modify the code for that. A good starting point would be CreateMesh.writeVMeshToMesh method
  5. If a generator in a prefab tries to remove a gameobject (for example one of multiple meshes it is generating), Unity does not allow it to do so. You will then have an error message and the object will not be removed.
Please let me know if you need more information
have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  CurvyConnections inside prefabs CoolUser 9 3,884 10-02-2024, 06:41 PM
Last Post: _Aka_
  Invisible Gizmos In Latest Curvy Splines orrenravid1 1 5 06-11-2024, 07:36 AM
Last Post: _Aka_
  Deforming prefabs with LODs along a spine LiveWire 6 27 05-29-2024, 08:25 AM
Last Post: _Aka_

Forum Jump: