Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

SetEditorCurve set the wrong curve

Discussion in 'Editor & General Support' started by yinono, May 25, 2011.

  1. yinono

    yinono

    Joined:
    Sep 15, 2010
    Posts:
    27
    Hi,
    I wrote an editor script to copy animation curves between clips and game objects.
    But I encounter a problem sometimes SetEditorCurve set the curve to the wrong properites.
    I log all calls to SetEditorCurve and I'm sure the calls are:

    Code (csharp):
    1. SetEditorCurve(dstClip,"extrudedSurface3" , type ,"_MainTex.offset.x" , srcClip);
    2. SetEditorCurve(dstClip,"extrudedSurface3" , type ,"_IllumTex.offset.x" , srcClip);
    3. SetEditorCurve(dstClip,"extrudedSurface2" , type ,"_MainTex.offset.x" , srcClip);
    4. SetEditorCurve(dstClip,"extrudedSurface2" , type ,"_IllumTex.offset.x" , srcClip);
    where type is Material.

    still, when looking in the AnimationEditor I found that on extrudedSurface2 the curves where assigned correctly but on
    extrudedSurface3 the curves where assigned to "_MainTex.offset.y" and "_IllumTex.offset.y".

    It appear this behavior somehow has connection to the names of the game object and if there are no similar names in the paths of the different curves this bug doesn't happen.

    Any clue?

    Thanks
    Yinon