开发:更新包
This commit is contained in:
25
api.cjs.js
25
api.cjs.js
@@ -1121,6 +1121,11 @@ exports.PhysicalMaterialRecord = class PhysicalMaterialRecord extends exports.Ma
|
||||
material: "",
|
||||
};
|
||||
this.material = new three.MeshPhysicalMaterial({});
|
||||
Object.defineProperty(this.material, "ObjectId", {
|
||||
get: () => {
|
||||
return this?.objectId?.Index;
|
||||
}
|
||||
});
|
||||
}
|
||||
async Update() {
|
||||
this.material[USE_WORLD_UV] = this.UseWorldUV;
|
||||
@@ -25822,11 +25827,8 @@ exports.RoomHolePolyline = class RoomHolePolyline extends exports.RoomHoleBase {
|
||||
get MaterialsIds() {
|
||||
let mtls = this.MeshMaterial;
|
||||
return mtls.map(mtl => {
|
||||
if (mtl.userData.Entity) {
|
||||
let mtlRc = mtl.userData.Entity;
|
||||
return mtlRc.objectId?.Index ?? 71;
|
||||
}
|
||||
return 71;
|
||||
//@ts-ignore
|
||||
return mtl.ObjectId ?? 71;
|
||||
});
|
||||
}
|
||||
GetPrintObject3D() {
|
||||
@@ -35719,6 +35721,16 @@ exports.EntityRef = class EntityRef extends exports.Entity {
|
||||
this.Update();
|
||||
return this;
|
||||
}
|
||||
get OverWriteMaterial() {
|
||||
return this._OverWriteMaterial;
|
||||
}
|
||||
SetMaterialAtSlot(mtl, slotIndex) {
|
||||
if (this._OverWriteMaterial.get(slotIndex) !== mtl) {
|
||||
this.WriteAllObjectRecord();
|
||||
this._OverWriteMaterial.set(slotIndex, mtl);
|
||||
this.Update(exports.UpdateDraw.Material);
|
||||
}
|
||||
}
|
||||
GetObjectSnapPoints(snapMode, pickPoint, lastPoint, viewXform) {
|
||||
let box = this.BoundingBox;
|
||||
let [x1, y1, z1] = [box.min.x, box.min.y, box.min.z];
|
||||
@@ -35785,7 +35797,8 @@ exports.EntityRef = class EntityRef extends exports.Entity {
|
||||
for (let i = 0; i < size; i++) {
|
||||
let index = file.Read();
|
||||
let id = file.ReadHardObjectId();
|
||||
this._OverWriteMaterial.set(index, id);
|
||||
if (id)
|
||||
this._OverWriteMaterial.set(index, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user