Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
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
You can’t perform that action at this time.