/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Ml.Layer input = new Ml.Layer(); if (!DA.GetData(0, ref input)) { return; } Ml.Layer layer = new Ml.Layer(input); int mode = 0; DA.GetData(1, ref mode); Ml.Modifier modifier = new Ml.Modifier((Ml.Modifier.ModifierModes)mode); double value = 0.0; if (DA.GetData(2, ref value)) { modifier.Value = value; } Color color = Color.Black; if (DA.GetData(3, ref color)) { modifier.Color = color.ToWindColor(); } layer.Modifiers.Add(modifier); DA.SetData(0, layer); }
public Modifier(Modifier modifier) { this.ModifierMode = modifier.ModifierMode; this.Value = modifier.Value; this.Color = new Wg.Color(modifier.Color); }