功能:命令GXL,将旧的数据结构升级成新的

pull/1725/head
ChenX 3 years ago
parent b7fed7ac76
commit 2c2087e201

@ -0,0 +1,22 @@
import { app } from "../../ApplicationServices/Application";
import { arrayRemoveIf } from "../../Common/ArrayExt";
import { Light } from "../../DatabaseServices/Lights/Light";
import { Command } from "../../Editor/CommandMachine";
export class Command_UpdateLight implements Command
{
async exec()
{
arrayRemoveIf(app.Database.ModelSpace.EntityCol.Objects, ent =>
{
if (ent instanceof Light)
{
app.Database.Lights.EntityCol.Objects.push(ent);
ent.Owner = app.Database.Lights.Id;
return true;
}
return false;
});
}
}

@ -193,6 +193,7 @@ import { Command_TemplateSearch } from "../Add-on/TemplateSearch";
// import { RevTarget, SaveTarget } from '../Add-on/RenderTarget'; // import { RevTarget, SaveTarget } from '../Add-on/RenderTarget';
import { TestIntersect } from "../Add-on/test/testIntersect"; import { TestIntersect } from "../Add-on/test/testIntersect";
import { Command_TestTape } from "../Add-on/test/TestTape"; import { Command_TestTape } from "../Add-on/test/TestTape";
import { Command_UpdateLight } from "../Add-on/testEntity/CMD_UpdateLight";
import { Command_DebugTemplateAssocCount } from "../Add-on/testEntity/DebugShowTemplateAssocEntityCount"; import { Command_DebugTemplateAssocCount } from "../Add-on/testEntity/DebugShowTemplateAssocEntityCount";
import { Test } from "../Add-on/testEntity/test"; import { Test } from "../Add-on/testEntity/test";
import { Command_TestBoundaryBox } from "../Add-on/testEntity/TestBoundaryBox"; import { Command_TestBoundaryBox } from "../Add-on/testEntity/TestBoundaryBox";
@ -269,6 +270,7 @@ export function registerCommand()
commandMachine.RegisterCommand("testload", new Command_TestLoadFbx()); commandMachine.RegisterCommand("testload", new Command_TestLoadFbx());
commandMachine.RegisterCommand("tt", new Test()); commandMachine.RegisterCommand("tt", new Test());
commandMachine.RegisterCommand("gxl", new Command_UpdateLight());
commandMachine.RegisterCommand("999", new Command_999()); commandMachine.RegisterCommand("999", new Command_999());
commandMachine.RegisterCommand("testVPath", new Command_TestVPath()); commandMachine.RegisterCommand("testVPath", new Command_TestVPath());

Loading…
Cancel
Save