summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/collada.h28
-rw-r--r--editor/import/editor_import_collada.cpp31
-rw-r--r--editor/import/editor_scene_importer_gltf.h22
-rw-r--r--editor/import/resource_importer_texture.h8
-rw-r--r--editor/import/resource_importer_texture_atlas.h2
5 files changed, 30 insertions, 61 deletions
diff --git a/editor/import/collada.h b/editor/import/collada.h
index 2f6db93dbc..3b6b508b28 100644
--- a/editor/import/collada.h
+++ b/editor/import/collada.h
@@ -128,7 +128,7 @@ public:
String name;
struct Source {
Vector<float> array;
- int stride;
+ int stride = 0;
};
Map<String, Source> sources;
@@ -142,15 +142,15 @@ public:
struct Primitives {
struct SourceRef {
String source;
- int offset;
+ int offset = 0;
};
String material;
Map<String, SourceRef> sources;
Vector<float> polygons;
Vector<float> indices;
- int count;
- int vertex_size;
+ int count = 0;
+ int vertex_size = 0;
};
Vector<Primitives> primitives;
@@ -168,7 +168,7 @@ public:
struct Source {
Vector<String> sarray;
Vector<float> array;
- int stride;
+ int stride = 0;
};
Map<String, Source> sources;
@@ -200,14 +200,14 @@ public:
struct Weights {
struct SourceRef {
String source;
- int offset;
+ int offset = 0;
};
String material;
Map<String, SourceRef> sources;
Vector<float> sets;
Vector<float> indices;
- int count;
+ int count = 0;
} weights;
Map<String, Transform> bone_rest_map;
@@ -242,8 +242,8 @@ public:
Color color;
int uid = 0;
struct Weight {
- int bone_idx;
- float weight;
+ int bone_idx = 0;
+ float weight = 0;
bool operator<(const Weight w) const { return weight > w.weight; } //heaviest first
};
@@ -331,7 +331,7 @@ public:
};
String id;
- Op op;
+ Op op = OP_ROTATE;
Vector<float> data;
};
@@ -375,7 +375,7 @@ public:
};
struct NodeGeometry : public Node {
- bool controller;
+ bool controller = false;
String source;
struct Material {
@@ -438,7 +438,7 @@ public:
TYPE_MATRIX
};
- float time;
+ float time = 0;
Vector<float> data;
Point2 in_tangent;
Point2 out_tangent;
@@ -463,10 +463,10 @@ public:
float unit_scale = 1.0;
Vector3::Axis up_axis = Vector3::AXIS_Y;
- bool z_up;
+ bool z_up = false;
struct Version {
- int major, minor, rev;
+ int major = 0, minor = 0, rev = 0;
bool operator<(const Version &p_ver) const { return (major == p_ver.major) ? ((minor == p_ver.minor) ? (rev < p_ver.rev) : minor < p_ver.minor) : major < p_ver.major; }
Version(int p_major = 0, int p_minor = 0, int p_rev = 0) {
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 12cbaaa885..37792f2c08 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -46,29 +46,24 @@
struct ColladaImport {
Collada collada;
- Node3D *scene;
+ Node3D *scene = nullptr;
Vector<Ref<Animation>> animations;
struct NodeMap {
//String path;
- Node3D *node;
- int bone;
+ Node3D *node = nullptr;
+ int bone = -1;
List<int> anim_tracks;
-
- NodeMap() {
- node = nullptr;
- bone = -1;
- }
};
- bool found_ambient;
+ bool found_ambient = false;
Color ambient;
- bool found_directional;
- bool force_make_tangents;
- bool apply_mesh_xform_to_vertices;
- bool use_mesh_builtin_materials;
- float bake_fps;
+ bool found_directional = false;
+ bool force_make_tangents = false;
+ bool apply_mesh_xform_to_vertices = true;
+ bool use_mesh_builtin_materials = false;
+ float bake_fps = 15;
Map<String, NodeMap> node_map; //map from collada node to engine node
Map<String, String> node_name_map; //map from collada node to engine node
@@ -98,14 +93,6 @@ struct ColladaImport {
Vector<String> missing_textures;
void _pre_process_lights(Collada::Node *p_node);
-
- ColladaImport() {
- found_ambient = false;
- found_directional = false;
- force_make_tangents = false;
- apply_mesh_xform_to_vertices = true;
- bake_fps = 15;
- }
};
Error ColladaImport::_populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) {
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
index bd30f8f1dd..5ea8bf17b8 100644
--- a/editor/import/editor_scene_importer_gltf.h
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -116,8 +116,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
GLTFNodeIndex fake_joint_parent = -1;
GLTFLightIndex light = -1;
-
- GLTFNode() {}
};
struct GLTFBufferView {
@@ -127,8 +125,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int byte_stride = 0;
bool indices = false;
//matrices need to be transformed to this
-
- GLTFBufferView() {}
};
struct GLTFAccessor {
@@ -137,7 +133,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int component_type = 0;
bool normalized = false;
int count = 0;
- GLTFType type;
+ GLTFType type = GLTFType::TYPE_SCALAR;
float min = 0;
float max = 0;
int sparse_count = 0;
@@ -146,8 +142,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
int sparse_indices_component_type = 0;
int sparse_values_buffer_view = 0;
int sparse_values_byte_offset = 0;
-
- GLTFAccessor() {}
};
struct GLTFTexture {
GLTFImageIndex src_image;
@@ -166,8 +160,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
// Set of unique bone names for the skeleton
Set<String> unique_names;
-
- GLTFSkeleton() {}
};
struct GLTFSkin {
@@ -204,8 +196,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
// The Actual Skin that will be created as a mapping between the IBM's of this skin
// to the generated skeleton for the mesh instances.
Ref<Skin> godot_skin;
-
- GLTFSkin() {}
};
struct GLTFMesh {
@@ -218,8 +208,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
float fov_size = 64;
float zfar = 500;
float znear = 0.1;
-
- GLTFCamera() {}
};
struct GLTFLight {
@@ -229,8 +217,6 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
float range = Math_INF;
float inner_cone_angle = 0.0f;
float outer_cone_angle = Math_PI / 4.0;
-
- GLTFLight() {}
};
struct GLTFAnimation {
@@ -264,11 +250,11 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
struct GLTFState {
Dictionary json;
- int major_version;
- int minor_version;
+ int major_version = 0;
+ int minor_version = 0;
Vector<uint8_t> glb_data;
- bool use_named_skin_binds;
+ bool use_named_skin_binds = false;
Vector<GLTFNode *> nodes;
Vector<Vector<uint8_t>> buffers;
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index 97c4622731..39036d4423 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -60,13 +60,9 @@ protected:
Mutex mutex;
struct MakeInfo {
- int flags;
+ int flags = 0;
String normal_path_for_roughness;
- RS::TextureDetectRoughnessChannel channel_for_roughness;
- MakeInfo() {
- flags = 0;
- channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
- }
+ RS::TextureDetectRoughnessChannel channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
};
Map<StringName, MakeInfo> make_flags;
diff --git a/editor/import/resource_importer_texture_atlas.h b/editor/import/resource_importer_texture_atlas.h
index 9d973c3d8d..d237b096d3 100644
--- a/editor/import/resource_importer_texture_atlas.h
+++ b/editor/import/resource_importer_texture_atlas.h
@@ -38,7 +38,7 @@ class ResourceImporterTextureAtlas : public ResourceImporter {
struct PackData {
Rect2 region;
- bool is_mesh;
+ bool is_mesh = false;
Vector<int> chart_pieces; //one for region, many for mesh
Vector<Vector<Vector2>> chart_vertices; //for mesh
Ref<Image> image;