zoukankan      html  css  js  c++  java
  • MaxScript 清除超出范围的关键帧

    最近在unity3d中使用魔兽世界的导出资源时,发现有些动画会有一些莫名其妙的残留帧,导致一个动作导进unity3d后的长度变成几分钟,并且很大一部分是毫无动作的,所以写了这个脚本来清除多余的帧。

    View Code
    Fn CleanOutRangeKeys inputObject =
    (
    startTime
    = AnimationRange.Start
    endTime
    = AnimationRange.End
    for i = 1 to inputObject.numSubs do
    (
    tempSubAnim
    = GetSubAnim inputObject i
    tempController
    = tempSubAnim.Controller

    if tempController != undefined do
    (
    tempKeyList
    = tempController.Keys

    outEndKeysIndex
    = for i = 1 to tempKeyList.Count where tempKeyList[i].Time > endTime collect i
    if outEndKeysIndex.Count > 0 do for i = 1 to outEndKeysIndex.Count do DeleteKey tempKeyList tempKeyList.count

    outStartKeysIndex
    = for i = 1 to tempKeyList.Count where tempKeyList[i].Time < startTime collect i
    for i = 1 to outStartKeysIndex.Count do DeleteKey tempKeyList 1
    )
    if tempSubAnim.numSubs > 0 do CleanOutRangeKeys tempSubAnim
    )
    )
    for tempObject in Objects as Array do CleanOutRangeKeys tempObject
  • 相关阅读:
    二分法查找递归方式()
    JDBC操作MySQL(crud)
    (转)JAVA中的权限修饰符
    抽象类和接口(面试题总结)
    java基础-集合
    Java泛型通配符以及限定
    div中嵌套的多个div使用了浮动后居中的办法
    将博客搬至CSDN
    (补)Java解析XML之dom4j
    Java单元测试
  • 原文地址:https://www.cnblogs.com/sitt/p/2094864.html
Copyright © 2011-2022 走看看