Python Reference Guide
 
Loading...
Searching...
No Matches
Tasks\RePrefixAllMarkers.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: FBPopupInputType, FBComponent.ClassName
7#
8
9from pyfbsdk import *
10
11gScene = FBSystem().Scene
12
13# Get the substring that we want to use as a prefix.
14(lRes, lPrefix ) = FBMessageBoxGetUserValue( "Enter new Prefix", "Enter new prefix for markers: ", "", FBPopupInputType.kFBPopupString, "OK", "Cancel" )
15
16# Insure that the user entered a string and selected "Ok".
17if lRes == 1 and lPrefix and len( lPrefix ) > 0:
18
19 # Look at all the elements in the scene.
20 for lComponent in FBSystem().Scene.Components:
21
22 # We want to apply this prefix only to regular markers...
23 # not optical markers.
24 if lComponent and lComponent.ClassName() == "FBModelMarker":
25
26 # We will change the name only on objects that do not already
27 # have the desired prefix.
28 if lComponent.OwnerNamespace == None or lComponent.OwnerNamespace.Name != lPrefix :
29 lComponent.LongName = "%s:%s"%(lPrefix, lComponent.Name)
30
31 # Cleanup loop variables.
32 del( lComponent )
33
34# Cleanup Namespace.
35gScene.NamespaceCleanup()
36
37# Cleanup local variables.
38del( lRes, lPrefix )
39
40# Cleanup things from pyfbsdk
41del( FBSystem, FBMessageBoxGetUserValue, FBPopupInputType )
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771