Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Runtime Curve Editor

Discussion in 'Assets and Asset Store' started by Varaughe, Sep 16, 2018.

  1. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    A must have in any application created with Unity, that needs to visually edit curves, in a similar way provided by the Unity Editor's built-in Curve Editor.

     
    Last edited: Dec 16, 2019
  2. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    Last edited: Jan 22, 2020
    DragonCoder likes this.
  3. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    Runtime Curve Editor 2.1, is up on Unity Asset Store, in this version, GL "immediate mode" drawing has been replaced with Graphics.DrawMesh. So the drawing(and related code) is more efficient and it also works with HDRP or URP.
     
  4. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    466
    @Varaughe
    Hey there! I just purchased Runtime Curve editor and am running into some trouble, maybe you can help?

    I see that the prefab includes a camera and Screen Space Camera canvas. Unfortunately, that won't work for my project as all of my UI is on an Overlay canvas and I have other complicated camera setups that this wouldn't play nicely with.

    Is there a way to get it working with an Overlay canvas?
    My intention is to keep the curve window UI as a child of my main canvas, and just enable and disable it as I need, passing in single animation curves to initialize the editor with.
    I feel like this should be relatively basic, but I'm having some trouble getting it working with my existing canvas setup.

    Any help would be greatly appreciated!
     
  5. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    @MidnightCoffeeInc
    Moving this curve editor to Overlay canvas is out of question(I remember very well, how I had to change to Screen Space Camera canvas).

    Best you should do, is to have the Runtime Curve Editor's camera culling everything but a separate layer. I know it is UI the layer, but if this layer is used already by your setup, define another layer. The Canvas of this Runtime Curve Editor should have that new layer. If you have other cameras, just cull off this new layer of Runtime Curve Editor.

    So mainly, by correctly selecting the layer and the cameras' culling mask, you should be able to get what you need.
     
  6. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    466
    Ah, I understand, thank you for the info. Unfortunately that still won't work for my project because of a very specific UI setup, but I appreciate the reply nonetheless.
    I suggest adding some more info about the required canvas setup to the Store page so others don't get misled.
     
    antnasce likes this.
  7. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    It's definitely possible with any setup, including yours, unless you want (by any means) to have the Curve Editor a child of your main canvas which is overlay mode(not screen space). Rather you should contact me by email to check myself your project to find the best solution.
     
    SceneForgeStudio likes this.
  8. antnasce

    antnasce

    Joined:
    Apr 27, 2019
    Posts:
    12
    I love this asset, but like @MidnightCoffeeInc - it would be great to have some more documentation on how to position and create instances of the Runtime Curve editor.

    I'm still struggling to figure out a way to do the following:

    -Add a Runtime Curve Editor GUI object as a Child of an existing RectTransform in my canvas.

    e.g. I have a panel ("MyCurvePanel") in my main game Canvas, which is 1920x300 pixels in size.
    I would like to add the Runtime Curve Editor GUI as a child of MyCurvePanel, and have its size inherited.

    Whenever I try to do an parenting/childing of the Runtime Curve Editor, the camera curves do not update their position as expected.
     
  9. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    466
    This was exactly what I was trying to accomplish as well. Because the curves are being drawn to the camera with Graphics.DrawMesh, they have to be in camera space, and cannot be on an overlay canvas because the curves aren't UI elements. It results in elements being inconsistent in their placement: Some UI has to be in an overlay canvas, while the Curve Window has to be on its own camera canvas. I found this quite frustrating as I wanted all my UI to be in the same place for easy management and scripting. (The developer politely called my requirements "absurd" which didn't help the situation... No hard feelings, I understand that a lot of time was spent developing it, but it would be silly to say that it's perfect for all use cases.)

    In any case, I'm having this plugin re-designed using a UI line renderer so it works seamlessly on all canvas types. Because this is a paid asset that I already sunk money into (solo dev with a small budget), I'd be happy to share the result if you PM me.
     
    JohnnyBoyC and antnasce like this.
  10. Varaughe

    Varaughe

    Joined:
    Apr 22, 2013
    Posts:
    39
    @MidnightCoffeeInc "Because the curves are being drawn to the camera with Graphics.DrawMesh, they have to be in camera space, and cannot be on an overlay canvas because the curves aren't UI elements." !?
    Graphics.DrawMesh has nothing to do with "screen space - camera" choice over "screen space - overlay". I added Graphics.DrawMesh especially to support HDRP, and secondly, it's better and more natural to draw, the curves as an unitary mesh instead of a string of lines drawn in immediate mode.
    I preferred "screen space - camera" instead "screen space - overlay" many years ago, and nobody complained about it until some days ago :).
    The reason I preferred "screen space - camera", is because the gradations and the positions where the lines (making the curves) are plotted should not be influenced by the screen size.
    As I said, nobody complained before about this particular detail, and I offered my willingness to take a look on the projects using this Runtime Curve Editor, to give advices. So far, nobody asked me for help regarding this particular issue.
     
  11. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    466
    @Varaughe
    My mistake, I misunderstood the reasoning behind the choice.
    In any case, it's incompatible with my project. There isn't much else to say. Submitting a project for you to look over isn't always possible or ideal.
    I'm glad to hear that no one else has complained since you released the asset. It doesn't make it any less of a challenge to work with in some cases.
    I do sincerely appreciate the time you took to respond though, as I know the plugin has been available for quite some time :)

    PS: Unrelated: I will be purchasing your External Display plugin, it looks super cool!
     
    antnasce likes this.