1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16from pyfbsdk import FBVector3d, FBMatrix, FBModelList, FBModelTransformationType, FBGetSelectedModels, FBMatrixMult
17
18
19def freeze_local_rotation(model):
20 model.PropertyList.Find("Enable Rotation DOF").Data = True
21
22 result_vector = FBVector3d()
23
24 if not model.Parent:
25 gRot = FBVector3d()
26 model.GetVector(gRot, FBModelTransformationType.kModelRotation, True)
27
28 result_vector = gRot
29 else:
30 prerot = model.PreRotation
31
33 model.DofToLRM(model_DOF2LRM, prerot)
34
36 model.GetMatrix(model_globalMatrix, FBModelTransformationType.kModelRotation, False)
37
39 FBMatrixMult(model_multMatrix, model_DOF2LRM, model_globalMatrix)
40
41 model.LRMToDof(result_vector, model_multMatrix)
42
43 model.PropertyList.Find("Pre Rotation").Data = result_vector
44 model.Rotation = FBVector3d()
45
46
47modelList = FBModelList()
49for model in modelList:
50 freeze_local_rotation(model)
Four x Four (double) Matrix.
Definition: pyfbsdk_generated.h:10558
FBMatrixMult(FBMatrix pMatrix, FBMatrix pA, FBMatrix pB)
Multiply two matrices.
FBGetSelectedModels(FBModelList pList, FBModel pParent=None, bool pSelected=True, bool pSortBySelectOrder=False)
Find all models that are selected (if pSelected is true) Searches recursively from a root model for m...