public void CreateKey(xmAPI::xmPostprocessParamType paramType, float time) { xmAPI::xmPostprocessParam param = animator.GetParam(paramType); try { switch (paramType) { case xmAPI::xmPostprocessParamType.AddColor: case xmAPI::xmPostprocessParamType.BaseColor: // 3 components param.AddValue(time, 0.0f, 0); param.AddValue(time, 0.0f, 1); param.AddValue(time, 0.0f, 2); break; case xmAPI::xmPostprocessParamType.GrayColor: // 3+1 components param.AddValue(time, 0.0f, 0); param.AddValue(time, 0.0f, 1); param.AddValue(time, 0.0f, 2); param.Dispose(); param = animator.GetParam(xmAPI::xmPostprocessParamType.GrayValue); param.AddValue(time, 0.0f, 0); break; case xmAPI::xmPostprocessParamType.DualityH: param.AddValue(time, 0.44f, 0); param.Dispose(); param = animator.GetParam(xmAPI::xmPostprocessParamType.DualityV); param.AddValue(time, 0.44f, 0); // 2 components break; case xmAPI::xmPostprocessParamType.NoiseIntensity: param.AddValue(time, 0.33f, 0); param.Dispose(); param = animator.GetParam(xmAPI::xmPostprocessParamType.NoiseGrain); param.AddValue(time, 0.11f, 0); param.Dispose(); param = animator.GetParam(xmAPI::xmPostprocessParamType.NoiseFps); param.AddValue(time, 1.0f, 0); break; case xmAPI::xmPostprocessParamType.Blur: case xmAPI::xmPostprocessParamType.ColorMappingInfluence: // 1 component param.AddValue(time, 0.33f, 0); break; default: throw new ArgumentException("Invalid param type."); } } finally { param.Dispose(); } }
public float GetBlur(int keyIndex) { float result; float time; using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.Blur)) { time = param.GetKeyTime(keyIndex); param.GetValue(time, out result, 0); } return(result); }
public ColorMappingParams GetColorMapping(int keyIndex) { ColorMappingParams result; float time; using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.ColorMappingInfluence)) { time = param.GetKeyTime(keyIndex); param.GetValue(time, out result.Influence, 0); } result.Texture = animator.PPInfo.ColorMappingGradient1; return(result); }
public ColorF GetBaseColor(int keyIndex) { ColorF result; float time; using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.BaseColor)) { time = param.GetKeyTime(keyIndex); result.a = 0; param.GetValue(time, out result.r, 0); param.GetValue(time, out result.g, 1); param.GetValue(time, out result.b, 2); } return(result); }
public Vector2F GetDuality(int keyIndex) { Vector2F result; float time; using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.DualityH)) { time = param.GetKeyTime(keyIndex); param.GetValue(time, out result.x, 0); } using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.DualityV)) { param.GetValue(time, out result.y, 0); } return(result); }
public NoiseParams GetNoise(int keyIndex) { NoiseParams result; float time; using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.NoiseIntensity)) { time = param.GetKeyTime(keyIndex); param.GetValue(time, out result.Intensity, 0); } using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.NoiseGrain)) { param.GetValue(time, out result.Grain, 0); } using (xmAPI::xmPostprocessParam param = animator.GetParam(xmAPI::xmPostprocessParamType.NoiseFps)) { param.GetValue(time, out result.FPS, 0); } return(result); }