diff options
Diffstat (limited to 'source/blender/io')
17 files changed, 72 insertions, 81 deletions
diff --git a/source/blender/io/alembic/intern/abc_util.h b/source/blender/io/alembic/intern/abc_util.h index 3a0b2852eea..672494e80db 100644 --- a/source/blender/io/alembic/intern/abc_util.h +++ b/source/blender/io/alembic/intern/abc_util.h @@ -51,7 +51,7 @@ Imath::M44d convert_matrix_datatype(float mat[4][4]); /* Convert from Alembic to float matrix representations. Does NOT convert from Y-up to Z-up. */ void convert_matrix_datatype(const Imath::M44d &xform, float r_mat[4][4]); -void split(const std::string &s, const char delim, std::vector<std::string> &tokens); +void split(const std::string &s, char delim, std::vector<std::string> &tokens); template<class TContainer> bool begins_with(const TContainer &input, const TContainer &match) { diff --git a/source/blender/io/collada/AnimationImporter.h b/source/blender/io/collada/AnimationImporter.h index a4624a18cd5..909a3017e66 100644 --- a/source/blender/io/collada/AnimationImporter.h +++ b/source/blender/io/collada/AnimationImporter.h @@ -211,7 +211,7 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase */ void Assign_lens_animations(const COLLADAFW::UniqueId &listid, ListBase *AnimCurves, - const double aspect, + double aspect, Camera *cam, const char *anim_type, int fov_type); diff --git a/source/blender/io/collada/ArmatureImporter.h b/source/blender/io/collada/ArmatureImporter.h index ea78efeb5d7..fc0333b0ab1 100644 --- a/source/blender/io/collada/ArmatureImporter.h +++ b/source/blender/io/collada/ArmatureImporter.h @@ -120,7 +120,7 @@ class ArmatureImporter : private TransformReader { void fix_leaf_bone_hierarchy(bArmature *armature, Bone *bone, bool fix_orientation); void fix_leaf_bone(bArmature *armature, EditBone *ebone, BoneExtended *be, bool fix_orientation); void fix_parent_connect(bArmature *armature, Bone *bone); - void connect_bone_chains(bArmature *armature, Bone *bone, const int max_chain_length); + void connect_bone_chains(bArmature *armature, Bone *bone, int max_chain_length); void set_pose(Object *ob_arm, COLLADAFW::Node *root_node, diff --git a/source/blender/io/collada/BCAnimationCurve.h b/source/blender/io/collada/BCAnimationCurve.h index 36b2a5e8509..cf4cb4e0642 100644 --- a/source/blender/io/collada/BCAnimationCurve.h +++ b/source/blender/io/collada/BCAnimationCurve.h @@ -59,8 +59,8 @@ class BCCurveKey { BCCurveKey(); BCCurveKey(const BC_animation_type type, const std::string path, - const int array_index, - const int subindex = -1); + int array_index, + int subindex = -1); void operator=(const BCCurveKey &other); std::string get_full_path() const; std::string get_path() const; @@ -127,7 +127,7 @@ class BCAnimationCurve { FCurve *get_fcurve() const; int sample_count() const; - float get_value(const float frame); + float get_value(float frame); void get_values(BCValues &values) const; void get_value_map(BCValueMap &value_map); @@ -135,14 +135,14 @@ class BCAnimationCurve { /* Curve edit functions create a copy of the underlying #FCurve. */ FCurve *get_edit_fcurve(); - bool add_value_from_rna(const int frame); - bool add_value_from_matrix(const BCSample &sample, const int frame); - void add_value(const float val, const int frame); + bool add_value_from_rna(int frame); + bool add_value_from_matrix(const BCSample &sample, int frame); + void add_value(float val, int frame); void clean_handles(); /* experimental stuff */ - int closest_index_above(const float sample_frame, const int start_at) const; - int closest_index_below(const float sample_frame) const; + int closest_index_above(float sample_frame, int start_at) const; + int closest_index_below(float sample_frame) const; }; typedef std::map<BCCurveKey, BCAnimationCurve *> BCAnimationCurveMap; diff --git a/source/blender/io/collada/BCMath.h b/source/blender/io/collada/BCMath.h index 503a76541fd..dbcfe96bc61 100644 --- a/source/blender/io/collada/BCMath.h +++ b/source/blender/io/collada/BCMath.h @@ -82,25 +82,25 @@ class BCMatrix { * We need double here because the OpenCollada API needs it. * precision = -1 indicates to not limit the precision. */ - void get_matrix(DMatrix &matrix, const bool transposed = false, const int precision = -1) const; + void get_matrix(DMatrix &matrix, bool transposed = false, int precision = -1) const; void get_matrix(Matrix &matrix, - const bool transposed = false, - const int precision = -1, - const bool inverted = false) const; + bool transposed = false, + int precision = -1, + bool inverted = false) const; void set_transform(Object *ob); void set_transform(Matrix &mat); void add_transform(Matrix &to, const Matrix &transform, const Matrix &from, - const bool inverted = false); + bool inverted = false); void apply_transform(Matrix &to, const Matrix &transform, const Matrix &from, - const bool inverse = false); + bool inverse = false); void add_inverted_transform(Matrix &to, const Matrix &transform, const Matrix &from); - void add_transform(const Matrix &matrix, const bool inverted = false); - void add_transform(const BCMatrix &matrix, const bool inverted = false); - void apply_transform(const BCMatrix &matrix, const bool inverted = false); + void add_transform(const Matrix &matrix, bool inverted = false); + void add_transform(const BCMatrix &matrix, bool inverted = false); + void apply_transform(const BCMatrix &matrix, bool inverted = false); bool in_range(const BCMatrix &other, float distance) const; diff --git a/source/blender/io/collada/BCSampleData.h b/source/blender/io/collada/BCSampleData.h index dccc5228c4f..a76466a42f5 100644 --- a/source/blender/io/collada/BCSampleData.h +++ b/source/blender/io/collada/BCSampleData.h @@ -54,7 +54,7 @@ class BCSample { void add_bone_matrix(Bone *bone, Matrix &mat); /** Get channel value. */ - bool get_value(std::string channel_target, const int array_index, float *val) const; + bool get_value(std::string channel_target, int array_index, float *val) const; const BCMatrix &get_matrix() const; const BCMatrix *get_matrix(Bone *bone) const; /* returns NULL if bone is not animated */ }; diff --git a/source/blender/io/collada/collada_utils.h b/source/blender/io/collada/collada_utils.h index cf62ea0a275..e06f7b2cb8b 100644 --- a/source/blender/io/collada/collada_utils.h +++ b/source/blender/io/collada/collada_utils.h @@ -291,23 +291,23 @@ extern bool bc_has_animations(Object *ob); extern void bc_add_global_transform(Matrix &to_mat, const Matrix &from_mat, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); extern void bc_add_global_transform(Vector &to_vec, const Vector &from_vec, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); extern void bc_add_global_transform(Vector &to_vec, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); extern void bc_add_global_transform(Matrix &to_mat, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); extern void bc_apply_global_transform(Matrix &to_mat, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); extern void bc_apply_global_transform(Vector &to_vec, const BCMatrix &global_transform, - const bool invert = false); + bool invert = false); /** * Check if custom information about bind matrix exists and modify the from_mat * accordingly. @@ -382,7 +382,7 @@ class BoneExtended { void set_name(char *aName); char *get_name(); - void set_chain_length(const int aLength); + void set_chain_length(int aLength); int get_chain_length(); void set_leaf_bone(bool state); diff --git a/source/blender/io/common/IO_abstract_hierarchy_iterator.h b/source/blender/io/common/IO_abstract_hierarchy_iterator.h index 0bebc4384a9..e024b766c99 100644 --- a/source/blender/io/common/IO_abstract_hierarchy_iterator.h +++ b/source/blender/io/common/IO_abstract_hierarchy_iterator.h @@ -111,7 +111,7 @@ struct HierarchyContext { void mark_as_instance_of(const std::string &reference_export_path); void mark_as_not_instanced(); - bool is_object_visible(const enum eEvaluationMode evaluation_mode) const; + bool is_object_visible(enum eEvaluationMode evaluation_mode) const; }; /* Abstract writer for objects. Create concrete subclasses to write to USD, Alembic, etc. diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.hh b/source/blender/io/gpencil/intern/gpencil_io_base.hh index 6437796648d..09557cd7a4d 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_base.hh @@ -49,7 +49,7 @@ class GpencilIO { public: GpencilIO(const GpencilIOParams *iparams); - void frame_number_set(const int value); + void frame_number_set(int value); void prepare_camera_params(Scene *scene, const GpencilIOParams *iparams); protected: diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh index 18de321914c..5de22530fec 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.hh @@ -61,16 +61,13 @@ class GpencilExporterPDF : public GpencilExporter { * Export a stroke using poly-line or polygon * \param do_fill: True if the stroke is only fill */ - void export_stroke_to_polyline(bGPDlayer *gpl, - bGPDstroke *gps, - const bool is_stroke, - const bool do_fill, - const bool normalize); + void export_stroke_to_polyline( + bGPDlayer *gpl, bGPDstroke *gps, bool is_stroke, bool do_fill, bool normalize); /** * Set color. * \param do_fill: True if the stroke is only fill. */ - void color_set(bGPDlayer *gpl, const bool do_fill); + void color_set(bGPDlayer *gpl, bool do_fill); }; } // namespace blender::io::gpencil diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.hh b/source/blender/io/gpencil/intern/gpencil_io_export_svg.hh index b3175978072..8b88e9dc142 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.hh @@ -69,12 +69,8 @@ class GpencilExporterSVG : public GpencilExporter { * \param size: Size of the text * \param hexcolor: Color of the text */ - static void add_text(pugi::xml_node node, - float x, - float y, - std::string text, - const float size, - std::string hexcolor); + static void add_text( + pugi::xml_node node, float x, float y, std::string text, float size, std::string hexcolor); private: /** XML doc. */ @@ -96,7 +92,7 @@ class GpencilExporterSVG : public GpencilExporter { void export_stroke_to_path(struct bGPDlayer *gpl, struct bGPDstroke *gps, pugi::xml_node node_gpl, - const bool do_fill); + bool do_fill); /** * Export a stroke using poly-line or polygon @@ -106,8 +102,8 @@ class GpencilExporterSVG : public GpencilExporter { void export_stroke_to_polyline(struct bGPDlayer *gpl, struct bGPDstroke *gps, pugi::xml_node node_gpl, - const bool is_stroke, - const bool do_fill); + bool is_stroke, + bool do_fill); /** * Set color SVG string for stroke @@ -117,7 +113,7 @@ class GpencilExporterSVG : public GpencilExporter { void color_string_set(struct bGPDlayer *gpl, struct bGPDstroke *gps, pugi::xml_node node_gps, - const bool do_fill); + bool do_fill); /** Convert a color to Hex value (#FFFFFF). */ std::string rgb_to_hexstr(const float color[3]); diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_base.hh b/source/blender/io/gpencil/intern/gpencil_io_import_base.hh index 7d6fad2340b..31ded8234c8 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_base.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_import_base.hh @@ -33,7 +33,7 @@ class GpencilImporter : public GpencilIO { protected: struct Object *create_object(); - int32_t create_material(const char *name, const bool stroke, const bool fill); + int32_t create_material(const char *name, bool stroke, bool fill); private: }; diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.hh b/source/blender/io/gpencil/intern/gpencil_io_import_svg.hh index 99e8b1ed4fd..24e80563a14 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.hh +++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.hh @@ -47,10 +47,10 @@ class GpencilImporterSVG : public GpencilImporter { struct bGPDframe *gpf, struct NSVGshape *shape, struct NSVGpath *path, - const int32_t mat_index, + int32_t mat_index, const float matrix[4][4]); - void convert_color(const int32_t color, float r_linear_rgba[4]); + void convert_color(int32_t color, float r_linear_rgba[4]); }; } // namespace blender::io::gpencil diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh index c7ec7ec648f..3403d059068 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh @@ -91,22 +91,22 @@ class OBJWriter : NonMovable, NonCopyable { */ int write_smooth_group(const OBJMesh &obj_mesh_data, int poly_index, - const int last_poly_smooth_group) const; + int last_poly_smooth_group) const; /** * Write material name and material group of a polygon in the .OBJ file. * \return #mat_nr of the polygon at the given index. * \note It doesn't write to the material library. */ int16_t write_poly_material(const OBJMesh &obj_mesh_data, - const int poly_index, - const int16_t last_poly_mat_nr, + int poly_index, + int16_t last_poly_mat_nr, std::function<const char *(int)> matname_fn) const; /** * Write the name of the deform group of a polygon. */ int16_t write_vertex_group(const OBJMesh &obj_mesh_data, - const int poly_index, - const int16_t last_poly_vertex_group) const; + int poly_index, + int16_t last_poly_vertex_group) const; /** * Write polygon elements with at least vertex indices, and conditionally with UV vertex * indices and polygon normal indices. Also write groups: smooth, vertex, material. @@ -138,7 +138,7 @@ class OBJWriter : NonMovable, NonCopyable { /** * \return Writer function with appropriate polygon-element syntax. */ - func_vert_uv_normal_indices get_poly_element_writer(const int total_uv_vertices) const; + func_vert_uv_normal_indices get_poly_element_writer(int total_uv_vertices) const; /** * Write one line of polygon indices as "f v1/vt1/vn1 v2/vt2/vn2 ...". diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh index 5d9c08a288e..9a4dfe3efe3 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh @@ -106,12 +106,12 @@ class OBJMesh : NonCopyable { /** * Return mat_nr-th material of the object. The given index should be zero-based. */ - const Material *get_object_material(const int16_t mat_nr) const; + const Material *get_object_material(int16_t mat_nr) const; /** * Returns a zero-based index of a polygon's material indexing into * the Object's material slots. */ - int16_t ith_poly_matnr(const int poly_index) const; + int16_t ith_poly_matnr(int poly_index) const; void ensure_mesh_normals() const; void ensure_mesh_edges() const; @@ -120,12 +120,12 @@ class OBJMesh : NonCopyable { * Calculate smooth groups of a smooth-shaded object. * \return A polygon aligned array of smooth group numbers. */ - void calc_smooth_groups(const bool use_bitflags); + void calc_smooth_groups(bool use_bitflags); /** * \return Smooth group of the polygon at the given index. */ - int ith_smooth_group(const int poly_index) const; - bool is_ith_poly_smooth(const int poly_index) const; + int ith_smooth_group(int poly_index) const; + bool is_ith_poly_smooth(int poly_index) const; /** * Get object name as it appears in the outliner. @@ -138,42 +138,42 @@ class OBJMesh : NonCopyable { /** * Get object's material (at the given index) name. The given index should be zero-based. */ - const char *get_object_material_name(const int16_t mat_nr) const; + const char *get_object_material_name(int16_t mat_nr) const; /** * Calculate coordinates of the vertex at the given index. */ - float3 calc_vertex_coords(const int vert_index, const float scaling_factor) const; + float3 calc_vertex_coords(int vert_index, float scaling_factor) const; /** * Calculate vertex indices of all vertices of the polygon at the given index. */ - Vector<int> calc_poly_vertex_indices(const int poly_index) const; + Vector<int> calc_poly_vertex_indices(int poly_index) const; /** * Calculate UV vertex coordinates of an Object. * * \note Also store the UV vertex indices in the member variable. */ void store_uv_coords_and_indices(Vector<std::array<float, 2>> &r_uv_coords); - Span<int> calc_poly_uv_indices(const int poly_index) const; + Span<int> calc_poly_uv_indices(int poly_index) const; /** * Calculate polygon normal of a polygon at given index. * * Should be used for flat-shaded polygons. */ - float3 calc_poly_normal(const int poly_index) const; + float3 calc_poly_normal(int poly_index) const; /** * Calculate a polygon's polygon/loop normal indices. * \param object_tot_prev_normals Number of normals of this Object written so far. * \return Number of distinct normal indices. */ - std::pair<int, Vector<int>> calc_poly_normal_indices(const int poly_index, - const int object_tot_prev_normals) const; + std::pair<int, Vector<int>> calc_poly_normal_indices(int poly_index, + int object_tot_prev_normals) const; /** * Calculate loop normals of a polygon at the given index. * * Should be used for smooth-shaded polygons. */ - void calc_loop_normals(const int poly_index, Vector<float3> &r_loop_normals) const; + void calc_loop_normals(int poly_index, Vector<float3> &r_loop_normals) const; /** * Find the index of the vertex group with the maximum number of vertices in a polygon. * The index indices into the #Object.defbase. @@ -181,17 +181,17 @@ class OBJMesh : NonCopyable { * If two or more groups have the same number of vertices (maximum), group name depends on the * implementation of #std::max_element. */ - int16_t get_poly_deform_group_index(const int poly_index) const; + int16_t get_poly_deform_group_index(int poly_index) const; /** * Find the name of the vertex deform group at the given index. * The index indices into the #Object.defbase. */ - const char *get_poly_deform_group_name(const int16_t def_group_index) const; + const char *get_poly_deform_group_name(int16_t def_group_index) const; /** * Calculate vertex indices of an edge's corners if it is a loose edge. */ - std::optional<std::array<int, 2>> calc_loose_edge_vert_indices(const int edge_index) const; + std::optional<std::array<int, 2>> calc_loose_edge_vert_indices(int edge_index) const; private: /** @@ -208,6 +208,6 @@ class OBJMesh : NonCopyable { /** * Set the final transform after applying axes settings and an Object's world transform. */ - void set_world_axes_transform(const eTransformAxisForward forward, const eTransformAxisUp up); + void set_world_axes_transform(eTransformAxisForward forward, eTransformAxisUp up); }; } // namespace blender::io::obj diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh index fe457f3c1c7..0c71c3cc09d 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_nurbs.hh @@ -47,28 +47,26 @@ class OBJCurve : NonCopyable { * \param spline_index: Zero-based index of spline of interest. * \return: Total vertices in a spline. */ - int total_spline_vertices(const int spline_index) const; + int total_spline_vertices(int spline_index) const; /** * Get coordinates of the vertex at the given index on the given spline. */ - float3 vertex_coordinates(const int spline_index, - const int vertex_index, - const float scaling_factor) const; + float3 vertex_coordinates(int spline_index, int vertex_index, float scaling_factor) const; /** * Get total control points of the NURBS spline at the given index. This is different than total * vertices of a spline. */ - int total_spline_control_points(const int spline_index) const; + int total_spline_control_points(int spline_index) const; /** * Get the degree of the NURBS spline at the given index. */ - int get_nurbs_degree(const int spline_index) const; + int get_nurbs_degree(int spline_index) const; private: /** * Set the final transform after applying axes settings and an Object's world transform. */ - void set_world_axes_transform(const eTransformAxisForward forward, const eTransformAxisUp up); + void set_world_axes_transform(eTransformAxisForward forward, eTransformAxisUp up); }; } // namespace blender::io::obj diff --git a/source/blender/io/wavefront_obj/exporter/obj_exporter.hh b/source/blender/io/wavefront_obj/exporter/obj_exporter.hh index 1a193bf437f..a06898a21cf 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_exporter.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_exporter.hh @@ -38,7 +38,7 @@ class OBJDepsgraph : NonMovable, NonCopyable { bool needs_free_ = false; public: - OBJDepsgraph(const bContext *C, const eEvaluationMode eval_mode); + OBJDepsgraph(const bContext *C, eEvaluationMode eval_mode); ~OBJDepsgraph(); Depsgraph *get(); @@ -97,5 +97,5 @@ filter_supported_objects(Depsgraph *depsgraph, const OBJExportParams &export_par * * \return Whether the filepath is in #FILE_MAX limits. */ -bool append_frame_to_filename(const char *filepath, const int frame, char *r_filepath_with_frames); +bool append_frame_to_filename(const char *filepath, int frame, char *r_filepath_with_frames); } // namespace blender::io::obj |