Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity4.5 AnimationCurve - Is the property "_MainTex.rotation" valid ?

Discussion in 'Animation' started by TreasureMap, Nov 13, 2014.

  1. TreasureMap

    TreasureMap

    Joined:
    Apr 23, 2014
    Posts:
    14
    I have imported uv animation curve data from maya into unity (via fbx custom properties).

    Once the data is imported into unity, I apply the curve data to an animation clip, using the respective animation curve properties: _MainTex.offset, _MainTex.scale, _MainTex.rotation.

    When I run my scene and play the clip, the offset and scale properties affect the main texture appropriately, but I don't see any rotation happening.

    (Yes, I have all the necessary data set, and can see the data in the legacy animation editor)

    I have seen code samples on the net using the _MainTex.rotation property for anim curves.

    Question: Is the animation curve property _MainTex.rotation valid and usable ?

    If so, is there a specific way it is to be used ?

    [Example Code]
    1. voidApplyCurveToClip(AnimationClip clip){
    2. AnimationCurve curve =AnimationCurve.Linear(0,0,1.8,360);
    3. curve.postWrapMode =WrapMode.Loop;
    4. clip.SetCurve("",typeof(Material),"_MainTex.rotation", curve);
    5. }