0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

python motionbuilder rename joints

Last updated at Posted at 2023-05-04
from pyfbsdk import *

def rename(name, before, after):
    if "MoCap" in name: return name
    return name.replace(before, after)

def search_and_select_skeleton(node, skeletons):
    if isinstance(node, FBModelSkeleton):
        skeletons.append(node)
    for child in node.Children:
        child_name = child.Name
        child_name = rename(child_name, "_L", "_MoCap_L")
        child_name = rename(child_name, "_R", "_MoCap_R")
        child_name = rename(child_name, "_M", "_MoCap_M")
        child.Name = child_name
        search_and_select_skeleton(child, skeletons)

# Get the root node of the current scene
root = FBSystem().Scene.RootModel

# Search for all the FBModelSkeleton nodes and select them
skeletons = []
search_and_select_skeleton(root, skeletons)
for skeleton in skeletons:
    skeleton.Selected = True

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?