Search Unity

BaseMeshEffect Fluctuations

Discussion in 'UGUI & TextMesh Pro' started by Claytonious, Sep 28, 2015.

  1. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    732
    With Unity 5.2p1, the API for BaseMeshEffect has changed yet again, this time requiring us to implement

    Code (csharp):
    1. public abstract void ModifyMesh (VertexHelper vh);
    The previous method that took a Mesh is still there, too:

    Code (csharp):
    1. public virtual void ModifyMesh (Mesh mesh);
    (which was much nicer to work with and more efficient for our use cases).

    Is this API stable now? We're changing all of our code for the 3rd or 4th time to account for this API changing so frequently. Can we please implore you great folks at UT to settle on a direction here and stick with it? We can adapt to whatever direction you need to go, but it has been changing so often that it has become really painful to upgrade Unity versions. Do we think this new API is "the one" for a while, or should we expect more changes here soon?

    Also, is there any longer any point in overriding the method takes a Mesh? Since the one that takes a VertexHelper is abstract we're stuck having to override that guy, so why is the other one still there? Also, are there any code samples for how to properly use this new version that takes VertexHelper? We are clearing it and re-adding the stream on every frame which sounds wasteful. Are we supposed to somehow keep that "stream" from one frame to the next? And what is stream-oriented about it, anyway? It's exposed as a simple List<UIVertex> to us.

    Thanks very much!
     
    wikmanyo likes this.
  2. wikmanyo

    wikmanyo

    Joined:
    Nov 17, 2012
    Posts:
    55
    I detest that vertex helper class!!! :) mesh was so much easier and quicker to work with! Hope they change it back...
     
    Jaroslav-Stehlik likes this.
  3. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    732
    Ack. Well, if so, hopefully they change it back *only* one more time!
     
  4. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,206
    From my knowledge this is stable now (at least i dont know of any plans to change it again). the version that takes a Mesh is actually marked as Obsolete so although its still there i wouldn't use it.
     
  5. mandarin

    mandarin

    Joined:
    Dec 8, 2009
    Posts:
    21
    I don't mind the changes, but you could at least update the documentation to reflect the changes.

    I tried looking for help in the repo at Bitbucket, but the BaseMeshEffect file in the 5.2 branch still accepts Mesh as parameter for ModifyMesh(). How come the changes aren't visible in the repo?
     
  6. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,206
    We dont push changes to the repo for patch releases. Each merge is a very manual process and we would rather spend the time fixing bugs then doings a merge.

    As for the documentation it should have been updated but i'll double check that.
     
  7. alesm-o7

    alesm-o7

    Joined:
    Sep 30, 2015
    Posts:
    3
    I can confirm that in 5.2.1p1 the
    Code (CSharp):
    1. public override void ModifyMesh(Mesh mesh)
    doesn't work anymore (and it is not marked as obsolete).

    That means that we have to make the third version of the same code in less than a month. Seriously guys?

    Regards,
    Ales
     
    wikmanyo and Mistermind like this.
  8. brianleake

    brianleake

    Joined:
    Feb 5, 2013
    Posts:
    10
    Glad I'm not the only one disoriented by this. We're in the middle of transitioning a project from 5.1 to 5.2, I already had to rewrite some text gradient stuff which was based on this classic example -

    http://forum.unity3d.com/threads/basevertexeffect-change-to-basemesheffect.338455/

    Just installed 5.2.1p1 and hit the same issue.

    Does anybody have a nice little example of the equivalent using ModifyMesh (VertexHelper vh)? The docs on this seem really poor.

    I'm basically just trying to re-implement the font gradient example (above link) as a start.
     
    Mistermind likes this.
  9. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Could there be at least a way to access the mesh inside the vertex helper?
    Because some of us don't need vertex helper, because our mesh is already
    in the memory so why use another CPU cycles to recreate something which already
    is a mesh...
     
    michael_house and wikmanyo like this.
unityunity