Tasks/SelectModelsWithNameContainingSubstring.py
8 from pyfbsdk
import FBSystem, FBMessageBoxGetUserValue, FBPopupInputType
12 def SelectModels( pRoot, pPattern ):
15 if pRoot
and pPattern:
18 for lChild
in pRoot.Children:
22 if lChild.Name.find( pPattern ) != -1:
23 lChild.Selected =
True
26 SelectModels( lChild, pPattern )
29 (lRes, lPattern ) =
FBMessageBoxGetUserValue(
"Enter pattern",
"Enter pattern of model name to select: ",
"Cube", FBPopupInputType.kFBPopupString,
"OK",
"Cancel" )
33 if lPattern
and lRes == 1:
39 SelectModels( lScene.RootModel, lPattern )
54 del( FBSystem, FBMessageBoxGetUserValue, FBPopupInputType )