Created
April 5, 2013 20:00
-
-
Save awforsythe/5322163 to your computer and use it in GitHub Desktop.
Deletes all components in a MotionBuilder namespace. Slight adaptation of a script by Marcus Krautwurst: http://www.marcuskrautwurst.com/2013/04/deleting-objects-in-motionbuilder.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def DeleteNamespace(namespace): | |
in_namespace = lambda c: ('%s:' % namespace) in c.LongName | |
delete_comp = lambda c: c.FBDelete() | |
delete_in_namespace = lambda cs: map(delete_comp, filter(in_namespace, cs)) | |
scene = FBSystem().Scene | |
map(delete_in_namespace, [ | |
scene.Constraints, | |
scene.Handles, | |
scene.UserObjects, | |
scene.ControlSets, | |
scene.CharacterExtensions, | |
scene.Characters, | |
[c for c in scene.Components if isinstance(c, FBModel)], | |
scene.Materials, | |
scene.Shaders, | |
scene.Textures, | |
scene.Folders, | |
scene.Groups, | |
scene.ObjectPoses, | |
scene.CharacterPoses, | |
scene.Components | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment