!2815 功能:添加模板右键删除节点功能,优化fbx上传缩放显示

pull/2817/MERGE
黄诗津 4 months ago committed by ChenX
parent 18dc2c70b1
commit d9e0072f5a

@ -76,6 +76,7 @@ export async function FbxImport(f: File)
CommandWrap(() => CommandWrap(() =>
{ {
app.Database.ModelSpace.Append(fbxEnt); app.Database.ModelSpace.Append(fbxEnt);
app.Viewer.ZoomtoEntitys([fbxEnt]);
}, ""); }, "");
app.Database.hm.lockIndex++;//禁止初始化动作被撤销 app.Database.hm.lockIndex++;//禁止初始化动作被撤销

@ -199,7 +199,7 @@ export enum CommandNames
TemplateDesign = "TEMPLATEDESIGN", TemplateDesign = "TEMPLATEDESIGN",
TemplateCollection = "TEMPLATECOLLECTION", TemplateCollection = "TEMPLATECOLLECTION",
TemplateSearch = "TEMPLATESEARCH", TemplateSearch = "TEMPLATESEARCH",
TemplateDelete = "TEMPLATEDELETE", TemplateDelete = "TEMPLATEDELETE", // 删除模板节点
TemplateCheck = "TEMPLATECHECK", TemplateCheck = "TEMPLATECHECK",
RotateTemplate = "ROTATETEMP", RotateTemplate = "ROTATETEMP",
Print = "PRINT", Print = "PRINT",
@ -228,7 +228,6 @@ export enum CommandNames
Curve2Rect = "CURVE2RECT", Curve2Rect = "CURVE2RECT",
Pl2Br = "RECT2BOARD", Pl2Br = "RECT2BOARD",
Curve2VSBox = "CURVE2VSBOX", Curve2VSBox = "CURVE2VSBOX",
templateDelete = "TEMPLATEDELETE",
RotateTemplateSpace = "ROTATETEMPLATESPACE", RotateTemplateSpace = "ROTATETEMPLATESPACE",
SplitTemplateY = "SPLITTEMPLATEY", SplitTemplateY = "SPLITTEMPLATEY",
Attach = "ATTACH", Attach = "ATTACH",

@ -129,6 +129,9 @@ export class EntityFbx extends Entity
} }
this.newObject = obj; this.newObject = obj;
const boundingBox = new Box3().expandByObject(this.newObject);
boundingBox.getSize(this._Size);
boundingBox.getCenter(this._Center);
this.Update(); this.Update();
//del_exp_end return; //del_exp_end return;
} }

@ -699,7 +699,7 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.TemplateCollection, new ShowTemplate("Collection")); commandMachine.RegisterCommand(CommandNames.TemplateCollection, new ShowTemplate("Collection"));
commandMachine.RegisterCommand(CommandNames.TemplateDesign, new ShowTemplateDesign()); commandMachine.RegisterCommand(CommandNames.TemplateDesign, new ShowTemplateDesign());
commandMachine.RegisterCommand(CommandNames.Modeling, new Command_Modeling()); commandMachine.RegisterCommand(CommandNames.Modeling, new Command_Modeling());
commandMachine.RegisterCommand(CommandNames.templateDelete, new Command_DeleteTemplate()); commandMachine.RegisterCommand(CommandNames.TemplateDelete, new Command_DeleteTemplate());
commandMachine.RegisterCommand(CommandNames.TemplateCheck, new Command_TemplateSearch(true)); commandMachine.RegisterCommand(CommandNames.TemplateCheck, new Command_TemplateSearch(true));
commandMachine.RegisterCommand(CommandNames.TemplateGroup, new Command_TemplateGroup()); commandMachine.RegisterCommand(CommandNames.TemplateGroup, new Command_TemplateGroup());
commandMachine.RegisterCommand(CommandNames.SpliteTemplate, new Command_SplitTemplate()); commandMachine.RegisterCommand(CommandNames.SpliteTemplate, new Command_SplitTemplate());

@ -63,6 +63,7 @@ const KeyWordCommandMap: Map<string, string> = new Map(Object.entries({
"N": CommandNames.HighlightNode, "N": CommandNames.HighlightNode,
"N2": CommandNames.HighlightNodeAndChilds, "N2": CommandNames.HighlightNodeAndChilds,
"TD": CommandNames.TemplateDelete,
})); }));
/** /**
@ -175,13 +176,14 @@ export class ContextMenuServices implements EditorService
{ {
if (selects[0] instanceof Board) if (selects[0] instanceof Board)
menuKeywords.push(...[ menuKeywords.push(...[
MenuDividerKWD,
{ key: "10", msg: `加点` }, { key: "10", msg: `加点` },
{ key: "11", msg: `删点` }, { key: "11", msg: `删点` },
]); ]);
if (selects[0].Template && selects[0].Template.Object) if (selects[0].Template && selects[0].Template.Object)
{ {
let temp = selects[0].Template.Object; let temp = selects[0].Template.Object;
menuKeywords.push({ key: "N", msg: "亮显本节点" }, { key: "N2", msg: "亮显空间子层" }); menuKeywords.push(MenuDividerKWD, { key: "N", msg: "亮显本节点" }, { key: "N2", msg: "亮显空间子层" }, { key: "TD", msg: "删除节点" });
if (temp instanceof TemplateWineRackRecord) if (temp instanceof TemplateWineRackRecord)
menuKeywords.push({ key: "WR", msg: "编辑酒格模块" }); menuKeywords.push({ key: "WR", msg: "编辑酒格模块" });
else if (temp instanceof TemplateBoardRecord || temp instanceof TemplateLeftRightBoardRecord || temp instanceof TemplateTopBottomBoard) else if (temp instanceof TemplateBoardRecord || temp instanceof TemplateLeftRightBoardRecord || temp instanceof TemplateTopBottomBoard)

@ -2891,8 +2891,8 @@ export const CommandList: ICommand[] = [
{ {
typeId: "module", typeId: "module",
link: `#`, link: `#`,
defaultCustom: CommandNames.templateDelete, defaultCustom: CommandNames.TemplateDelete,
command: CommandNames.templateDelete, command: CommandNames.TemplateDelete,
type: "模块", type: "模块",
chName: "删除模块节点", chName: "删除模块节点",
chDes: "删除模块节点", chDes: "删除模块节点",

Loading…
Cancel
Save