public static IValueConfig CreateValueConfig(this IPluginHost host, ConfigAttribute attribute, Type type) { attribute = NormalizePinAttribute(attribute, type); IValueConfig result = null; host.CreateValueConfig(attribute.Name, attribute.Dimension, attribute.DimensionNames, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result); switch (attribute.Dimension) { case 2: result.SetSubType2D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.IsBang, attribute.IsToggle, attribute.AsInt); break; case 3: result.SetSubType3D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.IsBang, attribute.IsToggle, attribute.AsInt); break; case 4: result.SetSubType4D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.DefaultValues[3], attribute.IsBang, attribute.IsToggle, attribute.AsInt); break; default: result.SetSubType(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValue, attribute.IsBang, attribute.IsToggle, attribute.AsInt); break; } result.Order = attribute.Order; return(result); }
public void Configurate(IPluginConfig Input) { //nothing to configure in this plugin //only used in conjunction with inputs of type cmpdConfigurate if (Input.Name == "Number of Input Poses") { IValueConfig valueInput = (IValueConfig)Input; valueInput.GetValue(0, out poseCount); FInput.SetSubType(0, poseCount - 1, 0.01, 0.0, false, false, false); int oldPoseCount = FPoseNodes.Count; for (int i = oldPoseCount - 1; i >= (int)poseCount; i--) { FHost.DeletePin(FPoseNodes[i]); } for (int i = oldPoseCount - 1; i >= (int)poseCount; i--) { FPoseNodes.RemoveAt(i); FPoses.RemoveAt(i); } var guids = new System.Guid[1]; guids[0] = SkeletonNodeIO.GUID; INodeIn currPoseNode; for (int i = oldPoseCount; i < (int)poseCount; i++) { FHost.CreateNodeInput("Pose " + (i + 1), TSliceMode.Single, TPinVisibility.True, out currPoseNode); currPoseNode.SetSubType(guids, "Skeleton"); FPoseNodes.Add(currPoseNode); FPoses.Add(null); } } }
public void Configurate(IPluginConfig Input) { if (Input.Name == "Children Count") { IValueConfig valueInput = (IValueConfig)Input; double pinCount; valueInput.GetValue(0, out pinCount); int oldChildrenCount = FChildPins.Count; for (int i = oldChildrenCount - 1; i >= (int)pinCount; i--) { FHost.DeletePin(FChildPins[i]); } for (int i = oldChildrenCount - 1; i >= (int)pinCount; i--) { FChildPins.RemoveAt(i); } var guids = new System.Guid[1]; guids[0] = SkeletonNodeIO.GUID; INodeIn node; for (int i = oldChildrenCount; i < pinCount; i++) { FHost.CreateNodeInput("Child" + (i + 1), TSliceMode.Single, TPinVisibility.True, out node); node.SetSubType(guids, "Skeleton"); FChildPins.Add(node); } } }
public override void DestroyPins() { FHost.DeletePin(FKeyTime); FHost.DeletePin(FKeyColor); FKeyTime = null; FKeyColor = null; FKeyFrames.Clear(); }
public override void DestroyPins() { FHost.DeletePin(FStateTime); FHost.DeletePin(FStateName); FHost.DeletePin(FStateEvents); FStateTime = null; FStateName = null; FStateEvents = null; FKeyFrames.Clear(); }
public override void DestroyPins() { FHost.DeletePin(FKeyTime); FHost.DeletePin(FKeyFlagY); FHost.DeletePin(FKeyValue); FKeyTime = null; FKeyValue = null; FKeyFlagY = null; FKeyFrames.Clear(); }
public void Configurate(IPluginConfig Input) { //nothing to configure in this plugin //only used in conjunction with inputs of type cmpdConfigurate if (Input.Name == "Number of Input Poses") { System.Guid[] guids = new System.Guid[1]; guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39"); IValueConfig valueInput = (IValueConfig)Input; valueInput.GetValue(0, out poseCount); int oldPoseCount = poseNodes.Count; for (int i = oldPoseCount - 1; i >= (int)poseCount; i--) { FHost.DeletePin(poseNodes[i]); FHost.DeletePin(amountNodes[i]); } for (int i = oldPoseCount - 1; i >= (int)poseCount; i--) { poseNodes.RemoveAt(i); amountNodes.RemoveAt(i); poses.RemoveAt(i); amounts.RemoveAt(i); } INodeIn currPoseNode; IValueIn currAmountNode; for (int i = oldPoseCount; i < (int)poseCount; i++) { FHost.CreateNodeInput("Pose " + (i + 1), TSliceMode.Single, TPinVisibility.True, out currPoseNode); currPoseNode.SetSubType(guids, "Skeleton"); poseNodes.Add(currPoseNode); FHost.CreateValueInput("Amount " + (i + 1), 1, null, TSliceMode.Single, TPinVisibility.True, out currAmountNode); currAmountNode.SetSubType(0.0, 1.0, 0.01, 0.0, false, false, false); amountNodes.Add(currAmountNode); poses.Add(null); amounts.Add(0.0); } } }
public ValueConfigStream(IValueConfig valueConfig) : base(valueConfig) { FValueConfig = valueConfig; FTypeCode = Type.GetTypeCode(typeof(T)); }
static private Action <int> GetSetValueLengthAction(IValueConfig valueConfig) { return((int newLength) => { valueConfig.SliceCount = newLength; }); }
static private Func <bool> GetValidateFunc(IValueConfig valueConfig) { return(() => { return valueConfig.PinIsChanged; }); }
//called by the plugin the host can create a pin public void CreateValueConfig(string Name, int Dimension, string[] DimensionNames, TSliceMode SliceMode, TPinVisibility Visibility, out IValueConfig Pin) { Pin = new TValuePin(this, Name, Dimension, DimensionNames, TPinDirection.Configuration, new TOnConfigurate(ConfigurateCB), SliceMode, Visibility); AddPin(Pin as TBasePin); }
public QuaternionConfigStream(IValueConfig valueConfig) : base(valueConfig) { FValueConfig = valueConfig; }
public Vector4ConfigStream(IValueConfig valueConfig) : base(valueConfig) { FValueConfig = valueConfig; }