From 61cc6f5fa3139681bc828bcd548bc04801f7d955 Mon Sep 17 00:00:00 2001
From: hyde zhou
Date: Sun, 24 Apr 2022 19:03:24 +0800
Subject: [PATCH 001/104] fix debug crash problem (#10854)
---
native/cocos/renderer/pipeline/deferred/GbufferStage.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp b/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp
index 86af5d5649..5faaf95f4d 100644
--- a/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp
+++ b/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp
@@ -205,9 +205,9 @@ void GbufferStage::render(scene::Camera *camera) {
static_cast(pipeline->getWidth() * shadingScale),
static_cast(pipeline->getHeight() * shadingScale),
};
- if (_device->getGfxAPI() == gfx::API::VULKAN) { // TODO(Zhenglong Zhou): remove platform dependent settings
- depthTexInfo.usage |= gfx::TextureUsageBit::INPUT_ATTACHMENT;
- }
+
+ depthTexInfo.usage |= gfx::TextureUsageBit::INPUT_ATTACHMENT;
+
data.depth = builder.create(DeferredPipeline::fgStrHandleOutDepthTexture, depthTexInfo);
framegraph::RenderTargetAttachment::Descriptor depthInfo;
From 6ce58a2eb0cdad358c132f14c102085c08f6e1b2 Mon Sep 17 00:00:00 2001
From: ChiaNing
Date: Mon, 25 Apr 2022 10:30:52 +0800
Subject: [PATCH 002/104] API Doc link change (#10845)
---
cocos/2d/framework/renderable-2d.ts | 4 ++--
cocos/2d/framework/ui-component.ts | 4 ++--
cocos/2d/renderer/batcher-2d.ts | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cocos/2d/framework/renderable-2d.ts b/cocos/2d/framework/renderable-2d.ts
index 9e70f07c6b..c49de93084 100644
--- a/cocos/2d/framework/renderable-2d.ts
+++ b/cocos/2d/framework/renderable-2d.ts
@@ -106,10 +106,10 @@ export enum InstanceMaterialType {
/**
* @en Base class for 2D components which supports rendering features.
- * This component will setup [[NodeUIProperties.uiComp]] in its owner [[Node]]
+ * This component will setup NodeUIProperties.uiComp in its owner [[Node]]
*
* @zh 所有支持渲染的 2D 组件的基类。
- * 这个组件会设置 [[Node]] 上的 [[NodeUIProperties.uiComp]]。
+ * 这个组件会设置 [[Node]] 上的 NodeUIProperties.uiComp。
*/
@ccclass('cc.Renderable2D')
@requireComponent(UITransform)
diff --git a/cocos/2d/framework/ui-component.ts b/cocos/2d/framework/ui-component.ts
index f726b57709..0c248c2804 100644
--- a/cocos/2d/framework/ui-component.ts
+++ b/cocos/2d/framework/ui-component.ts
@@ -37,9 +37,9 @@ import { Stage } from '../renderer/stencil-manager';
/**
* @en Legacy 2D base class for rendering component, please use [[Renderable2D]] instead.
- * This component will setup [[NodeUIProperties.uiComp]] in its owner [[Node]]
+ * This component will setup NodeUIProperties.uiComp in its owner [[Node]]
* @zh 旧的 2D 渲染组件基类,请使用 [[Renderable2D]] 替代。
- * 这个组件会设置 [[Node]] 上的 [[NodeUIProperties.uiComp]]。
+ * 这个组件会设置 [[Node]] 上的 NodeUIProperties.uiComp。
* @deprecated since v3.4.1
*/
@ccclass('cc.UIComponent')
diff --git a/cocos/2d/renderer/batcher-2d.ts b/cocos/2d/renderer/batcher-2d.ts
index 0f08056ca9..ac4b099414 100644
--- a/cocos/2d/renderer/batcher-2d.ts
+++ b/cocos/2d/renderer/batcher-2d.ts
@@ -274,7 +274,7 @@ export class Batcher2D implements IBatcher {
/**
* Switch the mesh buffer for corresponding vertex layout if necessary.
- * @param attributes use [[VertexFormat.vfmtPosUvColor]] by default
+ * @param attributes use VertexFormat.vfmtPosUvColor by default
*/
public switchBufferAccessor (attributes: Attribute[] = vfmtPosUvColor) {
const strideBytes = attributes === vfmtPosUvColor ? 36 /* 9x4 */ : getAttributeStride(attributes);
From 2da44b2b1eda150d2ef9eed72461e55389f3a569 Mon Sep 17 00:00:00 2001
From: Zeqiang Li
Date: Mon, 25 Apr 2022 11:57:06 +0800
Subject: [PATCH 003/104] fix metal ds index (#10857)
* fix metal ds index
* ds index
Co-authored-by: lyeee
---
.../renderer/gfx-metal/MTLCommandBuffer.mm | 26 ++++++++++++++++---
.../renderer/gfx-metal/MTLPipelineState.mm | 10 ++++++-
2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm
index a9843fbcbb..6a4f2ca92c 100644
--- a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm
+++ b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm
@@ -203,8 +203,12 @@ void CCMTLCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *fb
for (size_t i = 0; i < subpasses.size(); ++i) {
for (size_t j = 0; j < subpasses[i].inputs.size(); ++j) {
uint32_t input = subpasses[i].inputs[j];
+ if(input >= colorAttachments.size()) {
+ continue; // depthStencil as input
+ }
if (visited[input])
continue;
+
auto *ccMtlTexture = static_cast(colorTextures[input]);
ccMtlRenderPass->setColorAttachment(input, ccMtlTexture, 0);
mtlRenderPassDescriptor.colorAttachments[input].clearColor = mu::toMTLClearColor(colors[input]);
@@ -214,6 +218,9 @@ void CCMTLCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *fb
}
for (size_t j = 0; j < subpasses[i].colors.size(); ++j) {
uint32_t color = subpasses[i].colors[j];
+ if(color >= colorAttachments.size()) {
+ continue; // depthStencil as output
+ }
if (visited[color])
continue;
auto *ccMtlTexture = static_cast(colorTextures[color]);
@@ -319,15 +326,25 @@ void CCMTLCommandBuffer::updateDepthStencilState(uint32_t index, MTLRenderPassDe
const DepthStencilAttachment& dsAttachment = curRenderPass->getDepthStencilAttachment();
const SubpassInfo& subpass = subpasses[index];
- if (subpass.depthStencil != INVALID_BINDING) {
+ uint32_t ds = subpass.depthStencil;
+
+ if (ds != INVALID_BINDING) {
+ auto iter = std::find_if(subpass.inputs.begin(), subpass.inputs.end(), [&subpass](uint32_t index){ return index >= subpass.inputs.size(); });
+ if(iter != subpass.inputs.end()) {
+ ds = (*iter);
+ } else {
+ auto opIter = std::find_if(subpass.colors.begin(), subpass.colors.end(), [&subpass](uint32_t index){ return index >= subpass.colors.size(); });
+ if(opIter != subpass.colors.end())
+ ds = (*opIter);
+ }
const TextureList &colorTextures = curFBO->getColorTextures();
- if (subpass.depthStencil >= colorTextures.size()) {
+ if (ds >= colorTextures.size()) {
auto *ccMTLTexture = static_cast(curFBO->getDepthStencilTexture());
descriptor.depthAttachment.texture = ccMTLTexture->getMTLTexture();
if (ccMTLTexture->getFormat() == Format::DEPTH_STENCIL)
descriptor.stencilAttachment.texture = ccMTLTexture->getMTLTexture();
} else {
- auto *ccMTLTexture = static_cast(colorTextures[subpass.depthStencil]);
+ auto *ccMTLTexture = static_cast(colorTextures[ds]);
descriptor.depthAttachment.texture = ccMTLTexture->getMTLTexture();
if (ccMTLTexture->getFormat() == Format::DEPTH_STENCIL)
descriptor.stencilAttachment.texture = ccMTLTexture->getMTLTexture();
@@ -517,6 +534,9 @@ void CCMTLCommandBuffer::nextSubpass() {
const auto &inputs = subpasses[curSubpassIndex].inputs;
for (size_t i = 0; i < inputs.size(); i++) {
const uint input = inputs[i];
+ if(input >= colorTextures.size()) {
+ continue;// ds should be set already by updateDepthStencilState
+ }
auto * ccMtlTexture = static_cast(colorTextures[input]);
_renderEncoder.setFragmentTexture(ccMtlTexture->getMTLTexture(), input);
}
diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm
index c8e0e32d77..e97b31f3c7 100644
--- a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm
+++ b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm
@@ -279,10 +279,15 @@ void CCMTLPipelineState::setMTLFunctionsAndFormats(MTLRenderPipelineDescriptor *
if (!subpasses.empty()) {
for (size_t passIndex = 0; passIndex < subpasses.size(); ++passIndex) {
const SubpassInfo &subpass = subpasses[passIndex];
+ depthStencilTexIndex = subpass.depthStencil;
for (size_t i = 0; i < subpass.inputs.size(); ++i) {
uint32_t input = subpass.inputs[i];
if (inputs.find(input) == inputs.end()) {
inputs.insert(input);
+ if(input >= colorAttachments.size()) {
+ depthStencilTexIndex = input;
+ continue;
+ }
mtlPixelFormat = mu::toMTLPixelFormat(colorAttachments[input].format);
descriptor.colorAttachments[input].pixelFormat = mtlPixelFormat;
}
@@ -290,10 +295,13 @@ void CCMTLPipelineState::setMTLFunctionsAndFormats(MTLRenderPipelineDescriptor *
for (size_t i = 0; i < subpass.colors.size(); ++i) {
uint32_t output = subpass.colors[i];
+ if(output >= colorAttachments.size()) {
+ depthStencilTexIndex = output;
+ continue;
+ }
mtlPixelFormat = mu::toMTLPixelFormat(colorAttachments[output].format);
descriptor.colorAttachments[output].pixelFormat = mtlPixelFormat;
}
- depthStencilTexIndex = subpass.depthStencil;
}
const uint32_t curIndex = static_cast(_renderPass)->getCurrentSubpassIndex();
const SubpassInfo &curSubpass = subpasses[curIndex];
From 58739f00514ddb1cca153cc250b9cd878d14adc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?=
Date: Mon, 25 Apr 2022 15:01:54 +0800
Subject: [PATCH 004/104] [Bug] fix animation-mask edit bug (#10865)
---
editor/inspector/assets/animation-mask.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/editor/inspector/assets/animation-mask.js b/editor/inspector/assets/animation-mask.js
index 674d387ccc..0426f60831 100644
--- a/editor/inspector/assets/animation-mask.js
+++ b/editor/inspector/assets/animation-mask.js
@@ -160,7 +160,7 @@ exports.methods = {
},
updateTree() {
- const convertData = this.convertData(this.queryData._jointMasks.value);
+ const convertData = this.convertData(this.queryData.joints.value);
this.flatData = convertData.flatData;
this.$.tree.tree = convertData.treeData;
},
From a0387c43fda716de64ebc421e05569195ae3c25a Mon Sep 17 00:00:00 2001
From: Yiwen <15225434259xue@gmail.com>
Date: Mon, 25 Apr 2022 15:57:13 +0800
Subject: [PATCH 005/104] Remove a unused MEMORY_ALIASING feature. (#10867)
---
native/cocos/renderer/gfx-base/GFXDef-common.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/native/cocos/renderer/gfx-base/GFXDef-common.h b/native/cocos/renderer/gfx-base/GFXDef-common.h
index 48abe7b38c..165e72f6cc 100644
--- a/native/cocos/renderer/gfx-base/GFXDef-common.h
+++ b/native/cocos/renderer/gfx-base/GFXDef-common.h
@@ -153,7 +153,6 @@ enum class Feature : uint32_t {
INSTANCED_ARRAYS,
MULTIPLE_RENDER_TARGETS,
BLEND_MINMAX,
- MEMORY_ALIASING,
COMPUTE_SHADER,
// This flag indicates whether the device can benefit from subpass-style usages.
// Specifically, this only differs on the GLES backends: the Framebuffer Fetch
From f6ce69e95e99dab034549e1adecc9c2874883150 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?=
Date: Mon, 25 Apr 2022 17:52:26 +0800
Subject: [PATCH 006/104] Hide some API in API doc (#10843)
---
cocos/core/curves/curve.ts | 6 ++++++
cocos/core/curves/quat-curve.ts | 6 ++++++
cocos/core/scene-graph/node.ts | 3 +++
3 files changed, 15 insertions(+)
diff --git a/cocos/core/curves/curve.ts b/cocos/core/curves/curve.ts
index 920b17ea57..e2a95f52bb 100644
--- a/cocos/core/curves/curve.ts
+++ b/cocos/core/curves/curve.ts
@@ -445,6 +445,9 @@ export class RealCurve extends KeyframeCurve {
return this._values.every((frame) => approx(frame.value, firstVal, tolerance));
}
+ /**
+ * @internal
+ */
public [serializeTag] (output: SerializationOutput, context: SerializationContext) {
if (!context.toCCON) {
output.writeThis();
@@ -492,6 +495,9 @@ export class RealCurve extends KeyframeCurve {
}
}
+ /**
+ * @internal
+ */
public [deserializeTag] (input: SerializationInput, context: DeserializationContext) {
if (!context.fromCCON) {
input.readThis();
diff --git a/cocos/core/curves/quat-curve.ts b/cocos/core/curves/quat-curve.ts
index 7ac660e7c5..d485318390 100644
--- a/cocos/core/curves/quat-curve.ts
+++ b/cocos/core/curves/quat-curve.ts
@@ -235,6 +235,9 @@ export class QuatCurve extends KeyframeCurve {
}
}
+ /**
+ * @internal
+ */
public [serializeTag] (output: SerializationOutput, context: SerializationContext) {
if (!context.toCCON) {
output.writeThis();
@@ -328,6 +331,9 @@ export class QuatCurve extends KeyframeCurve {
output.writeProperty('bytes', bytes);
}
+ /**
+ * @internal
+ */
public [deserializeTag] (input: SerializationInput, context: DeserializationContext) {
if (!context.fromCCON) {
input.readThis();
diff --git a/cocos/core/scene-graph/node.ts b/cocos/core/scene-graph/node.ts
index 974ad715e8..4e123b1f28 100644
--- a/cocos/core/scene-graph/node.ts
+++ b/cocos/core/scene-graph/node.ts
@@ -496,6 +496,9 @@ export class Node extends BaseNode implements CustomSerializable {
this._hasChangedFlagsChunk[this._hasChangedFlagsOffset] = val;
}
+ /**
+ * @internal
+ */
public [serializeTag] (serializationOutput: SerializationOutput, context: SerializationContext) {
if (!EDITOR) {
serializationOutput.writeThis();
From 146b74e4efedb38275a39328803ec9aa0e101420 Mon Sep 17 00:00:00 2001
From: zhakesi
Date: Mon, 25 Apr 2022 18:31:29 +0800
Subject: [PATCH 007/104] fix api docs (#10872)
* fix api docs
* add internal mask
Co-authored-by: zhakesi
---
.../skeletal-animation-data-hub.ts | 6 ++--
.../skinned-mesh-batch-renderer.ts | 2 ++
cocos/dragon-bones/ArmatureDisplay.ts | 13 -------
cocos/dragon-bones/CCFactory.ts | 7 +++-
cocos/dragon-bones/CCSlot.ts | 11 ++++++
cocos/dragon-bones/DragonBonesAsset.ts | 6 ++--
cocos/dragon-bones/index.ts | 35 -------------------
cocos/spine/index.ts | 8 ++---
cocos/spine/skeleton-data.ts | 4 +++
cocos/spine/skeleton.ts | 12 ++++---
cocos/tiledmap/tiled-layer.ts | 4 +++
cocos/tiledmap/tiled-map-asset.ts | 25 ++++++++++++-
12 files changed, 69 insertions(+), 64 deletions(-)
diff --git a/cocos/3d/skeletal-animation/skeletal-animation-data-hub.ts b/cocos/3d/skeletal-animation/skeletal-animation-data-hub.ts
index 107b929176..0564780e09 100644
--- a/cocos/3d/skeletal-animation/skeletal-animation-data-hub.ts
+++ b/cocos/3d/skeletal-animation/skeletal-animation-data-hub.ts
@@ -31,8 +31,10 @@ import { BAKE_SKELETON_CURVE_SYMBOL } from '../../core/animation/internal-symbol
type BakeData = ReturnType;
/**
- * @en The data conversion tool for skeleton animation
- * @zh 骨骼动画数据转换中心。
+ * @en
+ * The data conversion tool for skeleton animation
+ * @zh
+ * 骨骼动画数据转换中心。
* @internal
*/
export class SkelAnimDataHub {
diff --git a/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts b/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts
index 0cbcd2b2a3..bc3267962d 100644
--- a/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts
+++ b/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts
@@ -73,6 +73,8 @@ export class SkinnedMeshUnit {
public material: Material | null = null;
/**
+ * @en Local transform matrix
+ * @zh 本地变换矩阵
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
@serializable
diff --git a/cocos/dragon-bones/ArmatureDisplay.ts b/cocos/dragon-bones/ArmatureDisplay.ts
index f4f8b74270..fea5af5f1f 100644
--- a/cocos/dragon-bones/ArmatureDisplay.ts
+++ b/cocos/dragon-bones/ArmatureDisplay.ts
@@ -367,19 +367,6 @@ export class ArmatureDisplay extends Renderable2D {
this._debugBones = value;
this._updateDebugDraw();
}
- /**
- * @en Enabled batch model, if skeleton is complex, do not enable batch, or will lower performance.
- * @zh 开启合批,如果渲染大量相同纹理,且结构简单的骨骼动画,开启合批可以降低drawcall,否则请不要开启,cpu消耗会上升。
- * @property {Boolean} enableBatch
- * @default false
- */
- // @editable
- // @tooltip('i18n:COMPONENT.dragon_bones.enabled_batch')
- // get enableBatch () { return this._enableBatch; }
- // set enableBatch (value) {
- // this._enableBatch = value;
- // this._updateBatch();
- // }
/**
* @en
diff --git a/cocos/dragon-bones/CCFactory.ts b/cocos/dragon-bones/CCFactory.ts
index a4fab5295b..a36e55f06d 100644
--- a/cocos/dragon-bones/CCFactory.ts
+++ b/cocos/dragon-bones/CCFactory.ts
@@ -20,14 +20,19 @@ import { CCArmatureDisplay } from './CCArmatureDisplay';
*/
@ccclass('CCFactory')
export class CCFactory extends BaseFactory implements ISchedulable {
+ static _factory: CCFactory | null = null;
+
/**
+ * @en
+ * Get an CCFactory instance
+ * @zh
+ * 获取一个 CCFactory 实例
* @method getInstance
* @return {CCFactory}
* @static
* @example
* let factory = CCFactory.getInstance();
*/
- static _factory: CCFactory | null = null;
static getInstance () {
if (!CCFactory._factory) {
CCFactory._factory = new CCFactory();
diff --git a/cocos/dragon-bones/CCSlot.ts b/cocos/dragon-bones/CCSlot.ts
index 61f3e8bb2e..168c46d208 100644
--- a/cocos/dragon-bones/CCSlot.ts
+++ b/cocos/dragon-bones/CCSlot.ts
@@ -17,27 +17,38 @@ export class CCSlot extends Slot {
}
/**
+ * @en Vertices in local coordinate system.
+ * @zh 局部坐标顶点数据
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
_localVertices: number[];
/**
+ * @en Indices array of vertex data
+ * @zh 顶点数组索引
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
_indices: number[];
/**
+ * @en Local transformation matrix
+ * @zh 局部坐标系变换矩阵
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
_matrix: Mat4;
/**
+ * @en World transformation matrix
+ * @zh 世界坐标系变换矩阵
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
public _worldMatrix: Mat4;
+
protected _worldMatrixDirty: boolean;
/**
+ * @en Color setting on a slot
+ * @zh 设置在 Slot 上的颜色
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
_color: Color;
diff --git a/cocos/dragon-bones/DragonBonesAsset.ts b/cocos/dragon-bones/DragonBonesAsset.ts
index 99b6c8aaeb..f24b22ba23 100644
--- a/cocos/dragon-bones/DragonBonesAsset.ts
+++ b/cocos/dragon-bones/DragonBonesAsset.ts
@@ -24,8 +24,10 @@ import { legacyCC } from '../core/global-exports';
@ccclass('dragonBones.DragonBonesAsset')
export class DragonBonesAsset extends Asset {
/**
- * @en See http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html
- * @zh 可查看 DragonBones 官方文档 http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html
+ * @en
+ * See http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html
+ * @zh
+ * 可查看 DragonBones 官方文档 http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html
* @property {string} dragonBonesJson
*/
@serializable
diff --git a/cocos/dragon-bones/index.ts b/cocos/dragon-bones/index.ts
index 8c1099d428..a9aa471d4b 100644
--- a/cocos/dragon-bones/index.ts
+++ b/cocos/dragon-bones/index.ts
@@ -5,41 +5,6 @@
import { EDITOR } from 'internal:constants';
-/**
- * @en
- * The global time scale of DragonBones.
- * @zh
- * DragonBones 全局时间缩放率。
- * @example
- * dragonBones.timeScale = 0.8;
- */
-// const _timeScale = 1.0;
-
-// TODO timescale
-// Object.defineProperty(dragonBones, 'timeScale', {
-// get () {
-// return this._timeScale;
-// },
-// set (value) {
-// this._timeScale = value;
-// const factory = this.CCFactory.getInstance();
-// factory._dragonBones.clock.timeScale = value;
-// },
-// configurable: true,
-// });
-
-// export enum DisplayType {
-// Image = 0,
-// Armature = 1,
-// Mesh = 2
-// }
-
-// export enum ArmatureType {
-// Armature = 0,
-// MovieClip = 1,
-// Stage = 2
-// }
-
export enum ExtensionType {
FFD = 0,
AdjustColor = 10,
diff --git a/cocos/spine/index.ts b/cocos/spine/index.ts
index 048f1455c8..b2a27955c0 100644
--- a/cocos/spine/index.ts
+++ b/cocos/spine/index.ts
@@ -34,14 +34,10 @@ export { spine };
/**
* @en
- * The global time scale of Spine.
+ * The attachment type of spine. It contains three type: REGION(0), BOUNDING_BOX(1), MESH(2) and SKINNED_MESH
* @zh
- * Spine 全局时间缩放率。
- * @example
- * sp.timeScale = 0.8;
+ * Attachment 类型枚举。类型包括 REGION,BOUNDING_BOX,MESH,SKINNED_MESH
*/
-
-// The attachment type of spine. It contains three type: REGION(0), BOUNDING_BOX(1), MESH(2) and SKINNED_MESH.
export enum ATTACHMENT_TYPE {
REGION = 0,
BOUNDING_BOX = 1,
diff --git a/cocos/spine/skeleton-data.ts b/cocos/spine/skeleton-data.ts
index 8b9862aa0d..9c4585efe3 100644
--- a/cocos/spine/skeleton-data.ts
+++ b/cocos/spine/skeleton-data.ts
@@ -21,6 +21,8 @@ import { legacyCC } from '../core/global-exports';
@ccclass('sp.SkeletonData')
export class SkeletonData extends Asset {
/**
+ * @en See http://en.esotericsoftware.com/spine-json-format
+ * @zh 可查看 Spine 官方文档 http://zh.esotericsoftware.com/spine-json-format
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
@serializable
@@ -67,6 +69,8 @@ export class SkeletonData extends Asset {
}
/**
+ * @en Texture array
+ * @zh 纹理数组
* @property {Texture2D[]} textures
*/
diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts
index 52b7d50915..40370c9aef 100644
--- a/cocos/spine/skeleton.ts
+++ b/cocos/spine/skeleton.ts
@@ -574,8 +574,10 @@ export class Skeleton extends Renderable2D {
// 由于 spine 的 skin 是无法二次替换的,所以只能设置默认的 skin
/**
- * @en The name of default skin.
- * @zh 默认的皮肤名称。
+ * @en
+ * The name of default skin.
+ * @zh
+ * 默认的皮肤名称。
* @property {String} defaultSkin
*/
@serializable
@@ -583,8 +585,10 @@ export class Skeleton extends Renderable2D {
protected defaultSkin = '';
/**
- * @en The name of default animation.
- * @zh 默认的动画名称。
+ * @en
+ * The name of default animation.
+ * @zh
+ * 默认的动画名称。
* @property {String} defaultAnimation
*/
@visible(false)
diff --git a/cocos/tiledmap/tiled-layer.ts b/cocos/tiledmap/tiled-layer.ts
index d3f5ad775b..caf0a79693 100644
--- a/cocos/tiledmap/tiled-layer.ts
+++ b/cocos/tiledmap/tiled-layer.ts
@@ -1441,6 +1441,10 @@ export class TiledLayer extends Renderable2D {
}
/**
+ * @en
+ * Index of mesh render data array
+ * @zh
+ * 网格渲染数据数组的索引
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
public _meshRenderDataArrayIdx = 0;
diff --git a/cocos/tiledmap/tiled-map-asset.ts b/cocos/tiledmap/tiled-map-asset.ts
index 8cc4cb3aab..90242fc0cc 100644
--- a/cocos/tiledmap/tiled-map-asset.ts
+++ b/cocos/tiledmap/tiled-map-asset.ts
@@ -33,8 +33,12 @@ import { ccclass, type, serializable } from 'cc.decorator';
import { Asset } from '../core/assets/asset';
import { CCString, Size, TextAsset } from '../core';
import { SpriteFrame } from '../2d/assets';
+
/**
+ * @en
* Class for tiled map asset handling.
+ * @zh
+ * 用于获取 tiled map 资源类
* @class TiledMapAsset
* @extends Asset
*
@@ -53,13 +57,20 @@ export class TiledMapAsset extends Asset {
tsxFileNames: string[] = [];
/**
- * @zh s
+ * @en
+ * SpriteFrame array
+ * @zh
+ * SpriteFrame 数组
*/
@serializable
@type([SpriteFrame])
spriteFrames: SpriteFrame[] = [];
/**
+ * @en
+ * ImageLayerSpriteFrame array
+ * @zh
+ * ImageLayerSpriteFrame 数组
* @property {SpriteFrame[]} imageLayerSpriteFrame
*/
@serializable
@@ -67,6 +78,10 @@ export class TiledMapAsset extends Asset {
imageLayerSpriteFrame: SpriteFrame[] = []
/**
+ * @en
+ * Name of each object in imageLayerSpriteFrame
+ * @zh
+ * 每个 imageLayerSpriteFrame 名称
* @property {String[]} imageLayerTextureNames
*/
@serializable
@@ -74,6 +89,10 @@ export class TiledMapAsset extends Asset {
imageLayerSpriteFrameNames: string[] = [];
/**
+ * @en
+ * Name of each object in spriteFrames
+ * @zh
+ * 每个 SpriteFrame 名称
* @property {String[]} spriteFrameNames
*/
@serializable
@@ -81,6 +100,10 @@ export class TiledMapAsset extends Asset {
spriteFrameNames: string[] = [];
/**
+ * @en
+ * Size of each object in spriteFrames
+ * @zh
+ * 每个 SpriteFrame 的大小
* @property {Size[]} spriteFrameSizes
*/
@serializable
From 53079bfdfe2b80a09d897376ab85bf42dd1201d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?=
Date: Mon, 25 Apr 2022 19:56:51 +0800
Subject: [PATCH 008/104] fix bug: edit material didnt use initial data
(#10874)
---
editor/inspector/assets/material.js | 44 ++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/editor/inspector/assets/material.js b/editor/inspector/assets/material.js
index 51a5bc813b..e6ec756336 100644
--- a/editor/inspector/assets/material.js
+++ b/editor/inspector/assets/material.js
@@ -192,7 +192,11 @@ exports.methods = {
return;
}
- this.useCache();
+ if (this.requestInitCache) {
+ this.initCache();
+ } else {
+ this.useCache();
+ }
if (technique.passes) {
// The interface is not a regular data loop, which needs to be completely cleared and placed, but the UI-prop element is still reusable
@@ -349,6 +353,43 @@ exports.methods = {
Editor.Message.broadcast('material-inspector:change-dump');
},
+ initCache() {
+ const cacheData = this.cacheData;
+ this.technique.passes.forEach((pass, i) => {
+ if (pass.propertyIndex !== undefined && pass.propertyIndex.value !== i) {
+ return;
+ }
+
+ cacheProperty(pass.value);
+ });
+
+ function cacheProperty(prop) {
+ for (const name in prop) {
+ if (prop[name] && typeof prop[name] === 'object') {
+ if (!(name in cacheData)) {
+ const { type, value } = prop[name];
+ if (type) {
+ if (value !== undefined) {
+ cacheData[name] = { type };
+ if (value && typeof value === 'object') {
+ cacheData[name].value = JSON.parse(JSON.stringify(value));
+ } else {
+ cacheData[name].value = value;
+ }
+ }
+ }
+ }
+
+ if (prop[name].childMap && typeof prop[name].childMap === 'object') {
+ cacheProperty(prop[name].childMap);
+ }
+ }
+ }
+ }
+
+ this.requestInitCache = false;
+ },
+
storeCache(dump) {
const { name, type, value, default: defaultValue } = dump;
@@ -418,6 +459,7 @@ exports.update = async function(assetList, metaList) {
this.dirtyData.uuid = this.asset.uuid;
this.dirtyData.origin = '';
this.cacheData = {};
+ this.requestInitCache = true;
}
// set this.material.technique
this.material = await Editor.Message.request('scene', 'query-material', this.asset.uuid);
From 56b4f6268f57b36306f69c57fc654ce90fbee1c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?=
Date: Mon, 25 Apr 2022 20:12:33 +0800
Subject: [PATCH 009/104] add excludeNames for cacheData (#10876)
---
editor/inspector/assets/material.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/editor/inspector/assets/material.js b/editor/inspector/assets/material.js
index e6ec756336..c3ce8d8ffd 100644
--- a/editor/inspector/assets/material.js
+++ b/editor/inspector/assets/material.js
@@ -354,6 +354,13 @@ exports.methods = {
},
initCache() {
+ const excludeNames = [
+ 'children',
+ 'defines',
+ 'extends',
+ 'pipelineStates',
+ ];
+
const cacheData = this.cacheData;
this.technique.passes.forEach((pass, i) => {
if (pass.propertyIndex !== undefined && pass.propertyIndex.value !== i) {
@@ -365,6 +372,11 @@ exports.methods = {
function cacheProperty(prop) {
for (const name in prop) {
+ // 这些字段是基础类型或配置性的数据,不需要变动
+ if (excludeNames.includes(name)) {
+ continue;
+ }
+
if (prop[name] && typeof prop[name] === 'object') {
if (!(name in cacheData)) {
const { type, value } = prop[name];
From 271d17b817b773b181e5ded507965b02232955e3 Mon Sep 17 00:00:00 2001
From: zxx43
Date: Mon, 25 Apr 2022 20:53:39 +0800
Subject: [PATCH 010/104] V3.5.0 particle doc (#10863)
* optimize particle docs
* add note for instantiate
* update other particle system notes
* refine notes
* fix error
* refine translation
* refine translation
---
cocos/particle-2d/particle-asset.ts | 3 +-
cocos/particle-2d/particle-system-2d.ts | 53 ++++++++++---------------
cocos/particle/line.ts | 3 +-
cocos/particle/particle-system.ts | 13 +++---
cocos/particle/particle-utils.ts | 6 +--
5 files changed, 36 insertions(+), 42 deletions(-)
diff --git a/cocos/particle-2d/particle-asset.ts b/cocos/particle-2d/particle-asset.ts
index 9e6a246541..c60c002652 100644
--- a/cocos/particle-2d/particle-asset.ts
+++ b/cocos/particle-2d/particle-asset.ts
@@ -35,7 +35,8 @@ import { SpriteFrame } from '../2d/assets/sprite-frame';
import { legacyCC } from '../core/global-exports';
/**
- * Class for particle asset handling.
+ * @en Class for 2D particle asset handling.
+ * @zh 2D 粒子资产
* @class ParticleAsset
* @extends Asset
*/
diff --git a/cocos/particle-2d/particle-system-2d.ts b/cocos/particle-2d/particle-system-2d.ts
index 1f5a17e53a..8ed40f99fb 100644
--- a/cocos/particle-2d/particle-system-2d.ts
+++ b/cocos/particle-2d/particle-system-2d.ts
@@ -143,43 +143,32 @@ function getParticleComponents (node): ParticleSystem2D[] {
}
/**
- * Particle System base class.
- * Attributes of a Particle System:
- * - emmision rate of the particles
- * - Gravity Mode (Mode A):
- * - gravity
- * - direction
- * - speed +- variance
- * - tangential acceleration +- variance
- * - radial acceleration +- variance
- * - Radius Mode (Mode B):
- * - startRadius +- variance
- * - endRadius +- variance
- * - rotate +- variance
- * - Properties common to all modes:
- * - life +- life variance
- * - start spin +- variance
- * - end spin +- variance
- * - start size +- variance
- * - end size +- variance
- * - start color +- variance
- * - end color +- variance
- * - life +- variance
- * - blending function
- * - texture
- * Cocos also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
- * 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos,
- * cocos uses a another approach, but the results are almost identical.
- * cocos supports all the variables used by Particle Designer plus a bit more:
+ * @en Particle System base class.
+ * cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
+ * 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
+ * cocos2d uses a another approach, but the results are almost identical.
+ * cocos2d supports all the variables used by Particle Designer plus a bit more:
* - spinning particles (supported when using ParticleSystem)
* - tangential acceleration (Gravity mode)
* - radial acceleration (Gravity mode)
* - radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)
* It is possible to customize any of the above mentioned properties in runtime. Example:
- *
- * @example
* emitter.radialAccel = 15;
* emitter.startSpin = 0;
+ *
+ * @zh 2D 粒子基础类型
+ * cocos2d 同样支 Particle Designer (http://particledesigner.71squared.com/) 生成的粒子
+ * 粒子设计器中的 半径模式 使用 30 hz 的固定发射率。由于 cocos2d 无法保证,
+ * cocos2d 使用了另一种方法,但结果几乎相同。
+ * cocos2d 支持 Particle Designer 使用的所有变量,还有:
+ * -旋转粒子(使用粒子系统时支持)
+ * -切向加速度(重力模式)
+ * -径向加速度(重力模式)
+ * -半径方向(半径模式)(Particle Designer 仅支持向外到向内的方向)
+ * 可以在运行时自定义上述任何属性。例如:
+ * emitter.radialAccel = 15;
+ * emitter.startSpin = 0;
+ *
*/
@ccclass('cc.ParticleSystem2D')
@menu('Effects/ParticleSystem2D')
@@ -698,11 +687,11 @@ export class ParticleSystem2D extends Renderable2D {
public aspectRatio = 1;
/**
* The temporary SpriteFrame object used for the renderer. Because there is no corresponding asset, it can't be serialized.
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ * @internal since v3.5.0, this is an engine private interface that will be removed in the future.
*/
public declare _renderSpriteFrame: SpriteFrame | null;
/**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ * @internal since v3.5.0, this is an engine private interface that will be removed in the future.
*/
public declare _simulator: Simulator;
diff --git a/cocos/particle/line.ts b/cocos/particle/line.ts
index d7871742c4..4682351b2c 100644
--- a/cocos/particle/line.ts
+++ b/cocos/particle/line.ts
@@ -103,7 +103,8 @@ export class Line extends Component {
private _positions = [];
/**
- * 每段折线的拐点坐标。
+ * @en Inflection point positions of each polyline
+ * @zh 每段折线的拐点坐标。
*/
@type([Vec3])
@displayOrder(2)
diff --git a/cocos/particle/particle-system.ts b/cocos/particle/particle-system.ts
index b505025027..2c09b622eb 100644
--- a/cocos/particle/particle-system.ts
+++ b/cocos/particle/particle-system.ts
@@ -844,7 +844,8 @@ export class ParticleSystem extends RenderableComponent {
// }
/**
- * 播放粒子效果。
+ * @en play particle system
+ * @zh 播放粒子效果。
*/
public play () {
if (this._isPaused) {
@@ -877,7 +878,8 @@ export class ParticleSystem extends RenderableComponent {
}
/**
- * 暂停播放粒子效果。
+ * @en pause particle system
+ * @zh 暂停播放粒子效果。
*/
public pause () {
if (this._isStopped) {
@@ -892,7 +894,8 @@ export class ParticleSystem extends RenderableComponent {
}
/**
- * 停止播放粒子。
+ * @en stop particle system
+ * @zh 停止播放粒子。
*/
public stop () {
if (this._isPlaying || this._isPaused) {
@@ -919,9 +922,9 @@ export class ParticleSystem extends RenderableComponent {
}
}
- // remove all particles from current particle system.
/**
- * 将所有粒子从粒子系统中清除。
+ * @en remove all particles from current particle system.
+ * @zh 将所有粒子从粒子系统中清除。
*/
public clear () {
if (this.enabledInHierarchy) {
diff --git a/cocos/particle/particle-utils.ts b/cocos/particle/particle-utils.ts
index a80c619e9b..2aef3a267f 100644
--- a/cocos/particle/particle-utils.ts
+++ b/cocos/particle/particle-utils.ts
@@ -23,8 +23,6 @@
THE SOFTWARE.
*/
-
-
import { instantiate } from '../core/data';
import { CCObject } from '../core/data/object';
import { Director, director } from '../core/director';
@@ -34,7 +32,8 @@ import { ParticleSystem } from './particle-system';
export class ParticleUtils {
/**
- * instantiate
+ * @en instantiate particle system from prefab
+ * @zh 从 prefab 实例化粒子系统
*/
public static instantiate (prefab) {
if (!this.registeredSceneEvent) {
@@ -42,6 +41,7 @@ export class ParticleUtils {
this.registeredSceneEvent = true;
}
if (!this.particleSystemPool.has(prefab._uuid)) {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
this.particleSystemPool.set(prefab._uuid, new Pool(() => instantiate(prefab) || new Node(), 1, (prefab) => prefab.destroy()));
}
return this.particleSystemPool.get(prefab._uuid)!.alloc();
From 8a68ddadb5a20dbcb48a8c89eb387a0c5fd4b1d8 Mon Sep 17 00:00:00 2001
From: PP
Date: Mon, 25 Apr 2022 21:03:16 +0800
Subject: [PATCH 011/104] optimize API doc (#10858)
* optimize API doc
* update
* update
---
cocos/core/platform/view.ts | 43 ++++++++++++++++++++--------
cocos/core/scene-graph/node-event.ts | 4 +--
2 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/cocos/core/platform/view.ts b/cocos/core/platform/view.ts
index a20c511882..f75ff497a1 100644
--- a/cocos/core/platform/view.ts
+++ b/cocos/core/platform/view.ts
@@ -883,41 +883,60 @@ class ContentStrategy {
})();
/**
- * ResolutionPolicy class is the root strategy class of scale strategy,
- * its main task is to maintain the compatibility with Cocos2d-x
+ * @en ResolutionPolicy class is the root strategy class of scale strategy,
+ * its main task is to maintain the compatibility with Cocos2d-x.
+ *
+ * @zh ResolutionPolicy 类是适配策略的根策略类,它的主要任务是保持与 Cocos2d-x 的兼容性。
*/
export class ResolutionPolicy {
/**
- * The entire application is visible in the specified area without trying to preserve the original aspect ratio.
+ * @en The entire application is visible in the specified area without trying to preserve the original aspect ratio.
* Distortion can occur, and the application may appear stretched or compressed.
+ *
+ * @zh 整个应用程序在指定区域可见,无需尝试保留原始纵横比,
+ * 可能会发生变形,出现画面拉伸或压缩。
*/
public static EXACT_FIT = 0;
/**
- * The entire application fills the specified area, without distortion but possibly with some cropping,
+ * @en The entire application fills the specified area, without distortion but possibly with some cropping,
* while maintaining the original aspect ratio of the application.
+ *
+ * @zh 整个应用程序填充指定区域,没有变形,但可能有一些裁剪,
+ * 同时保持画面的原始纵横比。
*/
public static NO_BORDER = 1;
/**
- * The entire application is visible in the specified area without distortion while maintaining the original
+ * @en The entire application is visible in the specified area without distortion while maintaining the original
* aspect ratio of the application. Borders can appear on two sides of the application.
+ *
+ * @zh 整个应用程序在指定区域可见,没有变形,同时保持原始纵横比,
+ * 边框可能出现在画面的旁侧。
*/
public static SHOW_ALL = 2;
/**
- * The application takes the height of the design resolution size and modifies the width of the internal
- * canvas so that it fits the aspect ratio of the device
- * no distortion will occur however you must make sure your application works on different
+ * @en The application takes the height of the design resolution size and modifies the width of the internal
+ * canvas so that it fits the aspect ratio of the device
+ * no distortion will occur however you must make sure your application works on different
* aspect ratios
+ *
+ * @zh 该应用程序采用设计分辨率大小的高度并修改内部画布的宽度,使其适合设备的纵横比,不会发生变形,
+ * 但是您必须确保您的应用程序在不同的纵横比的设备下工作。
*/
public static FIXED_HEIGHT = 3;
/**
- * The application takes the width of the design resolution size and modifies the height of the internal
- * canvas so that it fits the aspect ratio of the device
- * no distortion will occur however you must make sure your application works on different
+ * @en The application takes the width of the design resolution size and modifies the height of the internal
+ * canvas so that it fits the aspect ratio of the device
+ * no distortion will occur however you must make sure your application works on different
* aspect ratios
+ *
+ * @zh 该应用程序采用设计分辨率大小的宽度并修改内部画布的高度,使其适合设备的纵横比,不会发生变形
+ * 但是您必须确保您的应用程序在不同的纵横比的设备下工作。
*/
public static FIXED_WIDTH = 4;
/**
- * Unknown policy
+ * @en Unknown policy
+ *
+ * @zh 未知的策略
*/
public static UNKNOWN = 5;
public static ContainerStrategy: typeof ContainerStrategy = ContainerStrategy;
diff --git a/cocos/core/scene-graph/node-event.ts b/cocos/core/scene-graph/node-event.ts
index 5f86ba748d..dd08cd665c 100644
--- a/cocos/core/scene-graph/node-event.ts
+++ b/cocos/core/scene-graph/node-event.ts
@@ -115,10 +115,10 @@ export enum NodeEventType {
/**
* @en
- * The event type for position, rotation, scale changed.Use the type parameter as [[Node.TransformBit]] to check which part is changed
+ * The event type for position, rotation, scale changed.Use the type parameter as `Node.TransformBit` to check which part is changed
*
* @zh
- * 节点改变位置、旋转或缩放事件。如果具体需要判断是哪一个事件,可通过判断回调的第一个参数类型是 [[Node.TransformBit]] 中的哪一个来获取
+ * 节点改变位置、旋转或缩放事件。如果具体需要判断是哪一个事件,可通过判断回调的第一个参数类型是 `Node.TransformBit` 中的哪一个来获取
* @example
* ```
* this.node.on(Node.EventType.TRANSFORM_CHANGED, (type)=>{
From 968ab9d71a2bf1368c6686cdfc6c307bf956d2d3 Mon Sep 17 00:00:00 2001
From: ChiaNing
Date: Mon, 25 Apr 2022 21:15:19 +0800
Subject: [PATCH 012/104] fix some api doc (#10868)
* fix some api doc
* add misc
---
cocos/2d/assets/sprite-frame.ts | 4 ++--
cocos/2d/framework/ui-transform.ts | 9 +++++----
cocos/2d/renderer/batcher-2d.ts | 3 ++-
cocos/2d/renderer/render-data.ts | 14 ++++++++++++--
cocos/2d/utils/html-text-parser.ts | 11 +++++++++--
5 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/cocos/2d/assets/sprite-frame.ts b/cocos/2d/assets/sprite-frame.ts
index cb245ce598..7b576e215b 100644
--- a/cocos/2d/assets/sprite-frame.ts
+++ b/cocos/2d/assets/sprite-frame.ts
@@ -239,8 +239,8 @@ export class SpriteFrame extends Asset {
}
/**
- * @en
- * @zh
+ * @en uv update event
+ * @zh uv 更新事件
*/
public static EVENT_UV_UPDATED = 'uv_updated';
diff --git a/cocos/2d/framework/ui-transform.ts b/cocos/2d/framework/ui-transform.ts
index 9d4eb8409f..6aef8729e0 100644
--- a/cocos/2d/framework/ui-transform.ts
+++ b/cocos/2d/framework/ui-transform.ts
@@ -401,7 +401,8 @@ export class UITransform extends Component {
}
/**
- * Hit test with point in UI Space.
+ * @zh UI 空间中的点击测试。
+ * @en Hit test with point in UI Space.
*
* @param uiPoint point in UI Space.
* @deprecated since v3.5.0, please use `uiTransform.hitTest(screenPoint: Vec2)` instead.
@@ -447,13 +448,13 @@ export class UITransform extends Component {
return false;
}
-
/**
- * Hit test with point in Screen Space.
+ * @zh 屏幕空间中的点击测试。
+ * @en Hit test with point in Screen Space.
*
* @param screenPoint point in Screen Space.
*/
- public hitTest (screenPoint: Vec2) {
+ public hitTest (screenPoint: Vec2) {
const w = this._contentSize.width;
const h = this._contentSize.height;
const v3WorldPt = _vec3a;
diff --git a/cocos/2d/renderer/batcher-2d.ts b/cocos/2d/renderer/batcher-2d.ts
index ac4b099414..893c2b0f77 100644
--- a/cocos/2d/renderer/batcher-2d.ts
+++ b/cocos/2d/renderer/batcher-2d.ts
@@ -273,7 +273,8 @@ export class Batcher2D implements IBatcher {
}
/**
- * Switch the mesh buffer for corresponding vertex layout if necessary.
+ * @zh 如果有必要,为相应的顶点布局切换网格缓冲区。
+ * @en Switch the mesh buffer for corresponding vertex layout if necessary.
* @param attributes use VertexFormat.vfmtPosUvColor by default
*/
public switchBufferAccessor (attributes: Attribute[] = vfmtPosUvColor) {
diff --git a/cocos/2d/renderer/render-data.ts b/cocos/2d/renderer/render-data.ts
index 9d958992ef..e759957548 100644
--- a/cocos/2d/renderer/render-data.ts
+++ b/cocos/2d/renderer/render-data.ts
@@ -23,8 +23,6 @@
THE SOFTWARE.
*/
-
-
import { director } from '../../core/director';
import { Material } from '../../core/assets/material';
import { TextureBase } from '../../core/assets/texture-base';
@@ -38,6 +36,9 @@ import { getAttributeStride, vfmtPosUvColor } from './vertex-format';
import { Buffer, BufferInfo, BufferUsageBit, Device, InputAssembler, InputAssemblerInfo, MemoryUsageBit } from '../../core/gfx';
import { assertIsTrue } from '../../core/data/utils/asserts';
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export interface IRenderData {
x: number;
y: number;
@@ -60,6 +61,9 @@ const _dataPool = new Pool(() => ({
let _pool: RecyclePool = null!;
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export class BaseRenderData {
public material: Material | null = null;
get vertexCount () {
@@ -96,6 +100,9 @@ export class BaseRenderData {
}
}
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export class RenderData extends BaseRenderData {
public static add (vertexFormat = vfmtPosUvColor, accessor?: StaticVBAccessor) {
if (!_pool) {
@@ -305,6 +312,9 @@ export class RenderData extends BaseRenderData {
}
}
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export class MeshRenderData extends BaseRenderData {
public static add (vertexFormat = vfmtPosUvColor) {
const rd = _meshDataPool.add();
diff --git a/cocos/2d/utils/html-text-parser.ts b/cocos/2d/utils/html-text-parser.ts
index 23b3bec0d3..1fd54932fc 100644
--- a/cocos/2d/utils/html-text-parser.ts
+++ b/cocos/2d/utils/html-text-parser.ts
@@ -28,19 +28,23 @@ import { TEST } from 'internal:constants';
import { legacyCC } from '../../core/global-exports';
/**
- *
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
const eventRegx = /^(click)(\s)*=|(param)(\s)*=/;
const imageAttrReg = /(\s)*src(\s)*=|(\s)*height(\s)*=|(\s)*width(\s)*=|(\s)*align(\s)*=|(\s)*offset(\s)*=|(\s)*click(\s)*=|(\s)*param(\s)*=/;
+
/**
* A utils class for parsing HTML texts. The parsed results will be an object array.
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
-
export interface IHtmlTextParserResultObj{
text?: string;
style?: IHtmlTextParserStack;
}
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export interface IHtmlTextParserStack{
color?: string;
size?: number;
@@ -58,6 +62,9 @@ export interface IHtmlTextParserStack{
outline?: { color: string, width: number };
}
+/**
+ * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ */
export class HtmlTextParser {
private _specialSymbolArray: Array<[RegExp, string]> = [];
private _stack: IHtmlTextParserStack[] = [];
From 6632c3f0ce37effb678dec2726708a562f28c0d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=90=89=E6=9E=97?= <798080536@qq.com>
Date: Mon, 25 Apr 2022 21:16:11 +0800
Subject: [PATCH 013/104] add model.ts comments (#10866)
* add model.ts comments
* add param comments
* increase engine version to 3.5.1
* increase engine version
* add space in comments
* add more comments
* fix es lint
---
cocos/core/global-exports.ts | 2 +-
cocos/core/renderer/scene/model.ts | 286 ++++++++++++++++++++++++++++-
package.json | 2 +-
3 files changed, 283 insertions(+), 7 deletions(-)
diff --git a/cocos/core/global-exports.ts b/cocos/core/global-exports.ts
index b66b3f554f..cbfcc91317 100644
--- a/cocos/core/global-exports.ts
+++ b/cocos/core/global-exports.ts
@@ -173,7 +173,7 @@ if (DEV) {
legacyCC._Test = {};
}
-const engineVersion = '3.5.0';
+const engineVersion = '3.5.1';
/**
* The current version of Cocos2d being used.
diff --git a/cocos/core/renderer/scene/model.ts b/cocos/core/renderer/scene/model.ts
index 3f1204b4bb..d5c037f8b5 100644
--- a/cocos/core/renderer/scene/model.ts
+++ b/cocos/core/renderer/scene/model.ts
@@ -88,41 +88,86 @@ const lightmapSamplerWithMipHash = new SamplerInfo(
);
/**
- * A representation of a model
+ * @en A representation of a model instance
+ * The base model class, which is the core component of [[MeshRenderer]],
+ * adds its own Model to the rendered scene for rendering submissions when [[MeshRenderer]] is enabled.
+ * This type of object represents a rendering instance in a scene, and it can contain multiple submodels,
+ * each of which corresponds to a material. These submodels share the same location and form a complete object.
+ * Each submodel references a submesh resource, which provides vertex and index buffers for rendering.
+ * @zh 代表一个模型实例
+ * 基础模型类,它是 [[MeshRenderer]] 的核心组成部分,在 [[MeshRenderer]] 启用时会将自己的 Model 添加到渲染场景中用于提交渲染。
+ * 此类型对象代表一个场景中的渲染实例,它可以包含多个子模型,每个子模型对应一个材质。这些子模型共享同样的位置,组成一个完整的物体。
+ * 每个子模型引用一个子网格资源,后者提供渲染所用的顶点与索引缓冲。
*/
export class Model {
+ /**
+ * @en return sub models
+ * @zh 获取所有子模型
+ */
get subModels () {
return this._subModels;
}
+ /**
+ * @en is inited
+ * @zh 是否初始化
+ */
get inited (): boolean {
return this._inited;
}
+ /**
+ * @en return world aabb
+ * @zh 获取世界空间包围盒
+ */
get worldBounds () {
return this._worldBounds!;
}
+ /**
+ * @en return model aabb
+ * @zh 获取模型包围盒
+ */
get modelBounds () {
return this._modelBounds;
}
+ /**
+ * @en return model ubo buffer
+ * @zh 获取模型 ubo 缓冲
+ */
get localBuffer () {
return this._localBuffer;
}
+ /**
+ * @en return world bound buffer
+ * @zh 获取世界包围盒 ubo 缓冲
+ */
get worldBoundBuffer () {
return this._worldBoundBuffer;
}
+ /**
+ * @en return update time stamp
+ * @zh 获取更新时间戳
+ */
get updateStamp () {
return this._updateStamp;
}
+ /**
+ * @en is GPU instancing enabled for the current model
+ * @zh 是否开启实例化渲染
+ */
get isInstancingEnabled () {
return this._instMatWorldIdx >= 0;
}
+ /**
+ * @en shadow bias
+ * @zh 阴影偏移值
+ */
get shadowBias () {
return this._shadowBias;
}
@@ -134,6 +179,10 @@ export class Model {
}
}
+ /**
+ * @en shadow normal bias
+ * @zh 阴影法线偏移值
+ */
get shadowNormalBias () {
return this._shadowNormalBias;
}
@@ -145,6 +194,10 @@ export class Model {
}
}
+ /**
+ * @en receive shadow or not
+ * @zh 是否接收阴影
+ */
get receiveShadow () {
return this._receiveShadow;
}
@@ -154,6 +207,10 @@ export class Model {
this.onMacroPatchesStateChanged();
}
+ /**
+ * @en cast shadow or not
+ * @zh 是否投射阴影
+ */
get castShadow () {
return this._castShadow;
}
@@ -165,6 +222,10 @@ export class Model {
}
}
+ /**
+ * @en model's node
+ * @zh 模型所在的节点
+ */
get node () : Node {
return this._node;
}
@@ -176,6 +237,10 @@ export class Model {
}
}
+ /**
+ * @en model's transform
+ * @zh 模型的变换
+ */
get transform () : Node {
return this._transform;
}
@@ -187,6 +252,13 @@ export class Model {
}
}
+ /**
+ * @en model's visibility tag
+ * Model's visibility flags, it's different from [[Node.layer]],
+ * but it will also be compared with [[Camera.visibility]] during culling process.
+ * @zh 模型的可见性标志
+ * 模型的可见性标志与 [[Node.layer]] 不同,它会在剔除阶段与 [[Camera.visibility]] 进行比较
+ */
get visFlags () : number {
return this._visFlags;
}
@@ -198,6 +270,10 @@ export class Model {
}
}
+ /**
+ * @en enabled
+ * @zh 模型是否启用
+ */
get enabled () : boolean {
return this._enabled;
}
@@ -209,45 +285,171 @@ export class Model {
}
}
+ /**
+ * @en model type
+ * @zh 模型类型
+ */
public type = ModelType.DEFAULT;
+
+ /**
+ * @en model's render scene
+ * @zh 模型所在的场景
+ */
public scene: RenderScene | null = null;
+
+ /**
+ * @en is dynamic batching
+ * @zh 是否动态合批
+ */
public isDynamicBatching = false;
+
+ /**
+ * @en instance attributes
+ * @zh 实例化属性
+ */
public instancedAttributes: IInstancedAttributeBlock = { buffer: null!, views: [], attributes: [] };
+ /**
+ * @en world aabb
+ * @zh 世界空间包围盒
+ */
protected _worldBounds: AABB | null = null;
+
+ /**
+ * @en model aabb
+ * @zh 模型空间包围盒
+ */
protected _modelBounds: AABB | null = null;
+
+ /**
+ * @en sub models
+ * @zh 子模型
+ */
protected _subModels: SubModel[] = [];
+
+ /**
+ * @en model's node
+ * @zh 子模型所在的节点
+ */
protected _node: Node = null!;
+
+ /**
+ * @en model's transform
+ * @zh 子模型的变换
+ */
protected _transform: Node = null!;
+ /**
+ * @en current device
+ * @zh 当前设备
+ */
protected _device: Device;
+
+ /**
+ * @en is inited
+ * @zh 是否初始化过
+ */
protected _inited = false;
+
+ /**
+ * @en descriptor set count
+ * @zh 描述符集合个数
+ */
protected _descriptorSetCount = 1;
+
+ /**
+ * @en update time stamp
+ * @zh 更新时间戳
+ */
protected _updateStamp = -1;
+
+ /**
+ * @en local ubo data dirty flag
+ * @zh 本地 ubo 数据是否修改过
+ */
protected _localDataUpdated = true;
+ /**
+ * @en local ubo data
+ * @zh 本地 ubo 数据
+ */
protected _localData = new Float32Array(UBOLocal.COUNT);
+
+ /**
+ * @en local ubo buffer
+ * @zh 本地 ubo 缓冲
+ */
protected _localBuffer: Buffer | null = null;
+
+ /**
+ * @en instance matrix id
+ * @zh 实例矩阵索引
+ */
private _instMatWorldIdx = -1;
private _lightmap: Texture2D | null = null;
private _lightmapUVParam: Vec4 = new Vec4();
+ /**
+ * @en world aabb buffer
+ * @zh 世界空间包围盒缓冲
+ */
protected _worldBoundBuffer: Buffer | null = null;
+ /**
+ * @en receive shadow or not
+ * @zh 是否接收阴影
+ */
protected _receiveShadow = false;
+
+ /**
+ * @en cast shadow or not
+ * @zh 是否投射阴影
+ */
protected _castShadow = false;
+
+ /**
+ * @en shadow bias
+ * @zh 阴影偏移
+ */
protected _shadowBias = 0;
+
+ /**
+ * @en shadow normal bias
+ * @zh 阴影法线偏移
+ */
protected _shadowNormalBias = 0;
+
+ /**
+ * @en enable or not
+ * @zh 是否启用
+ */
protected _enabled = true;
+
+ /**
+ * @en visible flag
+ * @zh 可见性标志位
+ */
protected _visFlags = Layers.Enum.NONE;
+
+ /**
+ * @internal
+ * @en native object
+ * @zh 原生对象
+ */
protected declare _nativeObj: NativeModel | NativeSkinningModel | NativeBakedSkinningModel | null;
+ /**
+ * @internal
+ * @en return native object
+ * @zh 返回原生对象
+ */
get native (): NativeModel {
return this._nativeObj!;
}
/**
- * Setup a default empty model
+ * @en create a empty model
+ * @zh 创建一个空模型
*/
constructor () {
this._device = legacyCC.director.root.device;
@@ -266,6 +468,10 @@ export class Model {
}
}
+ /**
+ * @en init model
+ * @zh 初始化模型
+ */
public initialize () {
if (this._inited) {
return;
@@ -288,6 +494,10 @@ export class Model {
}
}
+ /**
+ * @en destroy model
+ * @zh 销毁模型
+ */
public destroy () {
const subModels = this._subModels;
for (let i = 0; i < subModels.length; i++) {
@@ -314,15 +524,29 @@ export class Model {
this._destroy();
}
+ /**
+ * @en attach model to [[RenderScene]]
+ * @zh 添加模型到渲染场景 [[RenderScene]] 中
+ * @param scene destination scene
+ */
public attachToScene (scene: RenderScene) {
this.scene = scene;
this._localDataUpdated = true;
}
+ /**
+ * @en detach model from scene
+ * @zh 移除场景中的模型
+ */
public detachFromScene () {
this.scene = null;
}
+ /**
+ * @en update model's transform
+ * @zh 更新模型的变换
+ * @param stamp time stamp
+ */
public updateTransform (stamp: number) {
const node = this.transform;
// @ts-expect-error TS2445
@@ -337,6 +561,10 @@ export class Model {
}
}
+ /**
+ * @en update model's world aabb
+ * @zh 更新模型的世界空间包围盒
+ */
public updateWorldBound () {
const node = this.transform;
if (node !== null) {
@@ -368,6 +596,11 @@ export class Model {
}
}
+ /**
+ * @en update model's ubo
+ * @zh 更新模型的 ubo
+ * @param stamp time stamp
+ */
public updateUBOs (stamp: number) {
const subModels = this._subModels;
for (let i = 0; i < subModels.length; i++) {
@@ -408,9 +641,10 @@ export class Model {
}
/**
- * Create the bounding shape of this model
- * @param minPos the min position of the model
- * @param maxPos the max position of the model
+ * @en create model's aabb
+ * @zh 创建模型的包围盒
+ * @param minPos min positoin of the aabb
+ * @param maxPos max positoin of the aabb
*/
public createBoundingShape (minPos?: Vec3, maxPos?: Vec3) {
if (!minPos || !maxPos) { return; }
@@ -423,6 +657,13 @@ export class Model {
return new SubModel();
}
+ /**
+ * @en init a sub model
+ * @zh 初始化一个子模型
+ * @param idx sub model's index
+ * @param subMeshData sub mesh
+ * @param mat sub material
+ */
public initSubModel (idx: number, subMeshData: RenderingSubMesh, mat: Material) {
this.initialize();
@@ -446,17 +687,33 @@ export class Model {
}
}
+ /**
+ * @en set material for a given sub model
+ * @zh 为指定的子模型设置材质
+ * @param idx sub model's index
+ * @param subMesh sub mesh
+ */
public setSubModelMesh (idx: number, subMesh: RenderingSubMesh) {
if (!this._subModels[idx]) { return; }
this._subModels[idx].subMesh = subMesh;
}
+ /**
+ * @en set a sub material
+ * @zh 设置一个子材质
+ * @param idx sub model's index
+ * @param mat sub material
+ */
public setSubModelMaterial (idx: number, mat: Material) {
if (!this._subModels[idx]) { return; }
this._subModels[idx].passes = mat.passes;
this._updateAttributesAndBinding(idx);
}
+ /**
+ * @en pipeline changed callback
+ * @zh 管线更新回调
+ */
public onGlobalPipelineStateChanged () {
const subModels = this._subModels;
for (let i = 0; i < subModels.length; i++) {
@@ -464,6 +721,10 @@ export class Model {
}
}
+ /**
+ * @en shader macro changed callback
+ * @zh shader宏更新回调
+ */
public onMacroPatchesStateChanged () {
const subModels = this._subModels;
for (let i = 0; i < subModels.length; i++) {
@@ -471,6 +732,12 @@ export class Model {
}
}
+ /**
+ * @en update light map
+ * @zh 更新光照贴图
+ * @param texture light map
+ * @param uvParam uv coordinate
+ */
public updateLightingmap (texture: Texture2D | null, uvParam: Vec4) {
Vec4.toArray(this._localData, uvParam, UBOLocal.LIGHTINGMAP_UVPARAM);
this._localDataUpdated = true;
@@ -500,6 +767,10 @@ export class Model {
}
}
+ /**
+ * @en update shadow bias
+ * @zh 更新阴影偏移
+ */
public updateLocalShadowBias () {
const sv = this._localData;
sv[UBOLocal.LOCAL_SHADOW_BIAS + 0] = this._shadowBias;
@@ -509,6 +780,11 @@ export class Model {
this._localDataUpdated = true;
}
+ /**
+ * @en return shader macro
+ * @zh 获取 shader 宏
+ * @param subModelIndex sub model's index
+ */
public getMacroPatches (subModelIndex: number): IMacroPatch[] | null {
return this.receiveShadow ? shadowMapPatches : null;
}
diff --git a/package.json b/package.json
index cf9a83d1a5..1e6ed78632 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cocos-creator",
- "version": "3.5.0",
+ "version": "3.5.1",
"description": "Cocos Creator is a cross-platform 2D & 3D game engine written in TypeScript, licensed under MIT.",
"homepage": "http://www.cocos.com",
"license": "MIT",
From 844975878d262d460e5d66bae3000de47c93324d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?=
Date: Mon, 25 Apr 2022 21:16:43 +0800
Subject: [PATCH 014/104] Circular references should cause workflow failed
(#10841)
---
.github/workflows/build-problem-matcher.json | 2 +-
gulpfile.js | 33 +++++++++++++-------
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/build-problem-matcher.json b/.github/workflows/build-problem-matcher.json
index 3244c39f7f..90cf3caba6 100644
--- a/.github/workflows/build-problem-matcher.json
+++ b/.github/workflows/build-problem-matcher.json
@@ -2,7 +2,7 @@
{
"problemMatcher": [
{
- "owner": "circular-reference-check",
+ "owner": " build",
"pattern": [
{
"regexp": "^Circular dependency: (.*)$",
diff --git a/gulpfile.js b/gulpfile.js
index 75c21a01c9..b14c37237d 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -57,19 +57,28 @@ gulp.task('build-h5-source', gulp.series('build-debug-infos', async () => {
await fs.ensureDir(outDir);
await fs.emptyDir(outDir);
const cli = require.resolve('@cocos/build-engine/dist/cli');
- return cp.spawn('node', [
- cli,
- `--engine=${__dirname}`,
- '--module=system',
- '--build-mode=BUILD',
- '--platform=HTML5',
- '--physics=cannon',
- `--out=${outDir}`,
- ], {
- shell: true,
- stdio: 'inherit',
- cwd: __dirname,
+ const exitCode = await new Promise((resolve, reject) => {
+ cp.spawn('node', [
+ cli,
+ `--engine=${__dirname}`,
+ '--module=system',
+ '--build-mode=BUILD',
+ '--platform=HTML5',
+ '--physics=cannon',
+ `--out=${outDir}`,
+ ], {
+ shell: true,
+ stdio: 'inherit',
+ cwd: __dirname,
+ }).on('exit', (code) => {
+ resolve(code);
+ }).on('error', (err) => {
+ reject(err);
+ });
});
+ if (exitCode) {
+ throw new Error(`Build process exit with ${exitCode}`);
+ }
}));
gulp.task('build-h5-minified', gulp.series('build-debug-infos', async () => {
From 04d93514ec5c4039daeeb756961e91c21f568da0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=A3=AE=E6=96=8C?=
Date: Mon, 25 Apr 2022 21:25:01 +0800
Subject: [PATCH 015/104] fix didnt initial preview material (#10877)
---
editor/inspector/assets/material.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/editor/inspector/assets/material.js b/editor/inspector/assets/material.js
index c3ce8d8ffd..3f2d06dd36 100644
--- a/editor/inspector/assets/material.js
+++ b/editor/inspector/assets/material.js
@@ -400,6 +400,8 @@ exports.methods = {
}
this.requestInitCache = false;
+ this.updateInstancing();
+ this.updatePreview();
},
storeCache(dump) {
From 2ecf99ad53a583964162c411c125f3816392e629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?=
Date: Tue, 26 Apr 2022 15:44:38 +0800
Subject: [PATCH 016/104] Optimize animation document (#10860)
* Optimize animation document
* Update
* Update
* Update
---
cocos/core/animation/animation-clip.ts | 45 ++++--
cocos/core/animation/animation-component.ts | 3 +
cocos/core/animation/animation-curve.ts | 10 +-
cocos/core/animation/animation-state.ts | 13 +-
.../animation/compression/compressed-data.ts | 2 +-
.../exotic-animation/exotic-animation.ts | 10 +-
.../animation/marionette/animation-graph.ts | 2 +-
.../core/animation/marionette/clip-motion.ts | 2 +-
cocos/core/animation/marionette/graph-eval.ts | 2 +-
.../marionette/state-machine-component.ts | 15 ++
cocos/core/animation/target-path.ts | 7 +-
cocos/core/animation/tracks/color-track.ts | 12 ++
cocos/core/animation/tracks/object-track.ts | 6 +
cocos/core/animation/tracks/quat-track.ts | 6 +
cocos/core/animation/tracks/real-track.ts | 6 +
cocos/core/animation/tracks/size-track.ts | 12 ++
cocos/core/animation/tracks/track.ts | 142 +++++++++++++++++-
cocos/core/animation/tracks/vector-track.ts | 16 ++
cocos/core/animation/value-proxy.ts | 22 ++-
cocos/core/curves/curve.ts | 13 +-
cocos/core/curves/keyframe-curve.ts | 65 +++++++-
cocos/core/curves/quat-curve.ts | 56 +++++--
cocos/core/data/editor-extras-tag.ts | 19 +++
cocos/core/data/serialization-metadata.ts | 7 +-
.../data/utils/compact-value-type-array.ts | 3 +
25 files changed, 443 insertions(+), 53 deletions(-)
diff --git a/cocos/core/animation/animation-clip.ts b/cocos/core/animation/animation-clip.ts
index 221b4c37b3..ff15563afe 100644
--- a/cocos/core/animation/animation-clip.ts
+++ b/cocos/core/animation/animation-clip.ts
@@ -63,7 +63,7 @@ export declare namespace AnimationClip {
}
/**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
+ * @internal
*/
export type { legacy as _legacy };
}
@@ -144,8 +144,7 @@ export class AnimationClip extends Asset {
/**
* Sets if node TRS curves in this animation can be blended.
* Normally this flag is enabled for model animation and disabled for other case.
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- * This is an internal slot. Never use it in your code.
+ * @internal This is an internal slot. Never use it in your code.
*/
@serializable
public enableTrsBlending = false;
@@ -163,14 +162,20 @@ export class AnimationClip extends Asset {
}
/**
+ * @en
* Gets the count of tracks this animation owns.
+ * @zh
+ * 获取此动画中的轨道数量。
*/
get tracksCount () {
return this._tracks.length;
}
/**
+ * @en
* Gets an iterable to tracks.
+ * @zh
+ * 获取可用于迭代轨道的对象。
*/
get tracks (): Iterable