LightPropertiesForm.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Forms;
  4. using Autodesk.Max;
  5. namespace Max2Babylon
  6. {
  7. public partial class LightPropertiesForm : Form
  8. {
  9. private readonly List<IINode> lights = new List<IINode>();
  10. public LightPropertiesForm()
  11. {
  12. InitializeComponent();
  13. }
  14. private void LightPropertiesForm_Load(object sender, EventArgs e)
  15. {
  16. for (var index = 0; index < Loader.Core.SelNodeCount; index++)
  17. {
  18. var node = Loader.Core.GetSelNode(index);
  19. if (node.ObjectRef != null && node.ObjectRef.SuperClassID == SClass_ID.Light)
  20. {
  21. lights.Add(node);
  22. }
  23. }
  24. Tools.PrepareCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
  25. Tools.PrepareCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
  26. Tools.PrepareNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
  27. Tools.PrepareNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to", 100.0f);
  28. }
  29. private void butOK_Click(object sender, EventArgs e)
  30. {
  31. Tools.UpdateCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
  32. Tools.UpdateCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
  33. Tools.UpdateNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
  34. Tools.UpdateNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to");
  35. }
  36. private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
  37. {
  38. grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
  39. }
  40. }
  41. }