|
@@ -59,6 +59,10 @@ Node *EditorSceneFormatImporterUFBX::import_scene(const String &p_path, uint32_t
|
|
|
state.instantiate();
|
|
|
print_verbose(vformat("FBX path: %s", p_path));
|
|
|
String path = ProjectSettings::get_singleton()->globalize_path(p_path);
|
|
|
+ if (p_options.has("fbx/naming_version")) {
|
|
|
+ int naming_version = p_options["fbx/naming_version"];
|
|
|
+ fbx->set_naming_version(naming_version);
|
|
|
+ }
|
|
|
bool allow_geometry_helper_nodes = p_options.has("fbx/allow_geometry_helper_nodes") ? (bool)p_options["fbx/allow_geometry_helper_nodes"] : false;
|
|
|
if (allow_geometry_helper_nodes) {
|
|
|
state->set_allow_geometry_helper_nodes(allow_geometry_helper_nodes);
|
|
@@ -94,6 +98,7 @@ void EditorSceneFormatImporterUFBX::get_import_options(const String &p_path,
|
|
|
r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::INT, "fbx/importer", PROPERTY_HINT_ENUM, "ufbx,FBX2glTF"), FBX_IMPORTER_UFBX));
|
|
|
r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::BOOL, "fbx/allow_geometry_helper_nodes"), false));
|
|
|
r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::INT, "fbx/embedded_image_handling", PROPERTY_HINT_ENUM, "Discard All Textures,Extract Textures,Embed as Basis Universal,Embed as Uncompressed", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), FBXState::HANDLE_BINARY_EXTRACT_TEXTURES));
|
|
|
+ r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::INT, "fbx/naming_version", PROPERTY_HINT_ENUM, "Godot 4.0 or 4.1,Godot 4.2 to 4.4,Godot 4.5 or later"), 2));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -101,4 +106,10 @@ void EditorSceneFormatImporterUFBX::handle_compatibility_options(HashMap<StringN
|
|
|
if (!p_import_params.has("fbx/importer")) {
|
|
|
p_import_params["fbx/importer"] = EditorSceneFormatImporterUFBX::FBX_IMPORTER_FBX2GLTF;
|
|
|
}
|
|
|
+ if (!p_import_params.has("fbx/naming_version")) {
|
|
|
+ // If a .fbx's existing import file is missing the FBX
|
|
|
+ // naming compatibility version, we need to use version 1.
|
|
|
+ // Version 1 is the behavior before this option was added.
|
|
|
+ p_import_params["fbx/naming_version"] = 1;
|
|
|
+ }
|
|
|
}
|