public void AddModifier(Modifier m) { if (Node != null) { Node.AddModifier(m); } }
public void AddNodes(Node node, IEnumerable <SerializableScene.Node> nodes) { foreach (var n in nodes) { // Create the associated plug-in (or look it up) var obj = CreatePlugin <SceneObject>(n.sceneobject.id); if (obj == null) { throw new Exception("Could not create scene object associated with node " + n.name); } // Create the node with the object and name Node child = node.AddNewNode(obj, n.name); // Set the transform child.NodeTransform = n.transform; // Make sure that the node is listed in the created animss anims.Add(n.id, child); // Add modifiers foreach (var m in n.modifiers) { var mod = CreatePlugin <Modifier>(m.id); if (mod != null) { child.AddModifier(mod); } else { throw new Exception("Could not create modifier"); } } // Add sub-nodes AddNodes(child, n.nodes); } }
public void Apply(Node n) { n.AddModifier(this); }