Product documentation · Current desktop UI

MotionBuilder source functions

78 definitions in the current source checkout. This source map includes internal helpers and class methods. It is not a supported API contract or a promise that a function can be called through a bridge. For supported entry points use the Python API reference or bundled DCC wrapper pages.

motionbuilder_tools.Animation.anim_export.anim_export

export_animation

def export_animation(motionbuilder_file, export_path, namespace, start_frame, end_frame, nodes=None)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:10

Opens MotionBuilder scene and exports animation to FBX. :param motionbuilder_file: (str): Path to the Maya scene file (if you need it). :param export_path: (str): Path where the FBX should be saved. :param namespace: (str): Namespace of the

list_joints_by_namespace

def list_joints_by_namespace(namespace)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:92

Finds all joints in a namespace :param namespace: namespace to find joints for :return:

get_all_descendants

def get_all_descendants(model)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:104

Gets all children of a selected model :param model: Model to search for children under :return:

find_top_joint

def find_top_joint(model)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:117

Finds the top joint of the model (simulating the 'origin' joint check). :param model: FBModel object to check :return: True if it's a top joint, False otherwise

find_skinned_or_top_joints

def find_skinned_or_top_joints(namespace)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:129

Detects the top-level joint in a given namespace. It looks for the joint with no parent, or the joint closest to the top in the hierarchy. :param namespace: (str): The namespace to search for joints. :return: (list): List of top-level joint

get_selected_models

def get_selected_models()

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:169

Get selected models :return FBModelList: list of selected models

deselect_all_models

def deselect_all_models()

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:179

Deselect all models :return:

select_models

def select_models(models)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:189

:param models: List of models :return:

plot_selected_models

def plot_selected_models(models, start_frame, end_frame)

module function · public name · motionbuilder_tools/Animation/anim_export/anim_export.py:200

:param models: models to plot :param start_frame: start frame to plot :param end_frame: end frame to plot :return:

motionbuilder_tools.character

_sdk

def _sdk()

module function · internal · motionbuilder_tools/character.py:30

_normalized

def _normalized(name: str) -> str

module function · internal · motionbuilder_tools/character.py:36

_characters

def _characters(sdk: Any) -> list[Any]

module function · internal · motionbuilder_tools/character.py:40

_character

def _character(sdk: Any, name: str) -> Any | None

module function · internal · motionbuilder_tools/character.py:48

_mapping_from_file

def _mapping_from_file(path: str) -> dict[str, str]

module function · internal · motionbuilder_tools/character.py:52

_auto_mapping

def _auto_mapping(sdk: Any) -> dict[str, str]

module function · internal · motionbuilder_tools/character.py:65

_assign_slot

def _assign_slot(character: Any, slot: str, model: Any) -> bool

module function · internal · motionbuilder_tools/character.py:84

create_character

def create_character(character_name: str, definition_file: str='') -> dict[str, Any]

module function · public name · motionbuilder_tools/character.py:103

plot_animation

def plot_animation(character_name: str, plot_to_rig: bool=True, fps: int=30) -> dict[str, Any]

module function · public name · motionbuilder_tools/character.py:134

motionbuilder_tools.Cinematics.SequenceUI.sequence_utils

add_file_open_callback

def add_file_open_callback(widget)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:12

remove_file_open_callback

def remove_file_open_callback()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:24

get_main_window_pointer

def get_main_window_pointer()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:35

:return: Main Window for Motionbuilder

get_camera_sequencer_data

def get_camera_sequencer_data()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:42

Retrieves all shots, shot ranges, and corresponding shot cameras from MotionBuilder's CameraSwitcher. :return: List of tuples (shot_number, start_frame, end_frame, camera)

get_story_camera_shots

def get_story_camera_shots()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:57

Retrieves all clips in the Shot Track (kFBStoryTrackShot), including camera assignments. :return: a list of tuples: (clip_name, start_frame, end_frame, camera_name)

export_node_exists

def export_node_exists()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:91

get_display_range

def get_display_range()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:95

Gets the motionbuilder range to match the start and end frame listed :return: start and end frame

set_display_range

def set_display_range(start_frame, end_frame)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:104

Sets the motionbuilder range to match the start and end frame listed :param start_frame: start frame to set the time slider with :param end_frame: end frame to set the time slider with :return:

display_warning

def display_warning(warning)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:123

:param warning: Text to warn user with :return:

get_cameras_from_selection

def get_cameras_from_selection()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:131

:return: Cameras in selection

get_scene_path

def get_scene_path()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:143

:return: Actual saved file name currently open

get_components_in_namespace

def get_components_in_namespace(namespace)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:151

Returns all components in the scene that belong to the given namespace. Namespace format should be: 'MyNamespace::'

get_rig_namespaces

def get_rig_namespaces(selection=True)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:169

Detects namespaces of selected rigs that contain joints with 'origin' as the top joint. :return: Set of valid namespaces

find_top_joint

def find_top_joint(model)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:201

Finds the top joint of the model (simulating the 'origin' joint check). :param model: FBModel object to check :return: True if it's a top joint, False otherwise

generate_sequence_dict_from_anim_dict

def generate_sequence_dict_from_anim_dict(anim_dict)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:214

Generates a new dictionary with shot_number as the key, and a list of animations as the value. Each animation has export path, skeleton, blueprint (default to None), nodes, start frame, and end frame. :param anim_dict: The original animatio

get_motionbuilder_fps

