summaryrefslogtreecommitdiff
path: root/modules/fbx
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fbx')
-rw-r--r--modules/fbx/data/fbx_material.cpp6
-rw-r--r--modules/fbx/data/fbx_mesh_data.cpp16
-rw-r--r--modules/fbx/editor_scene_importer_fbx.cpp15
3 files changed, 18 insertions, 19 deletions
diff --git a/modules/fbx/data/fbx_material.cpp b/modules/fbx/data/fbx_material.cpp
index b00ac2083e..3da9e4e1ff 100644
--- a/modules/fbx/data/fbx_material.cpp
+++ b/modules/fbx/data/fbx_material.cpp
@@ -42,7 +42,7 @@ void FBXMaterial::set_imported_material(FBXDocParser::Material *p_material) {
}
void FBXMaterial::add_search_string(String p_filename, String p_current_directory, String search_directory, Vector<String> &texture_search_paths) {
- if (search_directory.empty()) {
+ if (search_directory.is_empty()) {
texture_search_paths.push_back(p_current_directory.get_base_dir().plus_file(p_filename));
} else {
texture_search_paths.push_back(p_current_directory.get_base_dir().plus_file(search_directory + "/" + p_filename));
@@ -188,7 +188,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) {
spatial_material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA);
}
- ERR_CONTINUE_MSG(file_extension.empty(), "your texture has no file extension so we had to ignore it, let us know if you think this is wrong file an issue on github! " + debug_string);
+ ERR_CONTINUE_MSG(file_extension.is_empty(), "your texture has no file extension so we had to ignore it, let us know if you think this is wrong file an issue on github! " + debug_string);
ERR_CONTINUE_MSG(fbx_texture_map.count(fbx_mapping_name) <= 0, "This material has a texture with mapping name: " + String(fbx_mapping_name.c_str()) + " which is not yet supported by this importer. Consider opening an issue so we can support it.");
ERR_CONTINUE_MSG(
file_extension_uppercase != "PNG" &&
@@ -211,7 +211,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) {
texture = state.cached_image_searches[texture_name];
} else {
String path = find_texture_path_by_filename(texture_name, p_fbx_current_directory);
- if (!path.empty()) {
+ if (!path.is_empty()) {
Ref<Texture2D> image_texture = ResourceLoader::load(path);
ERR_CONTINUE(image_texture.is_null());
diff --git a/modules/fbx/data/fbx_mesh_data.cpp b/modules/fbx/data/fbx_mesh_data.cpp
index 0728866adb..d1c4b70b5c 100644
--- a/modules/fbx/data/fbx_mesh_data.cpp
+++ b/modules/fbx/data/fbx_mesh_data.cpp
@@ -38,7 +38,7 @@
template <class T>
T collect_first(const Vector<VertexData<T>> *p_data, T p_fall_back) {
- if (p_data->empty()) {
+ if (p_data->is_empty()) {
return p_fall_back;
}
@@ -47,7 +47,7 @@ T collect_first(const Vector<VertexData<T>> *p_data, T p_fall_back) {
template <class T>
HashMap<int, T> collect_all(const Vector<VertexData<T>> *p_data, HashMap<int, T> p_fall_back) {
- if (p_data->empty()) {
+ if (p_data->is_empty()) {
return p_fall_back;
}
@@ -61,7 +61,7 @@ HashMap<int, T> collect_all(const Vector<VertexData<T>> *p_data, HashMap<int, T>
template <class T>
T collect_average(const Vector<VertexData<T>> *p_data, T p_fall_back) {
- if (p_data->empty()) {
+ if (p_data->is_empty()) {
return p_fall_back;
}
@@ -76,7 +76,7 @@ T collect_average(const Vector<VertexData<T>> *p_data, T p_fall_back) {
}
HashMap<int, Vector3> collect_normal(const Vector<VertexData<Vector3>> *p_data, HashMap<int, Vector3> p_fall_back) {
- if (p_data->empty()) {
+ if (p_data->is_empty()) {
return p_fall_back;
}
@@ -89,7 +89,7 @@ HashMap<int, Vector3> collect_normal(const Vector<VertexData<Vector3>> *p_data,
}
HashMap<int, Vector2> collect_uv(const Vector<VertexData<Vector2>> *p_data, HashMap<int, Vector2> p_fall_back) {
- if (p_data->empty()) {
+ if (p_data->is_empty()) {
return p_fall_back;
}
@@ -231,7 +231,7 @@ EditorSceneImporterMeshNode3D *FBXMeshData::create_fbx_mesh(const ImportState &s
// Phase 2. For each material create a surface tool (So a different mesh).
{
- if (polygon_surfaces.empty()) {
+ if (polygon_surfaces.is_empty()) {
// No material, just use the default one with index -1.
// Set -1 to all polygons.
const int polygon_count = count_polygons(polygon_indices);
@@ -990,7 +990,7 @@ void FBXMeshData::triangulate_polygon(Ref<SurfaceTool> st, Vector<int> p_polygon
}
void FBXMeshData::gen_weight_info(Ref<SurfaceTool> st, Vertex vertex_id) const {
- if (vertex_weights.empty()) {
+ if (vertex_weights.is_empty()) {
return;
}
@@ -1417,7 +1417,7 @@ void FBXMeshData::extract_morphs(const FBXDocParser::MeshGeometry *mesh_geometry
const std::vector<const FBXDocParser::ShapeGeometry *> &shape_geometries = blend_shape_channel->GetShapeGeometries();
for (const FBXDocParser::ShapeGeometry *shape_geometry : shape_geometries) {
String morph_name = ImportUtils::FBXAnimMeshName(shape_geometry->Name()).c_str();
- if (morph_name.empty()) {
+ if (morph_name.is_empty()) {
morph_name = "morph";
}
diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp
index d37befbbfd..ff729a635f 100644
--- a/modules/fbx/editor_scene_importer_fbx.cpp
+++ b/modules/fbx/editor_scene_importer_fbx.cpp
@@ -63,8 +63,7 @@ void EditorSceneImporterFBX::get_extensions(List<String> *r_extensions) const {
const String fbx_str = "fbx";
Vector<String> exts;
exts.push_back(fbx_str);
- _register_project_setting_import(fbx_str, import_setting_string, exts, r_extensions,
- true);
+ _register_project_setting_import(fbx_str, import_setting_string, exts, r_extensions, true);
}
void EditorSceneImporterFBX::_register_project_setting_import(const String generic,
@@ -181,7 +180,7 @@ Node3D *EditorSceneImporterFBX::import_scene(const String &p_path, uint32_t p_fl
}
if (is_blender_fbx) {
- WARN_PRINT("Blender FBX files will not work properly with keyframes or skeletons until we make fixes stand by.");
+ WARN_PRINT("Blender FBX files will not work properly with keyframes or skeletons until we make fixes. Please stand by.");
}
Node3D *spatial = _generate_scene(p_path, &doc, p_flags, p_bake_fps, 8);
@@ -196,7 +195,7 @@ Node3D *EditorSceneImporterFBX::import_scene(const String &p_path, uint32_t p_fl
return spatial;
} else {
- print_error("Cannot import file: " + p_path + " version of file is unsupported, please re-export in your modelling package file version is: " + itos(doc.FBXVersion()));
+ ERR_PRINT(vformat("Cannot import FBX file: %s. It uses file format %d which is unsupported by Godot. Please re-export it or convert it to a newer format.", p_path, doc.FBXVersion()));
}
}
@@ -550,8 +549,8 @@ Node3D *EditorSceneImporterFBX::_generate_scene(
print_verbose("populating skeleton with bone: " + bone->bone_name);
- // // populate bone skeleton - since fbx has no DOM for the skeleton just a node.
- // bone->bone_skeleton = fbx_skeleton_inst;
+ //// populate bone skeleton - since fbx has no DOM for the skeleton just a node.
+ //bone->bone_skeleton = fbx_skeleton_inst;
// now populate bone on the armature node list
fbx_skeleton_inst->skeleton_bones.push_back(bone);
@@ -688,8 +687,8 @@ Node3D *EditorSceneImporterFBX::_generate_scene(
//
// Get Mesh Node Xform only
//
- // ERR_CONTINUE_MSG(!state.fbx_target_map.has(mesh_id), "invalid xform for the skin pose: " + itos(mesh_id));
- // Ref<FBXNode> mesh_node_xform_data = state.fbx_target_map[mesh_id];
+ //ERR_CONTINUE_MSG(!state.fbx_target_map.has(mesh_id), "invalid xform for the skin pose: " + itos(mesh_id));
+ //Ref<FBXNode> mesh_node_xform_data = state.fbx_target_map[mesh_id];
if (!mesh_skin) {
continue; // not a deformer.