Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Move the Create Mesh of a CurvyGenerator Out of the Main Parent
#1
Hello it's me again Smile

I have 2 little question:

1) About the CurvyGenerator, I would like to Move the CreateMesh Outside de main parent, and keep the link wiht the Curvy Generator:
[Image: IGijBnNXnEa_Capture.PNG]
Then, put the Tag [EditorOnly] on the CurvyGenerator Object, for saving performance in build (in the build, I want only the mesh)

But when I do, in the CurvyGenerator Graph editor it is no longer present:
[Image: IGijDMmqzNa_Capture2.PNG]

And when I try to relink it again, it does'nt work...
From the inspector in the field VolumeMesh>Slots>VMesh, it say in the console 
"[Curvy] Linking modules from the inspector isn't supported yet! Use the Graph editor instead!"

and from the graph, I just can't add it any more. 

EDIT: For relinking it I have to: close the graph editor, then move the Create Mesh as child of the CurvyGenerator, and then open the graph again to relink it. So it seems to keep the link the first time I move CreateMesh from outside, but as soon as I open the graphEditor, I have to manyally do this trick

2) A realy quick question about the Event of the Curvy Spline:
If I want to trigger an event when the spline is changed (add/delete controle point, OR just move a controlPoint), it seems like the event OnAfterControlPointChanges seems the right one, but in the documentation it's say only for add/delete point, not for move. Does it trigger also for moving a control point ?

Thanks you Smile
Reply
#2
Hi,
1) The modules are expected to stay under the generator that created them. To export a mesh, there are two actions in the Create Mesh module, "Save to scene" and "Save mesh asset(s)"
https://curvyeditor.com/documentation/generator/modules/createmesh?redirect=1#save_to_scene
After exporting your mesh, just disable the curvy generator's game object, and do your build. I guess, even though I haven't tested it, you can use some Unity pre-build hook to automate this operation using Curvy's API

2)You can find here more information about those events:
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a36d540c6761a80634b25f67886fbb5a8
OnAfterControlPointChanges does not trigger when a Control Point moves.
OnGlobalCoordinatesChanged is related to the spline's transform, not the CPs' ones.
Unity's Transform.hasChanged will help you achieve what you need. This is what I used to implement CurvySpline.OnGlobalCoordinatesChanged
https://docs.unity3d.com/ScriptReference/Transform-hasChanged.html

Please let me know if you still have any questions.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
1) Ok, I guess I will let the Mesh inside the generator for now. It Would be great if I could Say to the generator to load the mehs in a special gameObject. Does the Generator take processing time in play mode ? I will disable the CurvyGenerator in play mode, I think that will do for now.

2) Oh ok, I will do my custom test with Transform.HasChanded when looping on all CP Smile

Thanks you
Reply
#4
1) The module is expected to stay inside the generator, not the mesh it generates. "Say to the generator to load the mehs in a special gameObject" is what the "Save to scene" button does.
The generator, expect if disabled, does take processing time in play mode, when starting the game.

Is my answer what you were expecting or am I misunderstanding your question?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Heart Create beautiful curves ShiroeYamamoto 3 9 03-26-2024, 06:25 PM
Last Post: _Aka_
  Adjust radius of generated mesh via script? Shackman 1 3 03-26-2024, 01:12 PM
Last Post: _Aka_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_

Forum Jump: