public Plugin(Animatable a) : base(a) { className = a.ClassName; cid = a.ClassID; scid = a.SuperClassID; ReferenceTarget rt = a as ReferenceTarget; var pbs = new List <ParameterBlock>(); if (rt == null) { targets = new Reference[0]; } else { targets = new Reference[rt.NumTargets]; for (int i = 0; i < rt.NumTargets; ++i) { var target = rt.GetTarget(i); targets[i] = new Reference(target); if (target is ParameterBlock1) { pbs.Add(new ParameterBlock(target as ParameterBlock1)); } else if (target is ParameterBlock2) { pbs.Add(new ParameterBlock(target as ParameterBlock2)); } } } paramblocks = pbs.ToArray(); }
/// <summary> /// Returns an animatable from a super class ID and a class ID /// </summary> /// <typeparam name="T"></typeparam> /// <param name="scid"></param> /// <param name="cid"></param> /// <returns></returns> public static T CreatePluginInstance <T>(SuperClassID scid, ClassID cid) where T : Animatable { // Note: the global Kernel.g.CreateInstance() function is broken! This caused me a lot of grief. object o = Kernel._Interface.CreateInstance(scid, cid._IClass_ID); IAnimatable ia = o as IAnimatable; T r = CreateWrapper <T>(ia); if (r == null) { throw new Exception("Failed to create plug-in instance"); } return(r); }
public IEnumerable <Node> NodesBySuperClass(SuperClassID sid) { return(from n in NodeTree where n.Object != null & n.SuperClassID == sid select n); }
public static Animatable Create(SuperClassID scid, ClassID cid) { return Animatable.CreatePluginInstance<Animatable>(scid, cid); }
public static IEnumerable<Node> NodesListBySuperClasses(this Scene scene, SuperClassID[] sids) { return from n in scene.NodeTree where n.Object != null && sids.Any(sid => n._Node.EvalWorldState(0, false).Obj.SuperClassID == sid) select n; }
public static IEnumerable<Node> NodesListBySuperClass(this Scene scene, SuperClassID sid) { return from n in scene.NodeTree where n.Object != null && n.Object.SuperClassID == sid select n; }
public static Animatable Create(SuperClassID scid, ClassID cid) { return(Animatable.CreatePluginInstance <Animatable>(scid, cid)); }
public AppData(IAnimatable anim, ClassID cid, SuperClassID scid) { this.anim = anim; this.cid = cid; this.scid = scid; }
public AppData GetAppData(ClassID cid, SuperClassID scid) { return(new AppData(_Anim, cid, scid)); }
public Plugin(Animatable a) : base(a) { className = a.ClassName; cid = a.ClassID; scid = a.SuperClassID; ReferenceTarget rt = a as ReferenceTarget; var pbs = new List<ParameterBlock>(); if (rt == null) { targets = new Reference[0]; } else { targets = new Reference[rt.NumTargets]; for (int i = 0; i < rt.NumTargets; ++i) { var target = rt.GetTarget(i); targets[i] = new Reference(target); if (target is ParameterBlock1) { pbs.Add(new ParameterBlock(target as ParameterBlock1)); } else if (target is ParameterBlock2) { pbs.Add(new ParameterBlock(target as ParameterBlock2)); } } } paramblocks = pbs.ToArray(); }