mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 19:12:40 +08:00
12072ffc62
* support asset property preview (#11017) (cherry picked from commit 85769cf8f81459b5ad98ccab4138420009572a32) * show mesh asset thumbnail (#10981) * V3.5.1 noise particle (#11003) * add cpu & gpu noise for particle * add some params & change particle noise shader * change shader * add cpu noise particle * add noise preview * run generation when preview * revert shaders * remove unused statements * add particle noise module * change noise preview interface * add invisible to remap * remove get deltaTime * set noiseModule private * fix eslint * feat: add noise preview (#11260) * [Optimize] asset editing undo (#10779) * edit render-pipeline * support renderpipeline undo * optimize material editing undo * reset last record data * temporary not support animation-mask undo * support animation-mask edit undo * animation mask remove _jointMasks * Animation clip embedded players (#11320) * Animation clip subregions * Log * Test * Eval * Update * Update * No longer use animation state to implement clip motion * Clear subregions * Fix * Mark subregion as editor extendable * Animation clip subregion player path * fix isnan(0.0) with webgl1.0 (#11262) * fix isinf(0.0)==true with webgl1.0 * code style * fix specular params with surface toon (#11265) * code format and add sliders for parameters (#11266) * Broadcasting of animation state\'s speed * Fix * Rename * Update * Fix * Revert "No longer use animation state to implement clip motion" This reverts commit 20755f9ec525b27b5b9a515c8dd687349aa4c637. * Revert some exotic changes * Update docs Co-authored-by: jk20012001 <jkregister@163.com> Co-authored-by: 徐兵 <49358166+xubing0906@users.noreply.github.com> * fix skinning model split (#11378) * fix skinning model split * rename function _resizeMaxJointForDS Co-authored-by: zhakesi <zhakesi@foxmail.com> * [ci skip][AUTO]: Automated genbindings update: d823cbba1f7ce8284da28458c26534da2e033961 (#11378) (#11383) Co-authored-by: cocos-robot <cocos-robot@cocos.com> * use stop emitting instead (#11381) * add stop emitting api * use stop emitting instead * Update cocos/particle/particle-system.ts Co-authored-by: Leslie Leigh (李的序) <leslieleigh@outlook.com> Co-authored-by: Leslie Leigh (李的序) <leslieleigh@outlook.com> * fix: imageData fault tolerance (#11374) * fix: imageData fault tolerance * chore: when data is an empty array,stop the function * material undo updating effects list (#11409) * modify noise module ui (#11433) * use visible decorator to control the visibility of property (#11438) * fix joints data with value nan (#11489) * V3.5.2 CI Android NDK set version to 21 (#11448) (#11492) * Minor improvement * Fix format * Fix particle culler * Improve particle culler * Manually migrate joint data upload with texture in skinning model * Update shaders for skinning model based on joint texture * fis native skinning model with realtime-texture mode (#45) Co-authored-by: zhakesi <zhakesi@foxmail.com> * fix clangtidy (#46) * Small tweaks * modify code struct for skinning model (#47) * modify code struct for skinning model * update skinning chunk Co-authored-by: 黄森斌 <arsen2010@126.com> Co-authored-by: zxx43 <zxx43@hotmail.com> Co-authored-by: 袁炜海 <35713518+dogodo-cc@users.noreply.github.com> Co-authored-by: Leslie Leigh (李的序) <leslieleigh@outlook.com> Co-authored-by: jk20012001 <jkregister@163.com> Co-authored-by: 徐兵 <49358166+xubing0906@users.noreply.github.com> Co-authored-by: zhakesi <liqiao@cocos.com> Co-authored-by: zhakesi <zhakesi@foxmail.com> Co-authored-by: Cocos Robot <48829427+cocos-robot@users.noreply.github.com> Co-authored-by: cocos-robot <cocos-robot@cocos.com> Co-authored-by: Santy-Wang <wh19930829@qq.com> Co-authored-by: zhangxin <59186205+chichinohaha@users.noreply.github.com> Co-authored-by: 江战 <40414978+PatriceJiang@users.noreply.github.com>
65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
import { Node } from "../../../cocos/core";
|
|
import { addEmbeddedPlayerTag, AnimationClip } from "../../../cocos/core/animation/animation-clip";
|
|
import { EmbeddedPlayableState } from "../../../cocos/core/animation/embedded-player/embedded-player";
|
|
import { EmbeddedPlayer } from "../../../editor/exports/embedded-player";
|
|
|
|
export class EmbeddedPlayerHostMock {
|
|
constructor(root: Node, private _embeddedPlayer: EmbeddedPlayer, _hostDuration: number) {
|
|
const instantiatedPlayer = this._embeddedPlayer.playable.instantiate(root);
|
|
this._instantiatedPlayer = instantiatedPlayer;
|
|
}
|
|
|
|
get wellInstantiated() {
|
|
return !!this._instantiatedPlayer;
|
|
}
|
|
|
|
get randomAccessible() {
|
|
return this._instantiatedPlayer.randomAccess;
|
|
}
|
|
|
|
public play(time: number) {
|
|
this._instantiatedPlayer.play(time);
|
|
}
|
|
|
|
public stop() {
|
|
this._instantiatedPlayer.stop();
|
|
}
|
|
|
|
public setSpeed(speed: number) {
|
|
this._instantiatedPlayer.setSpeed(speed);
|
|
}
|
|
|
|
private _instantiatedPlayer: EmbeddedPlayableState | null;
|
|
}
|
|
|
|
export class AnimationClipHostEmbeddedPlayerMock {
|
|
constructor(_root: Node, embeddedPlayer: EmbeddedPlayer, hostDuration: number) {
|
|
const animationClip = new AnimationClip();
|
|
animationClip.duration = hostDuration;
|
|
animationClip[addEmbeddedPlayerTag](embeddedPlayer);
|
|
const evaluator = animationClip.createEvaluator({ target: _root });
|
|
this._animationEvaluator = evaluator;
|
|
}
|
|
|
|
public play(time: number) {
|
|
this._animationEvaluator.notifyHostPlay(time);
|
|
}
|
|
|
|
public pause(time: number) {
|
|
this._animationEvaluator.notifyHostPause(time);
|
|
}
|
|
|
|
public stop() {
|
|
this._animationEvaluator.notifyHostStop();
|
|
}
|
|
|
|
public setSpeed(speed: number) {
|
|
this._animationEvaluator.notifyHostSpeedChanged(speed);
|
|
}
|
|
|
|
public evaluateAt(time: number) {
|
|
this._animationEvaluator.evaluate(time);
|
|
}
|
|
|
|
private _animationEvaluator: ReturnType<AnimationClip['createEvaluator']>;
|
|
} |