※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

IExpressionTrack GetLayer(){
  return (IExpressionTrack)Property.This;
}
IExpressionTrack GetLayer(String name){
  return GetLayer(name, 0);
}
IExpressionTrack GetLayer(String name, int n){
  return (IExpressionTrack)ExpressionUtils.GetItems(
  ExpressionUtils.CastToExpressionItem(
  Property.Host.GetTimeline()), name)[n]; // Animator対策
}
 
IExpressionItem GetEffect(String ename){
  return GetEffect((IExpressionTrack)Property.This, ename, 0);
}
IExpressionItem GetEffect(IExpressionTrack layer, String ename){
  return GetEffect(layer, ename, 0);
}
IExpressionItem GetEffect(IExpressionTrack layer, String ename, int n){
  return ExpressionUtils.GetItems(layer.GetEffect(), ename)[n];
}
IEffectProperty GetProperty(String name){
  return GetProperty(Property.This, name);
}
IEffectProperty GetProperty(IExpressionItem effect, String name){
  return ExpressionUtils.GetProperty(effect.Properties, name);
}
 

/* そのレイヤーにエクスプレッション制御系のエフェクトがセットされている前提 */
IEffectProperty GetX(IExpressionTrack layer, String e, String p){
  return GetProperty(GetEffect(layer, e), p);
}
SingleProperty GetSingle(String name){
  return GetSingle(GetLayer(name));
}
SingleProperty GetSingle(IExpressionTrack layer){
  return (SingleProperty)GetX(layer, "スライダ(Single)", "スライダ");
}
PointFProperty GetPoint(String name){
  return GetPoint(GetLayer(name));
}
PointFProperty GetPoint(IExpressionTrack layer){
  return (PointFProperty)GetX(layer, "ポジション(PointF)", "ポジション");
}
StringProperty GetText(String name){
  return GetText(GetLayer(name));
}
StringProperty GetText(IExpressionTrack layer){
  return (StringProperty)GetX(layer, "テキスト", "テキスト");
}
 

/* タイミング用 */
StringProperty TimingText(IExpressionItem effect){
  return (StringProperty)GetProperty(effect, "キー情報(テキスト)");
}
int[] Timings(IExpressionItem effect){
  StringProperty prop = (StringProperty)GetProperty(effect, "OUTPUT");
  String[] ss = prop.TypeSafeValue.Split(new Char[] {','});
  int[] ret = new int[ss.Length-1];
  for(int i = 0; i < ss.Length-1; i++)ret[i] = int.Parse(ss[i]);
  return ret;
}
int TimingOffset(IExpressionItem effect){
  return TimingOffset(Timings(effect));
}
int TimingOffset(int[] a){
  int i;
  if(a.Length <= 0 || Property.Index < a[0])return -1;
  for(i = 0; i < a.Length && Property.Index >= a[i]; i++);
  return Property.Index - a[i-1];
}
 

/* テキストアニメータ用 */
IExpressionTextMaterial GetTAM(){
  return (IExpressionTextMaterial)Property.This;
}
IExpressionTextMaterial GetTAM(IExpressionItem anim){
  return ((IExpressionAnimator)anim).Material;
}
IExpressionAnimator GetTA(){
  return (IExpressionAnimator)Property.This;
}
IExpressionAnimator GetTA(IExpressionItem tam, String name){
  return GetTA(tam, name, 0);
}
IExpressionAnimator GetTA(IExpressionItem tam, String name, int n){
  return (IExpressionAnimator)ExpressionUtils.GetItems(
  ((IExpressionTextMaterial)tam).GetAnimator(), name)[n];
}