Tasks/ResetLocalTranslationRotation.py

Tasks/ResetLocalTranslationRotation.py
1 # Copyright 2009 Autodesk, Inc. All rights reserved.
2 # Use of this software is subject to the terms of the Autodesk license agreement
3 # provided at the time of installation or download, or which otherwise accompanies
4 # this software in either electronic or hard copy form.
5 #
6 # Topic: FBModel, FBVector3d
7 #
8 from pyfbsdk import FBModelList, FBGetSelectedModels, FBVector3d, FBMessageBox
9 
10 lSelectedModels = FBModelList()
11 FBGetSelectedModels( lSelectedModels )
12 
13 ## This script will reset all the local translation and rotation on selected model
14 if len(lSelectedModels)==0:
15  FBMessageBox("Reset Local Translation and Rotation on selected objects", "No model selected, no operation performed...", "Ok")
16 else:
17  for lModel in lSelectedModels:
18  lModel.Translation = FBVector3d()
19  lModel.Rotation = FBVector3d()
20 
21 # Cleanup of local objects
22 del( lSelectedModels )
23 
24 # Cleanup of imported modules
25 del( FBModelList, FBGetSelectedModels, FBVector3d )