bpy_extras submodule (bpy_extras.io_utils)

bpy_extras.io_utils.axis_conversion(from_forward='Y', from_up='Z', to_forward='Y', to_up='Z')

Each argument us an axis in [‘X’, ‘Y’, ‘Z’, ‘-X’, ‘-Y’, ‘-Z’] where the first 2 are a source and the second 2 are the target.

bpy_extras.io_utils.create_derived_objects(scene, ob)
bpy_extras.io_utils.free_derived_objects(ob)
bpy_extras.io_utils.unpack_list(list_of_tuples)
bpy_extras.io_utils.unpack_face_list(list_of_tuples)
bpy_extras.io_utils.path_reference(filepath, base_src, base_dst, mode='AUTO', copy_subdir='', copy_set=None)

Return a filepath relative to a destination directory, for use with exporters.

Parameters:
  • filepath (string) – the file path to return, supporting blenders relative ‘//’ prefix.
  • base_src (string) – the directory the filepath is relative too (normally the blend file).
  • base_dst (string) – the directory the filepath will be referenced from (normally the export path).
  • mode (string) – the method used get the path in [‘AUTO’, ‘ABSOLUTE’, ‘RELATIVE’, ‘MATCH’, ‘STRIP’, ‘COPY’]
  • copy_subdir (string) – the subdirectory of base_dst to use when mode=’COPY’.
  • copy_set (set) – collect from/to pairs when mode=’COPY’, pass to path_reference_copy when exportign is done.
Returns:

the new filepath.

Return type:

string

bpy_extras.io_utils.path_reference_copy(copy_set, report=<built-in function print>)

Execute copying files of path_reference

Parameters:
  • copy_set (set) – set of (from, to) pairs to copy.
  • report (function) – function used for reporting warnings, takes a string argument.
bpy_extras.io_utils.path_reference_mode

constant value (<built-in function EnumProperty>, {‘default’: ‘AUTO’, ‘items’: ((‘AUTO’, ‘Auto’, ‘Use Relative paths with subdirectories only’), (‘ABSOLUTE’, ‘Absolute’, ‘Always write absolute paths’), (‘RELATIVE’, ‘Relative’, ‘Always write relative patsh (where possible)’), (‘MATCH’, ‘Match’, ‘Match Absolute/Relative setting with input path’), (‘STRIP’, ‘Strip Path’, ‘Filename only’), (‘COPY’, ‘Copy’, ‘copy the file to the destination path (or subdirectory)’)), ‘attr’: ‘path_mode’, ‘description’: ‘Method used to reference paths’, ‘name’: ‘Path Mode’})

bpy_extras.io_utils.unique_name(key, name, name_dict, name_max=-1, clean_func=None)

Helper function for storing unique names which may have special characters stripped and restricted to a maximum length.

Parameters:
  • key (any hashable object assosiated with the name.) – unique item this name belongs to, name_dict[key] will be reused when available. This can be the object, mesh, material, etc instance its self.
  • name (string) – The name used to create a unique value in name_dict.
  • name_dict (dict) – This is used to cache namespace to ensure no collisions occur, this should be an empty dict initially and only modified by this function.
  • clean_func (function) – Function to call on name before creating a unique value.
class bpy_extras.io_utils.ExportHelper
class bpy_extras.io_utils.ImportHelper

Previous topic

bpy_extras submodule (bpy_extras.object_utils)

Next topic

bpy_extras submodule (bpy_extras.image_utils)