Python Reference Guide
 
Loading...
Searching...
No Matches
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#
8from pyfbsdk import FBModelList, FBGetSelectedModels, FBVector3d, FBMessageBox
9
10lSelectedModels = FBModelList()
11FBGetSelectedModels( lSelectedModels )
12
13
14if len(lSelectedModels)==0:
15 FBMessageBox("Reset Local Translation and Rotation on selected objects", "No model selected, no operation performed...", "Ok")
16else:
17 for lModel in lSelectedModels:
18 lModel.Translation = FBVector3d()
19 lModel.Rotation = FBVector3d()
20
21# Cleanup of local objects
22del( lSelectedModels )
23
24# Cleanup of imported modules
25del( FBModelList, FBGetSelectedModels, FBVector3d )
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...
int FBMessageBox(str pBoxTitle, str pMessage, str pButton1Str, str pButton2Str=None, str pButton3Str=None, int pDefaultButton=0, int pScrolledMessage=0)
Dialog popup box.