csc.fbx.FbxLoader

class csc.fbx.FbxLoader

FbxLoader class.

Provides methods to import and export FBX files.

 1# This script imports a specified FBX file into the current scene
 2import csc
 3
 4def run(scene):
 5    app = csc.app.get_application()
 6
 7    def import_scene(folder_path: str):
 8        file_ = folder_path.replace('\\', '/')
 9        scene_manager = app.get_scene_manager()
10        tools_manager = app.get_tools_manager()
11        # Get current scene tab
12        current_scene = scene_manager.current_scene()
13        # Get FbxSceneLoader tool
14        fbx_scene_loader_tool = tools_manager.get_tool("FbxSceneLoader")
15        # Get FbxLoader
16        fbx_scene_loader = fbx_scene_loader_tool.get_fbx_loader(current_scene)
17        # Import fbx file as a scene
18        fbx_scene_loader.import_scene(file_)
19
20    app.get_file_dialog_manager().show_open_file_dialog("Select .fbx file", "", ["*.fbx"], import_scene)
21
22# This script imports animation data from the specified FBX file
23import csc
24
25def run(scene):
26    app = csc.app.get_application()
27
28    def import_animation(folder_path: str):
29        file_ = folder_path.replace('\\', '/')
30        scene_manager = app.get_scene_manager()
31        tools_manager = app.get_tools_manager()
32        # Get current scene tab
33        current_scene = scene_manager.current_scene()
34        # Get FbxSceneLoader tool
35        fbx_scene_loader_tool = tools_manager.get_tool("FbxSceneLoader")
36        # Get FbxLoader
37        fbx_scene_loader = fbx_scene_loader_tool.get_fbx_loader(current_scene)
38        # Import fbx file as a scene
39        fbx_scene_loader.import_animation(file_)
40
41    app.get_file_dialog_manager().show_open_file_dialog("Select .fbx file", "", ["*.fbx"], import_animation)
42
43# This script imports animation data from the specified FBX file
44import csc
45
46def run(scene):
47    app = csc.app.get_application()
48
49    def import_animation(folder_path: str):
50        file_ = folder_path.replace('\\', '/')
51        scene_manager = app.get_scene_manager()
52        tools_manager = app.get_tools_manager()
53        # Get current scene tab
54        current_scene = scene_manager.current_scene()
55        # Get FbxSceneLoader tool
56        fbx_scene_loader_tool = tools_manager.get_tool("FbxSceneLoader")
57        # Get FbxLoader
58        fbx_scene_loader = fbx_scene_loader_tool.get_fbx_loader(current_scene)
59        # Import fbx file as a scene
60        fbx_scene_loader.import_animation(file_)
61
62    app.get_file_dialog_manager().show_open_file_dialog("Select .fbx file", "", ["*.fbx"], import_animation)
__init__(self: csc.fbx.FbxLoader, fps: float, handler: csc.domain.IMessageHandler, scene: csc.view.Scene) None

Methods

__init__(self, fps, handler, scene)

add_model(self, file_name)

Adds the model from the specified file.

add_model_to_selected(self, file_name)

Adds the model to the selected objects from the specified file.

export_all_objects(self, file_name)

Exports all objects to the specified file.

export_joints(self, file_name)

Exports the joints to the specified file.

export_joints_selected(self, file_name)

Exports the joints to the selected objects from the specified file.

export_joints_selected_frames(self, file_name)

Exports the joints to the selected frames from the specified file.

export_joints_selected_objects(self, file_name)

Exports the joints to the selected objects from the specified file.

export_model(self, file_name)

Exports the model to the specified file.

export_scene_selected(self, file_name)

Exports the scene to the selected objects from the specified file.

export_scene_selected_frames(self, file_name)

Exports the scene to the selected frames from the specified file.

export_scene_selected_objects(self, file_name)

Exports the scene to the selected objects from the specified file.

get_takes(self, file_name)

Get animation takes the specified file.

import_animation(self, file_name[, num_take])

Imports the animation from the specified file.

import_animation_to_selected_frames(self, ...)

Imports the animation to the selected frames from the specified file.

import_animation_to_selected_objects(self, ...)

Imports the animation to the selected objects from the specified file.

