LightPropertiesForm.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.Eval(0).Obj.SuperClassID == SClass_ID.Light)
  20. {
  21. lights.Add(node);
  22. }
  23. }
  24. Tools.PrepareCheckBox(chkNoExport, lights, "babylonjs_noexport");
  25. Tools.PrepareCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
  26. Tools.PrepareCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
  27. Tools.PrepareNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
  28. Tools.PrepareNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to", 100.0f);
  29. }
  30. private void butOK_Click(object sender, EventArgs e)
  31. {
  32. Tools.UpdateCheckBox(chkNoExport, lights, "babylonjs_noexport");
  33. Tools.UpdateCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
  34. Tools.UpdateCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
  35. Tools.UpdateNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
  36. Tools.UpdateNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to");
  37. }
  38. private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
  39. {
  40. grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
  41. }
  42. }
  43. }