123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using Autodesk.Max;
- using ActionItem = Autodesk.Max.Plugins.ActionItem;
- namespace Max2Babylon
- {
- public class BabylonPropertiesActionItem : ActionItem
- {
- public override bool ExecuteAction()
- {
- if (Loader.Core.SelNodeCount == 0)
- {
- using (var frm = new ScenePropertiesForm())
- {
- frm.ShowDialog();
- return true;
- }
- }
- var firstNode = Loader.Core.GetSelNode(0);
- if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Camera)
- {
- using (var frm = new CameraPropertiesForm())
- {
- frm.ShowDialog();
- return true;
- }
- }
- if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Geomobject)
- {
- using (var frm = new ObjectPropertiesForm())
- {
- frm.ShowDialog();
- return true;
- }
- }
- if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Light)
- {
- using (var frm = new LightPropertiesForm())
- {
- frm.ShowDialog();
- return true;
- }
- }
- Loader.Core.PushPrompt("Selected entity does not have Babylon.js specific properties");
- return true;
- }
- public override int Id_
- {
- get { return 1; }
- }
- public override string ButtonText
- {
- get { return "Babylon Properties"; }
- }
- public override string MenuText
- {
- get { return "Babylon Properties"; }
- }
- public override string DescriptionText
- {
- get { return "UI for setting Babylon.js specific properties"; }
- }
- public override string CategoryText
- {
- get { return "Babylon"; }
- }
- public override bool IsChecked_
- {
- get { return false; }
- }
- public override bool IsItemVisible
- {
- get { return true; }
- }
- public override bool IsEnabled_
- {
- get { return true; }
- }
- }
- }
|