public void SetDynamicInput(float v1, float v2, float v3, float v4) { var behavior = EffectRenderer.GetBehavior(); behavior.DynamicInput1 = v1; behavior.DynamicInput2 = v2; behavior.DynamicInput3 = v3; behavior.DynamicInput4 = v4; EffectRenderer.SetBehavior(behavior); }
public void SendTrigger(int index) { var behavior = EffectRenderer.GetBehavior(); switch (index) { case 0: behavior.TriggerInput0 = true; break; case 1: behavior.TriggerInput1 = true; break; case 2: behavior.TriggerInput2 = true; break; case 3: behavior.TriggerInput3 = true; break; } EffectRenderer.SetBehavior(behavior); }
unsafe void Export() { var behavior = EffectRenderer.GetBehavior(); behavior.DynamicInput1 = Core.Dynamic.Inputs.Values[0].Input.Value; behavior.DynamicInput2 = Core.Dynamic.Inputs.Values[1].Input.Value; behavior.DynamicInput3 = Core.Dynamic.Inputs.Values[2].Input.Value; behavior.DynamicInput4 = Core.Dynamic.Inputs.Values[3].Input.Value; behavior.PositionVelocityX = Core.EffectBehavior.LocationVelocity.X; behavior.PositionVelocityY = Core.EffectBehavior.LocationVelocity.Y; behavior.PositionVelocityZ = Core.EffectBehavior.LocationVelocity.Z; behavior.RotationVelocityX = Core.EffectBehavior.RotationVelocity.X / 180.0f * 3.141592f; behavior.RotationVelocityY = Core.EffectBehavior.RotationVelocity.Y / 180.0f * 3.141592f; behavior.RotationVelocityZ = Core.EffectBehavior.RotationVelocity.Z / 180.0f * 3.141592f; behavior.ScaleVelocityX = Core.EffectBehavior.ScaleVelocity.X; behavior.ScaleVelocityY = Core.EffectBehavior.ScaleVelocity.Y; behavior.ScaleVelocityZ = Core.EffectBehavior.ScaleVelocity.Z; if (Core.EffectBehavior.RemovedTime.Infinite.Value) { behavior.RemovedTime = int.MaxValue; } else { behavior.RemovedTime = Core.EffectBehavior.RemovedTime.Value; } behavior.PositionX = Core.EffectBehavior.Location.X; behavior.PositionY = Core.EffectBehavior.Location.Y; behavior.PositionZ = Core.EffectBehavior.Location.Z; behavior.RotationX = Core.EffectBehavior.Rotation.X / 180.0f * 3.141592f; behavior.RotationY = Core.EffectBehavior.Rotation.Y / 180.0f * 3.141592f; behavior.RotationZ = Core.EffectBehavior.Rotation.Z / 180.0f * 3.141592f; behavior.ScaleX = Core.EffectBehavior.Scale.X; behavior.ScaleY = Core.EffectBehavior.Scale.Y; behavior.ScaleZ = Core.EffectBehavior.Scale.Z; behavior.TargetPositionX = Core.EffectBehavior.TargetLocation.X; behavior.TargetPositionY = Core.EffectBehavior.TargetLocation.Y; behavior.TargetPositionZ = Core.EffectBehavior.TargetLocation.Z; behavior.CountX = Core.EffectBehavior.CountX; behavior.CountY = Core.EffectBehavior.CountY; behavior.CountZ = Core.EffectBehavior.CountZ; behavior.AllColorR = (byte)Core.EffectBehavior.ColorAll.R; behavior.AllColorG = (byte)Core.EffectBehavior.ColorAll.G; behavior.AllColorB = (byte)Core.EffectBehavior.ColorAll.B; behavior.AllColorA = (byte)Core.EffectBehavior.ColorAll.A; behavior.PlaybackSpeed = Core.EffectBehavior.PlaybackSpeed.Value; behavior.TimeSpan = Core.EffectBehavior.TimeSpan; behavior.Distance = Core.EffectBehavior.Distance; EffectRenderer.SetBehavior(behavior); EffectRenderer.SetStep((int)Core.Option.FPS.Value); effectSetting.SetCoordinateSyatem( Core.Option.Coordinate.Value == Data.OptionValues.CoordinateType.Right ? swig.CoordinateSystemType.RH : swig.CoordinateSystemType.LH); var binaryExporter = new Binary.Exporter(); var data = binaryExporter.Export(Core.Root, Core.Option.Magnification); var path = Utils.Misc.BackSlashToSlash(Core.Root.GetFullPath()); fixed(byte *p = &data[0]) { var newEffect = effectFactory.LoadEffect(new IntPtr(p), data.Length, path); EffectRenderer.SetEffect(newEffect); if (CurrentEffect != null) { CurrentEffect.Dispose(); } CurrentEffect = newEffect; } }