Remove redundant blender:: from Vector, Map etc.
In rB96d6571073d3, `namespace blender` was added.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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++) {
|
||||
|
@@ -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.
|
||||
*/
|
||||
|
@@ -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(
|
||||
|
@@ -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.
|
||||
|
@@ -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::write_vert_normal_indices(blender::Vector<uint> &vert_indices,
|
||||
}
|
||||
|
||||
/** Write one line of polygon indices as f v1/vt1 v2/vt2 .... */
|
||||
void OBJWriter::write_vert_uv_indices(blender::Vector<uint> &vert_indices,
|
||||
blender::Vector<uint> &uv_indices,
|
||||
void OBJWriter::write_vert_uv_indices(Vector<uint> &vert_indices,
|
||||
Vector<uint> &uv_indices,
|
||||
const MPoly &poly_to_write)
|
||||
{
|
||||
fprintf(_outfile, "f ");
|
||||
@@ -80,7 +80,7 @@ void OBJWriter::write_vert_uv_indices(blender::Vector<uint> &vert_indices,
|
||||
}
|
||||
|
||||
/** Write one line of polygon indices as f v1 v2 .... */
|
||||
void OBJWriter::write_vert_indices(blender::Vector<uint> &vert_indices, const MPoly &poly_to_write)
|
||||
void OBJWriter::write_vert_indices(Vector<uint> &vert_indices, const MPoly &poly_to_write)
|
||||
{
|
||||
fprintf(_outfile, "f ");
|
||||
for (int j = 0; j < poly_to_write.totloop; j++) {
|
||||
@@ -143,10 +143,9 @@ void OBJWriter::write_vertex_coords(OBJMesh &obj_mesh_data)
|
||||
/** Write UV vertex coordinates for all vertices as vt u v
|
||||
* \note UV indices are stored here, but written later.
|
||||
*/
|
||||
void OBJWriter::write_uv_coords(OBJMesh &obj_mesh_data,
|
||||
blender::Vector<blender::Vector<uint>> &uv_indices)
|
||||
void OBJWriter::write_uv_coords(OBJMesh &obj_mesh_data, Vector<Vector<uint>> &uv_indices)
|
||||
{
|
||||
blender::Vector<std::array<float, 2>> uv_coords;
|
||||
Vector<std::array<float, 2>> uv_coords;
|
||||
|
||||
obj_mesh_data.store_uv_coords_and_indices(uv_coords, uv_indices);
|
||||
for (uint i = 0; i < uv_coords.size(); i++) {
|
||||
@@ -181,11 +180,10 @@ void OBJWriter::write_usemtl(OBJMesh &obj_mesh_data)
|
||||
* and face normal indices.
|
||||
* \note UV indices are stored while writing UV vertices.
|
||||
*/
|
||||
void OBJWriter::write_poly_indices(OBJMesh &obj_mesh_data,
|
||||
blender::Vector<blender::Vector<uint>> &uv_indices)
|
||||
void OBJWriter::write_poly_indices(OBJMesh &obj_mesh_data, Vector<Vector<uint>> &uv_indices)
|
||||
{
|
||||
blender::Vector<uint> vertex_indices;
|
||||
blender::Vector<uint> normal_indices;
|
||||
Vector<uint> vertex_indices;
|
||||
Vector<uint> normal_indices;
|
||||
|
||||
if (_export_params->export_normals) {
|
||||
if (_export_params->export_uv) {
|
||||
|
@@ -68,7 +68,7 @@ class OBJWriter {
|
||||
/** Write UV vertex coordinates for all vertices as vt u v
|
||||
* \note UV indices are stored here, but written later.
|
||||
*/
|
||||
void write_uv_coords(OBJMesh &obj_mesh_data, blender::Vector<blender::Vector<uint>> &uv_indices);
|
||||
void write_uv_coords(OBJMesh &obj_mesh_data, Vector<Vector<uint>> &uv_indices);
|
||||
/** Write face normals for all polygons as vn x y z */
|
||||
void write_poly_normals(OBJMesh &obj_mesh_data);
|
||||
/** Write name of an object's active material in the OBJ file.
|
||||
@@ -78,8 +78,7 @@ class OBJWriter {
|
||||
/** Define and write a face with at least vertex indices, and conditionally with UV vertex
|
||||
* indices and face normal indices. \note UV indices are stored while writing UV vertices.
|
||||
*/
|
||||
void write_poly_indices(OBJMesh &obj_mesh_data,
|
||||
blender::Vector<blender::Vector<uint>> &uv_indices);
|
||||
void write_poly_indices(OBJMesh &obj_mesh_data, Vector<Vector<uint>> &uv_indices);
|
||||
|
||||
/** Define and write an edge of a curve converted to mesh or a primitive circle as l v1 v2 */
|
||||
void write_curve_edges(OBJMesh &obj_mesh_data);
|
||||
@@ -96,19 +95,19 @@ class OBJWriter {
|
||||
uint _index_offset[3] = {0, 0, 0};
|
||||
|
||||
/** Write one line of polygon indices as f v1 v2 .... */
|
||||
void write_vert_indices(blender::Vector<uint> &vert_indices, const MPoly &poly_to_write);
|
||||
void write_vert_indices(Vector<uint> &vert_indices, const MPoly &poly_to_write);
|
||||
/** Write one line of polygon indices as f v1//vn1 v2//vn2 .... */
|
||||
void write_vert_normal_indices(blender::Vector<uint> &vert_indices,
|
||||
blender::Vector<uint> &normal_indices,
|
||||
void write_vert_normal_indices(Vector<uint> &vert_indices,
|
||||
Vector<uint> &normal_indices,
|
||||
const MPoly &poly_to_write);
|
||||
/** Write one line of polygon indices as f v1/vt1 v2/vt2 .... */
|
||||
void write_vert_uv_indices(blender::Vector<uint> &vert_indices,
|
||||
blender::Vector<uint> &uv_indices,
|
||||
void write_vert_uv_indices(Vector<uint> &vert_indices,
|
||||
Vector<uint> &uv_indices,
|
||||
const MPoly &poly_to_write);
|
||||
/** Write one line of polygon indices as f v1/vt1/vn1 v2/vt2/vn2 .... */
|
||||
void write_vert_uv_normal_indices(blender::Vector<uint> &vert_indices,
|
||||
blender::Vector<uint> &uv_indices,
|
||||
blender::Vector<uint> &normal_indices,
|
||||
void write_vert_uv_normal_indices(Vector<uint> &vert_indices,
|
||||
Vector<uint> &uv_indices,
|
||||
Vector<uint> &normal_indices,
|
||||
const MPoly &poly_to_write);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user