[Bf-blender-cvs] [eadc23273e8] soc-2020-io-performance: Remove redundant blender:: from Vector, Map etc.
Ankit Meel
noreply at git.blender.org
Sat Jun 27 21:40:45 CEST 2020
Commit: eadc23273e8953ffcd8dada40385ce7cda3cb206
Author: Ankit Meel
Date: Sun Jun 28 01:10:37 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rBeadc23273e8953ffcd8dada40385ce7cda3cb206
Remove redundant blender:: from Vector, Map etc.
In rB96d6571073d3, `namespace blender` was added.
===================================================================
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh
M source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc
M source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.hh
===================================================================
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc
index fb632f0b6bc..6c4c7ec9ec4 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc
@@ -49,8 +49,8 @@ namespace obj {
*/
static void export_frame(bContext *C, const OBJExportParams *export_params, const char *filepath)
{
- blender::Vector<OBJMesh> exportable_meshes;
- blender::Vector<OBJNurbs> exportable_nurbs;
+ Vector<OBJMesh> exportable_meshes;
+ Vector<OBJNurbs> exportable_nurbs;
ViewLayer *view_layer = CTX_data_view_layer(C);
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
Object *object_in_layer = base->object;
@@ -104,7 +104,7 @@ static void export_frame(bContext *C, const OBJExportParams *export_params, cons
frame_writer.write_curve_edges(mesh_to_export);
}
else {
- blender::Vector<blender::Vector<uint>> uv_indices;
+ Vector<Vector<uint>> uv_indices;
if (export_params->export_normals) {
frame_writer.write_poly_normals(mesh_to_export);
}
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc
index c2c662b3f23..37a5ce84199 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.cc
@@ -143,8 +143,7 @@ void OBJMesh::calc_vertex_coords(float r_coords[3], uint point_index)
/**
* Calculate vertex indices of all vertices of a polygon.
*/
-void OBJMesh::calc_poly_vertex_indices(blender::Vector<uint> &r_poly_vertex_indices,
- uint poly_index)
+void OBJMesh::calc_poly_vertex_indices(Vector<uint> &r_poly_vertex_indices, uint poly_index)
{
const MPoly &mpoly = _export_mesh_eval->mpoly[poly_index];
const MLoop *mloop = &_export_mesh_eval->mloop[mpoly.loopstart];
@@ -157,8 +156,8 @@ void OBJMesh::calc_poly_vertex_indices(blender::Vector<uint> &r_poly_vertex_indi
/**
* Store UV vertex coordinates as well as their indices.
*/
-void OBJMesh::store_uv_coords_and_indices(blender::Vector<std::array<float, 2>> &r_uv_coords,
- blender::Vector<blender::Vector<uint>> &r_uv_indices)
+void OBJMesh::store_uv_coords_and_indices(Vector<std::array<float, 2>> &r_uv_coords,
+ Vector<Vector<uint>> &r_uv_indices)
{
const MPoly *mpoly = _export_mesh_eval->mpoly;
const MLoop *mloop = _export_mesh_eval->mloop;
@@ -236,7 +235,7 @@ void OBJMesh::get_material_name(const char **r_mat_name)
/**
* Calculate face normal indices of all polygons.
*/
-void OBJMesh::calc_poly_normal_indices(blender::Vector<uint> &r_normal_indices, uint poly_index)
+void OBJMesh::calc_poly_normal_indices(Vector<uint> &r_normal_indices, uint poly_index)
{
r_normal_indices.resize(_export_mesh_eval->mpoly[poly_index].totloop);
for (uint i = 0; i < r_normal_indices.size(); i++) {
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh
index e5fcdcba549..580c213462d 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mesh.hh
@@ -106,12 +106,12 @@ class OBJMesh {
/**
* Calculate vertex indices of all vertices of a polygon.
*/
- void calc_poly_vertex_indices(blender::Vector<uint> &poly_vertex_indices, uint poly_index);
+ void calc_poly_vertex_indices(Vector<uint> &poly_vertex_indices, uint poly_index);
/**
* Store UV vertex coordinates as well as their indices.
*/
- void store_uv_coords_and_indices(blender::Vector<std::array<float, 2>> &uv_coords,
- blender::Vector<blender::Vector<uint>> &uv_indices);
+ void store_uv_coords_and_indices(Vector<std::array<float, 2>> &uv_coords,
+ Vector<Vector<uint>> &uv_indices);
/**
* Calculate face normal of the polygon at given index.
*/
@@ -119,7 +119,7 @@ class OBJMesh {
/**
* Calculate face normal indices of all polygons.
*/
- void calc_poly_normal_indices(blender::Vector<uint> &normal_indices, uint poly_indices);
+ void calc_poly_normal_indices(Vector<uint> &normal_indices, uint poly_indices);
/**
* Only for curve converted to meshes: calculate vertex indices of one edge.
*/
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
index aa99cc0ed59..31a680cd88f 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
@@ -111,11 +111,10 @@ void MTLWriter::float3_property_from_node(float *r_property,
/**
* Collect all the source sockets linked to the destination socket in a destination node.
*/
-void MTLWriter::linked_sockets_to_dest_id(
- blender::Vector<const OutputSocketRef *> *r_linked_sockets,
- const bNode *dest_node,
- NodeTreeRef &node_tree,
- const char *dest_socket_id)
+void MTLWriter::linked_sockets_to_dest_id(Vector<const OutputSocketRef *> *r_linked_sockets,
+ const bNode *dest_node,
+ NodeTreeRef &node_tree,
+ const char *dest_socket_id)
{
if (!dest_node) {
return;
@@ -141,8 +140,8 @@ void MTLWriter::linked_sockets_to_dest_id(
/**
* From a list of sockets, get the parent node which is of the given node type.
*/
-const bNode *MTLWriter::linked_node_of_type(
- const blender::Vector<const OutputSocketRef *> &sockets_list, uint sh_node_type)
+const bNode *MTLWriter::linked_node_of_type(const Vector<const OutputSocketRef *> &sockets_list,
+ uint sh_node_type)
{
for (const SocketRef *sock : sockets_list) {
const bNode *curr_node = sock->bnode();
@@ -236,7 +235,7 @@ void MTLWriter::append_material(OBJMesh &mesh_to_export)
fprintf(_mtl_outfile, "illum %d\n", illum);
/* Image Textures. */
- blender::Map<const char *, const char *> texture_map_types;
+ Map<const char *, const char *> texture_map_types;
texture_map_types.add("map_Kd", "Base Color");
texture_map_types.add("map_Ks", "Specular");
texture_map_types.add("map_Ns", "Roughness");
@@ -255,7 +254,7 @@ void MTLWriter::append_material(OBJMesh &mesh_to_export)
* compared to looping over all links in the node tree to match with two sockets of our interest.
*/
NodeTreeRef node_tree(_export_mtl->nodetree);
- blender::Vector<const OutputSocketRef *> linked_sockets;
+ Vector<const OutputSocketRef *> linked_sockets;
for (auto const &map_type : texture_map_types.keys()) {
/* Find sockets linked to destination socket of interest in p-bsdf node. */
linked_sockets_to_dest_id(
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh
index dc3593a5dcd..3a0bdaa210e 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.hh
@@ -67,7 +67,7 @@ class MTLWriter {
/**
* Collect all the source sockets linked to the destination socket in a destination node.
*/
- void linked_sockets_to_dest_id(blender::Vector<const BKE::OutputSocketRef *> *r_linked_sockets,
+ void linked_sockets_to_dest_id(Vector<const BKE::OutputSocketRef *> *r_linked_sockets,
const bNode *dest_node,
BKE::NodeTreeRef &node_tree,
const char *dest_socket_id);
@@ -75,8 +75,8 @@ class MTLWriter {
/**
* From a list of sockets, get the parent node which is of the given node type.
*/
- const bNode *linked_node_of_type(
- const blender::Vector<const BKE::OutputSocketRef *> &sockets_list, uint sh_node_type);
+ const bNode *linked_node_of_type(const Vector<const BKE::OutputSocketRef *> &sockets_list,
+ uint sh_node_type);
/**
* From a texture image shader node, get the image's filepath.
* Filepath is the exact string the node contains, relative or absolute.
diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc
index 57c180f4ff4..5df4e4645ba 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_file_handler.cc
@@ -33,9 +33,9 @@ namespace io {
namespace obj {
/** Write one line of polygon indices as f v1/vt1/vn1 v2/vt2/vn2 .... */
-void OBJWriter::write_vert_uv_normal_indices(blender::Vector<uint> &vert_indices,
- blender::Vector<uint> &uv_indices,
- blender::Vector<uint> &normal_indices,
+void OBJWriter::write_vert_uv_normal_indices(Vector<uint> &vert_indices,
+ Vector<uint> &uv_indices,
+ Vector<uint> &normal_indices,
const MPoly &poly_to_write)
{
fprintf(_outfile, "f ");
@@ -50,8 +50,8 @@ void OBJWriter::write_vert_uv_normal_indices(blender::Vector<uint> &vert_indices
}
/** Write one line of polygon indices as f v1//vn1 v2//vn2 .... */
-void OBJWriter::write_vert_normal_indices(blender::Vector<uint> &vert_indices,
- blender::Vector<uint> &normal_indices,
+void OBJWriter::write_vert_normal_indices(Vector<uint> &vert_indices,
+ Vector<uint> &normal_indices,
const MPoly &poly_to_write)
{
fprintf(_outfile, "f ");
@@ -65,8 +65,8 @@ void OBJWriter::writ
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list