Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-09-21 16:12:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-09-21 16:12:27 +0300
commit2bfab056d2655bddf3612dbe7644bce9ad1b581b (patch)
tree6e7b4b450c96c5414c7fae6c8515fb6bf5a8e89e /io_scene_fbx/__init__.py
parentb5328b13c54bdd3419d48373e3f54f22e2501396 (diff)
Initial port of FBX to 2.8.
Default cube scene exports and imports ok (besides missing features like nodal material handling). Anything else is either known broken, or yet to be tested. :P Note that I raised main number of addon version, so that we can keep track of smaller fixes that can be done in both 2.7x and 2.8 versions of the addon.
Diffstat (limited to 'io_scene_fbx/__init__.py')
-rw-r--r--io_scene_fbx/__init__.py107
1 files changed, 54 insertions, 53 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index bae3e6cc..bbdcd9ef 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -21,8 +21,8 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
- "version": (3, 10, 0),
- "blender": (2, 79, 1),
+ "version": (4, 10, 0),
+ "blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
"warning": "",
@@ -67,12 +67,12 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
bl_label = "Import FBX"
bl_options = {'UNDO', 'PRESET'}
- directory = StringProperty()
+ directory: StringProperty()
filename_ext = ".fbx"
- filter_glob = StringProperty(default="*.fbx", options={'HIDDEN'})
+ filter_glob: StringProperty(default="*.fbx", options={'HIDDEN'})
- ui_tab = EnumProperty(
+ ui_tab: EnumProperty(
items=(('MAIN', "Main", "Main basic settings"),
('ARMATURE', "Armatures", "Armature-related settings"),
),
@@ -80,17 +80,17 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
description="Import options categories",
)
- use_manual_orientation = BoolProperty(
+ use_manual_orientation: BoolProperty(
name="Manual Orientation",
description="Specify orientation and scale, instead of using embedded data in FBX file",
default=False,
)
- global_scale = FloatProperty(
+ global_scale: FloatProperty(
name="Scale",
min=0.001, max=1000.0,
default=1.0,
)
- bake_space_transform = BoolProperty(
+ bake_space_transform: BoolProperty(
name="!EXPERIMENTAL! Apply Transform",
description="Bake space transform into object data, avoids getting unwanted rotations to objects when "
"target space is not aligned with Blender's space "
@@ -98,69 +98,69 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
default=False,
)
- use_custom_normals = BoolProperty(
+ use_custom_normals: BoolProperty(
name="Import Normals",
description="Import custom normals, if available (otherwise Blender will recompute them)",
default=True,
)
- use_image_search = BoolProperty(
+ use_image_search: BoolProperty(
name="Image Search",
description="Search subdirs for any associated images (WARNING: may be slow)",
default=True,
)
- use_alpha_decals = BoolProperty(
+ use_alpha_decals: BoolProperty(
name="Alpha Decals",
description="Treat materials with alpha as decals (no shadow casting)",
default=False,
)
- decal_offset = FloatProperty(
+ decal_offset: FloatProperty(
name="Decal Offset",
description="Displace geometry of alpha meshes",
min=0.0, max=1.0,
default=0.0,
)
- use_anim = BoolProperty(
+ use_anim: BoolProperty(
name="Import Animation",
description="Import FBX animation",
default=True,
)
- anim_offset = FloatProperty(
+ anim_offset: FloatProperty(
name="Animation Offset",
description="Offset to apply to animation during import, in frames",
default=1.0,
)
- use_custom_props = BoolProperty(
+ use_custom_props: BoolProperty(
name="Import User Properties",
description="Import user properties as custom properties",
default=True,
)
- use_custom_props_enum_as_string = BoolProperty(
+ use_custom_props_enum_as_string: BoolProperty(
name="Import Enums As Strings",
description="Store enumeration values as strings",
default=True,
)
- ignore_leaf_bones = BoolProperty(
+ ignore_leaf_bones: BoolProperty(
name="Ignore Leaf Bones",
description="Ignore the last bone at the end of each chain (used to mark the length of the previous bone)",
default=False,
)
- force_connect_children = BoolProperty(
+ force_connect_children: BoolProperty(
name="Force Connect Children",
description="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)",
default=False,
)
- automatic_bone_orientation = BoolProperty(
+ automatic_bone_orientation: BoolProperty(
name="Automatic Bone Orientation",
description="Try to align the major bone axis with the bone children",
default=False,
)
- primary_bone_axis = EnumProperty(
+ primary_bone_axis: EnumProperty(
name="Primary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
@@ -171,7 +171,7 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
),
default='Y',
)
- secondary_bone_axis = EnumProperty(
+ secondary_bone_axis: EnumProperty(
name="Secondary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
@@ -183,7 +183,7 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
default='X',
)
- use_prepost_rot = BoolProperty(
+ use_prepost_rot: BoolProperty(
name="Use Pre/Post Rotation",
description="Use pre/post rotation from FBX transform (you may have to disable that in some cases)",
default=True,
@@ -228,7 +228,8 @@ class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
def execute(self, context):
keywords = self.as_keywords(ignore=("filter_glob", "directory", "ui_tab"))
- keywords["use_cycles"] = (context.scene.render.engine == 'CYCLES')
+ # XXX TODO get rid of this, EEVEE/Cycles use same nodal system...
+ keywords["use_cycles"] = True #(context.scene.render.engine == 'CYCLES')
from . import import_fbx
return import_fbx.load(self, context, **keywords)
@@ -241,12 +242,12 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
bl_options = {'UNDO', 'PRESET'}
filename_ext = ".fbx"
- filter_glob = StringProperty(default="*.fbx", options={'HIDDEN'})
+ filter_glob: StringProperty(default="*.fbx", options={'HIDDEN'})
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- ui_tab = EnumProperty(
+ ui_tab: EnumProperty(
items=(('MAIN', "Main", "Main basic settings"),
('GEOMETRY', "Geometries", "Geometry-related settings"),
('ARMATURE', "Armatures", "Armature-related settings"),
@@ -256,24 +257,24 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
description="Export options categories",
)
- use_selection = BoolProperty(
+ use_selection: BoolProperty(
name="Selected Objects",
description="Export selected objects on visible layers",
default=False,
)
- global_scale = FloatProperty(
+ global_scale: FloatProperty(
name="Scale",
description="Scale all data (Some importers do not support scaled armatures!)",
min=0.001, max=1000.0,
soft_min=0.01, soft_max=1000.0,
default=1.0,
)
- apply_unit_scale = BoolProperty(
+ apply_unit_scale: BoolProperty(
name="Apply Unit",
description="Take into account current Blender units settings (if unset, raw Blender Units values are used as-is)",
default=True,
)
- apply_scale_options = EnumProperty(
+ apply_scale_options: EnumProperty(
items=(('FBX_SCALE_NONE', "All Local",
"Apply custom scaling and units scaling to each object transformation, FBX scale remains at 1.0"),
('FBX_SCALE_UNITS', "FBX Units Scale",
@@ -288,7 +289,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
"(Blender uses FBX scale to detect units on import, "
"but many other applications do not handle the same way)",
)
- bake_space_transform = BoolProperty(
+ bake_space_transform: BoolProperty(
name="!EXPERIMENTAL! Apply Transform",
description="Bake space transform into object data, avoids getting unwanted rotations to objects when "
"target space is not aligned with Blender's space "
@@ -296,7 +297,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
default=False,
)
- object_types = EnumProperty(
+ object_types: EnumProperty(
name="Object Types",
options={'ENUM_FLAG'},
items=(('EMPTY', "Empty", ""),
@@ -310,18 +311,18 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
default={'EMPTY', 'CAMERA', 'LIGHT', 'ARMATURE', 'MESH', 'OTHER'},
)
- use_mesh_modifiers = BoolProperty(
+ use_mesh_modifiers: BoolProperty(
name="Apply Modifiers",
description="Apply modifiers to mesh objects (except Armature ones) - "
"WARNING: prevents exporting shape keys",
default=True,
)
- use_mesh_modifiers_render = BoolProperty(
+ use_mesh_modifiers_render: BoolProperty(
name="Use Modifiers Render Setting",
description="Use render settings when applying modifiers to mesh objects",
default=True,
)
- mesh_smooth_type = EnumProperty(
+ mesh_smooth_type: EnumProperty(
name="Smoothing",
items=(('OFF', "Normals Only", "Export only normals instead of writing edge or face smoothing data"),
('FACE', "Face", "Write face smoothing"),
@@ -331,29 +332,29 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
"(prefer 'Normals Only' option if your target importer understand split normals)",
default='OFF',
)
- use_mesh_edges = BoolProperty(
+ use_mesh_edges: BoolProperty(
name="Loose Edges",
description="Export loose edges (as two-vertices polygons)",
default=False,
)
- use_tspace = BoolProperty(
+ use_tspace: BoolProperty(
name="Tangent Space",
description="Add binormal and tangent vectors, together with normal they form the tangent space "
"(will only work correctly with tris/quads only meshes!)",
default=False,
)
- use_custom_props = BoolProperty(
+ use_custom_props: BoolProperty(
name="Custom Properties",
description="Export custom properties",
default=False,
)
- add_leaf_bones = BoolProperty(
+ add_leaf_bones: BoolProperty(
name="Add Leaf Bones",
description="Append a final bone to the end of each chain to specify last bone length "
"(use this when you intend to edit the armature from exported data)",
default=True # False for commit!
)
- primary_bone_axis = EnumProperty(
+ primary_bone_axis: EnumProperty(
name="Primary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
@@ -364,7 +365,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
),
default='Y',
)
- secondary_bone_axis = EnumProperty(
+ secondary_bone_axis: EnumProperty(
name="Secondary Bone Axis",
items=(('X', "X Axis", ""),
('Y', "Y Axis", ""),
@@ -375,12 +376,12 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
),
default='X',
)
- use_armature_deform_only = BoolProperty(
+ use_armature_deform_only: BoolProperty(
name="Only Deform Bones",
description="Only write deforming bones (and non-deforming ones when they have deforming children)",
default=False,
)
- armature_nodetype = EnumProperty(
+ armature_nodetype: EnumProperty(
name="Armature FBXNode Type",
items=(('NULL', "Null", "'Null' FBX node, similar to Blender's Empty (default)"),
('ROOT', "Root", "'Root' FBX node, supposed to be the root of chains of bones..."),
@@ -391,43 +392,43 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
"perfectly in Blender...)",
default='NULL',
)
- bake_anim = BoolProperty(
+ bake_anim: BoolProperty(
name="Baked Animation",
description="Export baked keyframe animation",
default=True,
)
- bake_anim_use_all_bones = BoolProperty(
+ bake_anim_use_all_bones: BoolProperty(
name="Key All Bones",
description="Force exporting at least one key of animation for all bones "
"(needed with some target applications, like UE4)",
default=True,
)
- bake_anim_use_nla_strips = BoolProperty(
+ bake_anim_use_nla_strips: BoolProperty(
name="NLA Strips",
description="Export each non-muted NLA strip as a separated FBX's AnimStack, if any, "
"instead of global scene animation",
default=True,
)
- bake_anim_use_all_actions = BoolProperty(
+ bake_anim_use_all_actions: BoolProperty(
name="All Actions",
description="Export each action as a separated FBX's AnimStack, instead of global scene animation "
"(note that animated objects will get all actions compatible with them, "
"others will get no animation at all)",
default=True,
)
- bake_anim_force_startend_keying = BoolProperty(
+ bake_anim_force_startend_keying: BoolProperty(
name="Force Start/End Keying",
description="Always add a keyframe at start and end of actions for animated channels",
default=True,
)
- bake_anim_step = FloatProperty(
+ bake_anim_step: FloatProperty(
name="Sampling Rate",
description="How often to evaluate animated values (in frames)",
min=0.01, max=100.0,
soft_min=0.1, soft_max=10.0,
default=1.0,
)
- bake_anim_simplify_factor = FloatProperty(
+ bake_anim_simplify_factor: FloatProperty(
name="Simplify",
description="How much to simplify baked values (0.0 to disable, the higher the more simplified)",
min=0.0, max=100.0, # No simplification to up to 10% of current magnitude tolerance.
@@ -435,24 +436,24 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
default=1.0, # default: min slope: 0.005, max frame step: 10.
)
path_mode = path_reference_mode
- embed_textures = BoolProperty(
+ embed_textures: BoolProperty(
name="Embed Textures",
description="Embed textures in FBX binary file (only for \"Copy\" path mode!)",
default=False,
)
- batch_mode = EnumProperty(
+ batch_mode: EnumProperty(
name="Batch Mode",
items=(('OFF', "Off", "Active scene to file"),
('SCENE', "Scene", "Each scene as a file"),
('GROUP', "Group", "Each group as a file"),
),
)
- use_batch_own_dir = BoolProperty(
+ use_batch_own_dir: BoolProperty(
name="Batch Own Dir",
description="Create a dir for each exported file",
default=True,
)
- use_metadata = BoolProperty(
+ use_metadata: BoolProperty(
name="Use Metadata",
default=True,
options={'HIDDEN'},