import_model(self, file_name)

Imports the model from the specified file.

import_scene(self, file_name[, num_take, ...])

Imports the scene from the specified file.

set_settings(self, settings)

Sets the settings.

__annotations__ = {}
__init__(self: csc.fbx.FbxLoader, fps: float, handler: csc.domain.IMessageHandler, scene: csc.view.Scene) None
__module__ = 'csc.fbx'
add_model(self: csc.fbx.FbxLoader, file_name: csc.Path) None

Adds the model from the specified file.

Parameters:

file_name (str) – The name of the file to add the model from

add_model_to_selected(self: csc.fbx.FbxLoader, file_name: csc.Path) None

Adds the model to the selected objects from the specified file.

Parameters:

file_name (str) – The name of the file to add the model from

export_all_objects(self: csc.fbx.FbxLoader, file_name: csc.Path) None

Exports all objects to the specified file.

Parameters:

file_name (str) – The name of the file to export the objects to

export_joints(self: csc.fbx.FbxLoader, file_name: str) None

Exports the joints to the specified file.

Parameters:

file_name (str) – The name of the file to export the joints to

export_joints_selected(self: csc.fbx.FbxLoader, file_name: str) None

Exports the joints to the selected objects from the specified file.

Parameters:

file_name (str) – The name of the file to export the joints to

export_joints_selected_frames(self: csc.fbx.FbxLoader, file_name: str) None

Exports the joints to the selected frames from the specified file.

Parameters:

file_name (str) – The name of the file to export the joints to

export_joints_selected_objects(self: csc.fbx.FbxLoader, file_name: str) None

Exports the joints to the selected objects from the specified file.

Parameters:

file_name (str) – The name of the file to export the joints to

export_model(self: csc.fbx.FbxLoader, file_name: csc.Path) None

Exports the model to the specified file.

Parameters:

file_name (str) – The name of the file to export the model to

export_scene_selected(self: csc.fbx.FbxLoader, file_name: str) None

Exports the scene to the selected objects from the specified file.

Parameters:

file_name (str) – The name of the file to export the scene to

export_scene_selected_frames(self: csc.fbx.FbxLoader, file_name: str) None

Exports the scene to the selected frames from the specified file.

Parameters:

file_name (str) – The name of the file to export the scene to

export_scene_selected_objects(self: csc.fbx.FbxLoader, file_name: str) None

Exports the scene to the selected objects from the specified file.

Parameters:

file_name (str) – The name of the file to export the scene to

get_takes(self: csc.fbx.FbxLoader, file_name: csc.Path) list[str]

Get animation takes the specified file.

Parameters:

file_name (str) – The name of the file to import the animation from

import_animation(self: csc.fbx.FbxLoader, file_name: csc.Path, num_take: int = -1) None

Imports the animation from the specified file.

Parameters:
  • file_name (str) – The name of the file to import the animation from

  • num_take (int) – Take number from the list received from get_takes

import_animation_to_selected_frames(self: csc.fbx.FbxLoader, file_name: csc.Path, num_take: int = -1) None

Imports the animation to the selected frames from the specified file.

Parameters:
  • file_name (str) – The name of the file to import the animation from

  • num_take (int) – Take number from the list received from get_takes

import_animation_to_selected_objects(self: csc.fbx.FbxLoader, file_name: csc.Path, num_take: int = -1) None

Imports the animation to the selected objects from the specified file.

Parameters:
  • file_name (str) – The name of the file to import the animation from

  • num_take (int) – Take number from the list received from get_takes

import_model(self: csc.fbx.FbxLoader, file_name: csc.Path) None

Imports the model from the specified file.

Parameters:

file_name (str) – The name of the file to import the model from

import_scene(self: csc.fbx.FbxLoader, file_name: csc.Path, num_take: int = -1, is_set_offset: bool = True) None

Imports the scene from the specified file.

Parameters:
  • file_name (str) – The name of the file to import the scene from

  • num_take (int) – Take number from the list received from get_takes

set_settings(self: csc.fbx.FbxLoader, settings: csc.fbx.FbxSettings) None

Sets the settings.

Parameters:

settings (csc.fbx.FbxSettings) – The settings