Scripts to print out the animation information
来源:互联网 发布:手机屏幕录像软件ios 编辑:程序博客网 时间:2024/05/16 11:03
1: //PrintAnim Script
2: proc printAnim(int $detailed)
3: {
4: print "/nAnimation...";
5:
6: string $animNodes[];
7: float $keytimes[];
8: //get the list of objects selected
9: string $sel[]=`ls -selection`;
10: //for each selected object
11: for($node in $sel)
12: {
13: print ("/nNode: "+$node);
14: //get all the animation curves associated with a given node
15: $animNodes=`keyframe -query -name $node`;
16: //for each animation curve
17: for($ac in $animNodes)
18: {
19: print("/nAnimCurve: "+$ac);
20: //get all the key times for current animation curve
21: $keytimes=`keyframe -query -timeChange $ac`;
22: print("/n"+size($keytimes)+" keys: ");
23: //for each key in the animation curve
24: for($keyt in $keytimes)
25: {
26:
27: $keyv=`keyframe -time $keyt -query -valueChange $ac`;
28: if($detailed)
29: {
30: // the type of the key
31: float $isBd[]=`keyframe -time $keyt -query -breakdown $ac`;
32: print("/n"+($isBd[0]?"Breakdown":"Normal")+" Key:");
33: }
34:
35: // the key time and key value
36: print("["+$keyt+", "+$keyv[0]+"]");
37:
38: if($detailed)
39: {
40: // Tangent information of the current key
41: print("/nTangent: ");
42: $keyinT=`keyTangent -time $keyt -query -inTangentType $ac`;
43: $keyoutT=`keyTangent -time $keyt -query -outTangentType $ac`;
44: $keyinA=`keyTangent -time $keyt -query -inAngle $ac`;
45: $keyoutA=`keyTangent -time $keyt -query -outAngle $ac`;
46: print("("+$keyinT[0]+" angle="+$keyinA[0]+", "+$keyoutT[0]+" angle="+$keyoutA[0]+")");
47: }
48: }
49: }
50: }
51: }
52:
53:
54: // Print Tangent Positions Script
55: proc printTangentPositions(string $animCurve, int $absolute)
56: {
57: print("/nTangent Positions...");
58:
59: float $ktimes[], $kvalues[];
60: // absolute positions
61: if($absolute)
62: {
63: $ktimes=`keyframe -query -timeChange $animCurve`;
64: $kvalues=`keyframe -query -valueChange $animCurve`;
65: }
66:
67: float $xcomps[], $ycomps[], $weights[];
68: int $i, $j;
69: // two tangents: in tangent and out tangent
70: for($i=0;$i<2;++$i)
71: {
72: // x and y vector components, weight
73: string $xreq, $yreq, $wreq;
74: if($i==0)
75: {
76: $xreq="-ix";
77: $yreq="-iy";
78: $wreq="-inWeight";
79: }else
80: {
81: $xreq="-ox";
82: $yreq="-oy";
83: $wreq="-outWeight";
84: }
85:
86: $xcomps=`keyTangent -query $xreq $animCurve`;
87: $ycomps=`keyTangent -query $yreq $animCurve`;
88: $weights=`keyTangent -query $wreq $animCurve`;
89:
90: print("/n");
91: for($j=0;$j<size($xcomps);++$j)
92: {
93: // x,y construct the unit vector of the tangent, represent direction
94: // weight is the length,
95: $xcomps[$j]*=$weights[$j];
96: $ycomps[$j]*=$weights[$j];
97:
98: // if absolute, move the vector to its own frame
99: if($absolute)
100: {
101: $xcomps[$j]+=$ktimes[$j];
102: $ycomps[$j]+=$kvalues[$j];
103: }
104:
105: print("["+$xcomps[$j]+", "+$ycomps[$j]+"]");
106: }
107: }
108: }
109:
110: proc testProc()
111: {
112: string $animCurves[]=`keyframe -query -name ball.translateX`;
113: printTangentPositions($animCurves[0], true);
114: }
115:
116: testProc();
The printAnim() function prints out the animation information of each frame and each animation node.
The printTangentPositions() function prints out the in tangent and out tangent of each frame.
Commands:
1. ls
2. keyframe
3. keyTangent
- Scripts to print out the animation information
- SQL Scripts to print BOM Hierarchy
- print out the path from one node to another in binary tree
- routines to print out error mesage
- The scripts to find Folder details
- [Javascript] A function works like 'print_r()' in PHP to print out the details of an object for JS debugging
- The Visual Studio template information is out of date.
- Scripts to Check the Setup of the General Ledger Calendar
- How to generate the meta information
- The Vest Pocket Guide to Information Technology
- Using PowerShell to check the stock information
- How to get the Information leakage
- Adding Python Information to the Windows Registry
- Scripts about Vendor(Supplier) Information
- A quick guide to writing scripts using the bash shell
- print 'welcome to masm!' in the center of the screen.
- How To Upload Files to the Internet Information Server
- Animation Scripts, Libraries and Plugins
- Windows
- 关于setsocketopt函数
- c#面试
- 捕获变化数据(CDC,Changed Data Capture)的四种手段
- 格式化月份和日期为两位数
- Scripts to print out the animation information
- 关于阻塞和非阻塞模式的socket
- 80387指令集
- 指针和句柄的区别
- 钉子
- 做一棵永远成长的苹果树
- 一个面向对象的OPENGL程序框架
- 动机的寓言:孩子在为谁而玩
- VCL 中的 Windows API 函数: BeginPath、EndPath