- Home /
Unity4.5 AnimationCurve - Is the property "_MainTex.rotation" valid ?
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 appropritely, 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, are there any rules or quid pro quo that must be adhered to in order to use it ?
[Example Code]
void ApplyCurveToClip (AnimationClip clip) {
AnimationCurve curve = AnimationCurve.Linear(0, 0, 1.8, 360);
curve.postWrapMode = WrapMode.Loop;
clip.SetCurve ("", typeof(Material), "_MainTex.rotation", curve);
}