public void PreEvaluate(OperatorPart opPart) { if (opPart.Disabled) { return; } var transformFunc = opPart.Func as ISceneTransform; if (transformFunc != null) { _transforms.Push(transformFunc.Transform * _transforms.Peek()); } var meshSupplier = opPart.Func as IMeshSupplier; if (meshSupplier != null) { if (!CollectedMeshes.ContainsKey(_transforms.Peek())) { CollectedMeshes.Add(_transforms.Peek(), new List <Mesh>()); } meshSupplier.AddMeshesTo(CollectedMeshes[_transforms.Peek()]); } }
public void Collect(OperatorPart startPoint) { Clear(); startPoint.TraverseWithFunction(this, this); if (!CollectedMeshes.Any()) { Logger.Warn(_parent, "Found no mesh supplier, have you forgotten to add an input?"); } }
private void Clear() { CollectedMeshes.Clear(); _transforms.Clear(); _transforms.Push(Matrix.Identity); }