def get_motionbuilder_fps()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:250

:return: Which playback fps the scene is set with

create_string_property

def create_string_property(model, prop_name, value)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:271

:param model: The actual object you want to add the property to :param prop_name: name of property :param value: value to define the property with :return:

create_and_populate_export_node

def create_and_populate_export_node(anim_dict, skeletons, uproject, log_path, cmd_path, export_directory, namespace_skeleton_map)

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:287

Data is passed from the UI, likely wont need to call from Maya directly (just separating out cmds calls into this file) :param anim_dict: :param skeletons: :param uproject: :param log_path: :param cmd_path: :param export_directory: :param n

get_export_node_data

def get_export_node_data()

module function · public name · motionbuilder_tools/Cinematics/SequenceUI/sequence_utils.py:317

motionbuilder_tools.io

_sdk

def _sdk()

module function · internal · motionbuilder_tools/io.py:9

import_fbx

def import_fbx(filepath: str, merge: bool=True) -> dict[str, Any]

module function · public name · motionbuilder_tools/io.py:15

save_fbx_checked

def save_fbx_checked(filepath: str, options: Any, *, sdk_module=None) -> Path

module function · public name · motionbuilder_tools/io.py:27

Save with caller-supplied MotionBuilder options and verify the file.

export_fbx

def export_fbx(filepath: str, selected_only: bool=False) -> dict[str, Any]

module function · public name · motionbuilder_tools/io.py:39

_animation_key_count

def _animation_key_count(model: Any) -> int

module function · internal · motionbuilder_tools/io.py:48

inspect_character

def inspect_character(character_name: str) -> dict[str, Any]

module function · public name · motionbuilder_tools/io.py:62

motionbuilder_tools.motionbuilder_menu

create_motionbuilder_menu

def create_motionbuilder_menu()

module function · public name · motionbuilder_tools/motionbuilder_menu.py:6

Create a custom menu in MotionBuilder UI.

on_menu_click

def on_menu_click(control, event)

module function · public name · motionbuilder_tools/motionbuilder_menu.py:19

motionbuilder_tools.motionbuilder_setup

get_motionbuilder_version_string

def get_motionbuilder_version_string() -> str

module function · public name · motionbuilder_tools/motionbuilder_setup.py:12

motionbuilder_python_path

def motionbuilder_python_path() -> Path

module function · public name · motionbuilder_tools/motionbuilder_setup.py:18

_requests_available

def _requests_available() -> bool

module function · internal · motionbuilder_tools/motionbuilder_setup.py:22

install_current_motionbuilder_tools

def install_current_motionbuilder_tools(*, timeout_seconds: float=120.0) -> dict[str, object]

module function · public name · motionbuilder_tools/motionbuilder_setup.py:26

Ensure the bridge dependency exists without mutating the host on import.

motionbuilder_tools.Rigging.rigging_host_adapter

reload_dependencies

def reload_dependencies() -> str

module function · public name · motionbuilder_tools/Rigging/rigging_host_adapter.py:33

Refresh the shared portable contract used by this live MotionBuilder host.

_result

def _result(ok: bool, capability: str, message: str='', **kwargs: Any) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:48

_model_name

def _model_name(model) -> str

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:52

scene_joints

def scene_joints() -> dict[str, Any]

module function · public name · motionbuilder_tools/Rigging/rigging_host_adapter.py:56

selection

def selection() -> dict[str, Any]

module function · public name · motionbuilder_tools/Rigging/rigging_host_adapter.py:76

execute

def execute(capability: str, payload: dict[str, Any]) -> dict[str, Any]

module function · public name · motionbuilder_tools/Rigging/rigging_host_adapter.py:84

_definition

def _definition(value: Any) -> CharacterDefinition

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:95

_op_definition_auto_map

def _op_definition_auto_map(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:108

_op_definition_assign_slot

def _op_definition_assign_slot(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:119

_op_definition_clear_slot

def _op_definition_clear_slot(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:129

_op_definition_mirror_slots

def _op_definition_mirror_slots(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:135

_op_definition_validate

def _op_definition_validate(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:141

_op_definition_set_reference_pose

def _op_definition_set_reference_pose(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:147

_op_definition_import

def _op_definition_import(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:159

_op_definition_export

def _op_definition_export(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:165

_op_rig_create_control

def _op_rig_create_control(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:174

_constraint_type_name

def _constraint_type_name(kind: str) -> str

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:190

_op_rig_create_constraint

def _op_rig_create_constraint(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:197

_op_rig_create_ik_fk_limb

def _op_rig_create_ik_fk_limb(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:218

_op_rig_set_ik_fk_blend

def _op_rig_set_ik_fk_blend(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:232

_op_rig_create_space_switch

def _op_rig_create_space_switch(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:240

_op_rig_set_space

def _op_rig_set_space(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:252

_activate_space

def _activate_space(switch_id: str) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:260

_op_rig_create_motion_path

def _op_rig_create_motion_path(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:272

_op_rig_store_connections

def _op_rig_store_connections(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:276

_op_rig_restore_connections

def _op_rig_restore_connections(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:281

_op_retarget_solve_pose

def _op_retarget_solve_pose(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:285

_op_retarget_bake

def _op_retarget_bake(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:303

_op_retarget_transfer_take

def _op_retarget_transfer_take(payload: dict[str, Any]) -> dict[str, Any]

module function · internal · motionbuilder_tools/Rigging/rigging_host_adapter.py:315