Import Scene Operators#

bpy.ops.import_scene.fbx(filepath='', directory='', filter_glob='*.fbx', files=None, ui_tab='MAIN', use_manual_orientation=False, global_scale=1.0, bake_space_transform=False, use_custom_normals=True, colors_type='SRGB', use_image_search=True, use_alpha_decals=False, decal_offset=0.0, use_anim=True, anim_offset=1.0, use_subsurf=False, use_custom_props=True, use_custom_props_enum_as_string=True, ignore_leaf_bones=False, force_connect_children=False, automatic_bone_orientation=False, primary_bone_axis='Y', secondary_bone_axis='X', use_prepost_rot=True, axis_forward='-Z', axis_up='Y')#

Load a FBX file

Parameters:
  • filepath (string, (optional, never None)) – File Path, Filepath used for importing the file

  • directory (string, (optional, never None)) – directory

  • filter_glob (string, (optional, never None)) – filter_glob

  • files (bpy_prop_collection of OperatorFileListElement, (optional)) – File Path

  • ui_tab (enum in ['MAIN', 'ARMATURE'], (optional)) –

    ui_tab, Import options categories

    • MAIN Main – Main basic settings.

    • ARMATURE Armatures – Armature-related settings.

  • use_manual_orientation (boolean, (optional)) – Manual Orientation, Specify orientation and scale, instead of using embedded data in FBX file

  • global_scale (float in [0.001, 1000], (optional)) – Scale

  • bake_space_transform (boolean, (optional)) – Apply Transform, Bake space transform into object data, avoids getting unwanted rotations to objects when target space is not aligned with Blender’s space (WARNING! experimental option, use at own risk, known to be broken with armatures/animations)

  • use_custom_normals (boolean, (optional)) – Custom Normals, Import custom normals, if available (otherwise Blender will recompute them)

  • colors_type (enum in ['NONE', 'SRGB', 'LINEAR'], (optional)) –

    Vertex Colors, Import vertex color attributes

    • NONE None – Do not import color attributes.

    • SRGB sRGB – Expect file colors in sRGB color space.

    • LINEAR Linear – Expect file colors in linear color space.

  • use_image_search (boolean, (optional)) – Image Search, Search subdirs for any associated images (WARNING: may be slow)

  • use_alpha_decals (boolean, (optional)) – Alpha Decals, Treat materials with alpha as decals (no shadow casting)

  • decal_offset (float in [0, 1], (optional)) – Decal Offset, Displace geometry of alpha meshes

  • use_anim (boolean, (optional)) – Import Animation, Import FBX animation

  • anim_offset (float in [-inf, inf], (optional)) – Animation Offset, Offset to apply to animation during import, in frames

  • use_subsurf (boolean, (optional)) – Subdivision Data, Import FBX subdivision information as subdivision surface modifiers

  • use_custom_props (boolean, (optional)) – Custom Properties, Import user properties as custom properties

  • use_custom_props_enum_as_string (boolean, (optional)) – Import Enums As Strings, Store enumeration values as strings

  • ignore_leaf_bones (boolean, (optional)) – Ignore Leaf Bones, Ignore the last bone at the end of each chain (used to mark the length of the previous bone)

  • force_connect_children (boolean, (optional)) – Force Connect Children, Force connection of children bones to their parent, even if their computed head/tail positions do not match (can be useful with pure-joints-type armatures)

  • automatic_bone_orientation (boolean, (optional)) – Automatic Bone Orientation, Try to align the major bone axis with the bone children

  • primary_bone_axis (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Primary Bone Axis

  • secondary_bone_axis (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Secondary Bone Axis

  • use_prepost_rot (boolean, (optional)) – Use Pre/Post Rotation, Use pre/post rotation from FBX transform (you may have to disable that in some cases)

  • axis_forward (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Forward

  • axis_up (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Up

File:

addons/io_scene_fbx/__init__.py:198

bpy.ops.import_scene.gltf(filepath='', export_import_convert_lighting_mode='SPEC', filter_glob='*.glb;*.gltf', files=None, loglevel=0, import_pack_images=True, merge_vertices=False, import_shading='NORMALS', bone_heuristic='BLENDER', guess_original_bind_pose=True, import_webp_texture=False)#

Load a glTF 2.0 file

Parameters:
  • filepath (string, (optional, never None)) – File Path, Filepath used for importing the file

  • export_import_convert_lighting_mode (enum in ['SPEC', 'COMPAT', 'RAW'], (optional)) –

    Lighting Mode, Optional backwards compatibility for non-standard render engines. Applies to lights

    • SPEC Standard – Physically-based glTF lighting units (cd, lx, nt).

    • COMPAT Unitless – Non-physical, unitless lighting. Useful when exposure controls are not available.

    • RAW Raw (Deprecated) – Blender lighting strengths with no conversion.

  • filter_glob (string, (optional, never None)) – filter_glob

  • files (bpy_prop_collection of OperatorFileListElement, (optional)) – File Path

  • loglevel (int in [-inf, inf], (optional)) – Log Level, Log Level

  • import_pack_images (boolean, (optional)) – Pack Images, Pack all images into .blend file

  • merge_vertices (boolean, (optional)) – Merge Vertices, The glTF format requires discontinuous normals, UVs, and other vertex attributes to be stored as separate vertices, as required for rendering on typical graphics hardware. This option attempts to combine co-located vertices where possible. Currently cannot combine verts with different normals

  • import_shading (enum in ['NORMALS', 'FLAT', 'SMOOTH'], (optional)) – Shading, How normals are computed during import

  • bone_heuristic (enum in ['BLENDER', 'TEMPERANCE', 'FORTUNE'], (optional)) –

    Bone Dir, Heuristic for placing bones. Tries to make bones pretty

    • BLENDER Blender (best for import/export round trip) – Good for re-importing glTFs exported from Blender, and re-exporting glTFs to glTFs after Blender editing. Bone tips are placed on their local +Y axis (in glTF space).

    • TEMPERANCE Temperance (average) – Decent all-around strategy. A bone with one child has its tip placed on the local axis closest to its child.

    • FORTUNE Fortune (may look better, less accurate) – Might look better than Temperance, but also might have errors. A bone with one child has its tip placed at its child’s root. Non-uniform scalings may get messed up though, so beware.

  • guess_original_bind_pose (boolean, (optional)) – Guess Original Bind Pose, Try to guess the original bind pose for skinned meshes from the inverse bind matrices. When off, use default/rest pose as bind pose

  • import_webp_texture (boolean, (optional)) – Import WebP textures, If a texture exists in WebP format, loads the WebP texture instead of the fallback PNG/JPEG one

File:

addons/io_scene_gltf2/__init__.py:2093

bpy.ops.import_scene.x3d(filepath='', filter_glob='*.x3d;*.wrl', axis_forward='Z', axis_up='Y')#

Import an X3D or VRML2 file

Parameters:
  • filepath (string, (optional, never None)) – File Path, Filepath used for importing the file

  • filter_glob (string, (optional, never None)) – filter_glob

  • axis_forward (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Forward

  • axis_up (enum in ['X', 'Y', 'Z', '-X', '-Y', '-Z'], (optional)) – Up

File:

addons/io_scene_x3d/__init__.py:50