!1214 修复:造型板件贴图错误

pull/1214/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 1789a88dea
commit e794a7797f

@ -1634,6 +1634,7 @@ export class ExtrudeSolid extends Entity
this._MeshGeometry = builder.MeshGeometry;
this._EdgeGeometry = builder.EdgeGeometry;
this.UpdateUV(null, null);
return this._MeshGeometry;
}
@ -1694,10 +1695,31 @@ export class ExtrudeSolid extends Entity
mat = this.Db?.DefaultMaterial;
if (mat && mat.IsFull)
{
if (geo)
ScaleUV2(geo, ocs, this.width, this.height, isRev);
else
this.UpdateBufferGeometryUvs(isRev);
}
else
{
if (geo)
ScaleUV(geo);
}
}
UpdateBufferGeometryUvs(isRev: boolean)
{
let uvs = this._MeshGeometry.attributes.uv;
for (let i = 0; i < uvs.count; i++)
{
let x = uvs.getX(i) * 1e3;
let y = uvs.getY(i) * 1e3;
if (isRev)
uvs.setXY(i, x / this.height, y / this.width);
else
uvs.setXY(i, x / this.width, y / this.height);
}
}
DeferUpdate()
{
if (this.NeedUpdateFlag & UpdateDraw.Matrix)

@ -1,4 +1,4 @@
import { Scene } from "three";
import { Scene, AmbientLight } from "three";
import { app } from "../ApplicationServices/Application";
import { HostApplicationServices } from "../ApplicationServices/HostApplicationServices";
import { DisposeThreeObj } from "../Common/Dispose";
@ -35,6 +35,7 @@ export class TempEditor
this.viewerScene = app.Viewer.Scene;
app.Viewer.Scene = this.editorScene;
this.editorScene.add(app.Viewer.GripScene);
this.editorScene.add(new AmbientLight(0xffffff, 3));
//备份
this.hmIndex = app.Database.hm.curIndex;
app.Database.hm.lockIndex = this.hmIndex;

@ -1444,7 +1444,7 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
{
if (this._isPasted)
{
let state = await AppConfirm.show({ message: "目录下已经黏贴过了,是否重复黏贴" });
let state = await AppConfirm.show({ message: "目录下已经黏贴过了,是否重复黏贴" });
if (!state) return;
}

Loading…
Cancel
Save