import type { IVector3, IVector4, ClassType, IVector2 } from "type-tls"; import type { IColor, IEuler } from "../type"; import type { InterpolationModes, AnimationBlendMode } from "three"; import { KeyframeTrack, AnimationClip } from "three"; /** * 常用的轨道属性 */ export declare enum TrackProperty_Common { /** * 位置 */ position = ".position", /** * 四元数 */ quaternion = ".quaternion", /** * 绕x旋转 */ rotationX = ".rotation[x]", /** * 绕x旋转 */ rotationY = ".rotation[y]", /** * 绕x旋转 */ rotationZ = ".rotation[z]", /** * 缩放 */ scale = ".scale", /** * 颜色 */ color = ".material.color", /** * 纹理映射偏移 * @privateRemarks * .material[map].offset */ textureOffset = "].offset", /** * 纹理映射没u方向的偏移 * @privateRemarks * .material[map].offset[x] */ textureOffsetX = "].offset[x]", /** * 纹理映射没v方向的偏移 * @privateRemarks * .material[map].offset[y] */ textureOffsetY = "].offset[y]", /** * 纹理映射旋转中心 * @privateRemarks * .material[map].center */ textureCenter = "].center", /** * 纹理映射旋转中心的x坐标 * @privateRemarks * .material[map].center[x] */ textureCenterX = "].center[x]", /** * 纹理映射旋转中心的y坐标 * @privateRemarks * .material[map].center[y] */ textureCenterY = "].center[y]", /** * 纹理映射旋转 * @privateRemarks * .material[map].rotation */ textureRotation = "].rotation", /** * 透明度 */ opacity = ".material[opacity]", /** * 显示隐藏 */ visible = ".visible" } /** * TrackProperty_Common 的方法 */ export declare namespace TrackProperty_Common { /** * 获取材质的 map 成员的轨道属性 * @param mapPropName - 材质中 map 的属性名字 * @param targetPath * @param textureProp - TrackProperty_Common 中纹理贴图的属性常量 * @returns */ function getMaterialMapTrackProperty(textureProp: TrackProperty_Common, targetPath?: string | null, mapPropName?: string | null): string; /** * 获取完整的轨道属性 * @param propCommon * @param targetPath * @param mapPropName * @returns */ function getTrackProperty(propCommon: TrackProperty_Common, targetPath?: string | null, mapPropName?: string | null): string; } /** * 值类型的名字 */ export declare enum ValueTypeNames { bool = "bool", number = "number", color = "color", quaternion = "quaternion", string = "string", vector = "vector" } /** * 关键帧 */ export interface Keyframe { time: number; value: V[]; } /** * 关键帧轨道的配置 */ export interface TrackConfig { /** * 关键帧轨道的值类型的名字 */ valueTypeName?: ValueTypeNames | null; /** * 关键帧轨道的值的数组类型 */ ValueBufferType?: ClassType | ArrayBufferLike> | null; /** * 插件类型 */ DefaultInterpolation?: InterpolationModes | null; } export interface AnimationCreatorOptions { /** * 动画模式 * @remarks * - NormalAnimationBlendMode:绝对动画 * - AdditiveAnimationBlendMode:相对动画 * 全局的配置 */ blendMode?: AnimationBlendMode | null; /** * 是否要对重复的帧进行去重 */ deduplication?: boolean | null; /** * 是否自动清除关键帧 */ autoClear?: boolean | null; /** * 各个轨道的配置项 * @remarks * 全局的配置 */ tracks: Record; } export declare class AnimationClipCreator { /** * 全局选项 */ static readonly options: AnimationCreatorOptions; /** * 全局选项 */ get globalOptions(): AnimationCreatorOptions; protected _options: AnimationCreatorOptions | null; /** * 实例级别的选项 */ get options(): any; /** * 动画模式 * @remarks * - NormalAnimationBlendMode:绝对动画 * - AdditiveAnimationBlendMode:相对动画 * 全局的配置 * * @defaultValue NormalAnimationBlendMode */ get blendMode(): any; set blendMode(value: any); /** * 是否自动清除原来的关键帧数据 * @remarks * 每次生成关键帧轨道后(比如:创建clip 或 action 后),要不要自动清除关键帧数据; * 如果清除的关键帧数据,则以后再创建的 clip 或 action 将不会包含之前的动画; */ get autoClear(): any; set autoClear(value: any); /** * 是否要对重复的帧进行去重 * @remarks * 重复的帧指的是时间一样的帧 */ get deduplication(): any; set deduplication(value: any); /** * 各个轨道的配置项 */ get tracksConfig(): any; set tracksConfig(value: any); /** * 动画的名字 */ name?: string | null; /** * 动画的持续时间 * @remarks * 如果设置为空,则会自动根据关键帧轨道自动进行计算 * @defaultValue 自动计算 */ duration?: number | null; /** * 轨道的数据 */ readonly tracksData: Map[]>; /** * 清除所有的关键帧 */ clearKeyframes(): void; tracksChanged(): void; clipChanged(): void; protected _tracks?: KeyframeTrack[] | null; /** * 关键帧轨道 */ get tracks(): KeyframeTrack[]; /** * 获取属性对应的轨道配置 * @param property * @returns */ getTrackConfig(property: string): any; /** * 创建关键帧轨道 * @returns */ createTracks(): KeyframeTrack[]; protected _clip?: AnimationClip | null; /** * 获取 clip */ get clip(): AnimationClip; /** * 创建 clip * @param name * @param duration * @returns */ createClip(name?: string | null, duration?: number | null): AnimationClip; /** * 更新 clip * @param clip - 如果不传,则默认使用 this.clip * @returns */ updateClip(clip?: AnimationClip | null): AnimationClip; /** * 添加关键帧 * @param property * @param time * @param value */ addKeyframe(property: string, time: number, value: any[]): void; /** * 添加一组关键帧 * @param targetPath * @param time * @param propValueMap */ addKeyframes(targetPath: string, time: number, propValueMap: Record): void; /** * 添加位置帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addPosition(time: number, value: IVector3, targetPath?: string | null): void; /** * 添加四元数帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addQuaternion(time: number, value: IVector4, targetPath?: string | null): void; /** * 添加旋转帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addRotation(time: number, value: IEuler, targetPath?: string | null): void; /** * 添加绕x轴旋转的帧 * @param time * @param angle * @param targetPath - 动画属性前缀 */ addRotationX(time: number, angle: number, targetPath?: string | null): void; /** * 添加绕y轴旋转的帧 * @param time * @param angle */ addRotationY(time: number, angle: number, targetPath?: string | null): void; /** * 添加绕z轴旋转的帧 * @param time * @param angle * @param targetPath - 动画属性前缀 */ addRotationZ(time: number, angle: number, targetPath?: string | null): void; /** * 添加缩放关键帧 * @param time * @param value */ addScale(time: number, value: IVector3, targetPath?: string | null): void; /** * 添加颜色关键帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addColor(time: number, value: IColor, targetPath?: string | null): void; /** * 添加透明度关键帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addOpacity(time: number, value: number, targetPath?: string | null): void; /** * 添加贴图平移关键帧 * @param time * @param value * @param targetPath */ addMapOffset(time: number, value: IVector2, targetPath?: string | null, mapName?: string | null): void; /** * 添加没 u 方向的贴图平移关键帧 * @param time * @param value * @param targetPath */ addMapOffsetX(time: number, value: number, targetPath?: string | null, mapName?: string | null): void; /** * 添加没 v 方向的贴图平移关键帧 * @param time * @param value * @param targetPath */ addMapOffsetY(time: number, value: number, targetPath?: string | null, mapName?: string | null): void; /** * 添加贴图旋转中心的关键帧 * @param time * @param value * @param targetPath */ addMapCenter(time: number, value: IVector2, targetPath?: string | null, mapName?: string | null): void; /** * 添加贴图旋转中心的x坐标的的关键帧 * @param time * @param value * @param targetPath */ addMapCenterX(time: number, value: number, targetPath?: string | null, mapName?: string | null): void; /** * 添加贴图旋转中心的y坐标的的关键帧 * @param time * @param value * @param targetPath */ addMapCenterY(time: number, value: number, targetPath?: string | null, mapName?: string | null): void; /** * 添加贴图旋转角度的关键帧 * @param time * @param angle * @param targetPath */ addMapRotation(time: number, angle: number, targetPath?: string | null, mapName?: string | null): void; /** * 添加显示隐藏关键帧 * @param time * @param value * @param targetPath - 动画属性前缀 */ addVisible(time: number, value: boolean, targetPath?: string | null): void; } //# sourceMappingURL=AnimationClipCreator.d.ts.map