Python Reference Guide
 
Loading...
Searching...
No Matches
BasicOperations\ReplaceNamespace.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# Script description:
7# For all components in a scene, replace a namespace by another.
8#
9# Topic: FBComponent
10#
11
12from pyfbsdk import FBSystem, FBNamespaceAction
13
14#Change the name of the following value to match your namespaces
15lOldNamespace = "MyOldNameSpace"
16lNewNamespace = "MyNewNameSpace"
17
18for lComp in FBSystem().Scene.Components:
19 # This function is a recursive function that will go through the whole hierarchy to add or replace the prefix
20 lComp.ProcessNamespaceHierarchy (FBNamespaceAction.kFBReplaceNamespace, lOldNamespace, lNewNamespace, False)
21
22# Clean-up
23del(FBSystem, FBNamespaceAction, lComp)
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771