-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayLink.py
More file actions
102 lines (77 loc) · 4.36 KB
/
Copy pathDisplayLink.py
File metadata and controls
102 lines (77 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"""
Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
All Rights Reserved.
The coded instructions, statements, computer programs, and/or related material
(collectively the "Data") in these files contain unpublished information
proprietary to Autodesk, Inc. and/or its licensors, which is protected by
Canada and United States of America federal copyright law and by international
treaties.
The Data may not be disclosed or distributed to third parties, in whole or in
part, without the prior written consent of Autodesk, Inc. ("Autodesk").
THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.
IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
OR DAMAGE.
"""
from DisplayCommon import *
from fbx import FbxDeformer
from fbx import FbxAMatrix
#from fbx import FbxLayeredTexture
#from fbx import FbxTexture
def DisplayLink(pGeometry):
#Display cluster now
lSkinCount=pGeometry.GetDeformerCount(FbxDeformer.EDeformerType.eSkin)
#lLinkCount = pGeometry.GetLinkCount()
for i in range(lSkinCount):
lClusterCount = pGeometry.GetDeformer(i, FbxDeformer.EDeformerType.eSkin).GetClusterCount()
for j in range(lClusterCount):
DisplayInt(" Cluster ", i)
lCluster = pGeometry.GetDeformer(i, FbxDeformer.EDeformerType.eSkin).GetCluster(j)
#lLink = pGeometry.GetLink(i)
lClusterModes = [ "Normalize", "Additive", "Total1" ]
DisplayString(" Mode: ", lClusterModes[lCluster.GetLinkMode().value])
if lCluster.GetLink():
DisplayString(" Name: ", lCluster.GetLink().GetName())
lString1 = " Link Indices: "
lString2 = " Weight Values: "
lIndexCount = lCluster.GetControlPointIndicesCount()
lIndices = lCluster.GetControlPointIndices()
lWeights = lCluster.GetControlPointWeights()
for k in range(lIndexCount):
lString1 += str(lIndices[k])
lString2 += str(lWeights[k])
if k < lIndexCount - 1:
lString1 += ", "
lString2 += ", "
print(lString1)
print(lString2)
DisplayString("")
lMatrix = FbxAMatrix()
lMatrix = lCluster.GetTransformMatrix(lMatrix)
Display3DVector(" Transform Translation: ", lMatrix.GetT())
Display3DVector(" Transform Rotation: ", lMatrix.GetR())
Display3DVector(" Transform Scaling: ", lMatrix.GetS())
lMatrix = lCluster.GetTransformLinkMatrix(lMatrix)
Display3DVector(" Transform Link Translation: ", lMatrix.GetT())
Display3DVector(" Transform Link Rotation: ", lMatrix.GetR())
Display3DVector(" Transform Link Scaling: ", lMatrix.GetS())
if lCluster.GetAssociateModel():
lMatrix = lCluster.GetTransformAssociateModelMatrix(lMatrix)
DisplayString(" Associate Model: ", lCluster.GetAssociateModel().GetName())
Display3DVector(" Associate Model Translation: ", lMatrix.GetT())
Display3DVector(" Associate Model Rotation: ", lMatrix.GetR())
Display3DVector(" Associate Model Scaling: ", lMatrix.GetS())
DisplayString("")