Blender Git Loki

Blender Git "soc-2020-io-performance" branch commits.

Page: 21 / 23

June 27, 2020, 13:12 (GMT)
Merge branch 'master' into soc-2020-io-performance
June 27, 2020, 13:06 (GMT)
Add support for exporting Material Library file

**Why not reuse the `write_mtl` in `export_obj.py` ?**
Because there are no benefits except saving some time now, only to later
waste it in debugging or extending it.
Having it in C++ provides easy extensibility when we need to
add more nodes' support without having to modify node_utils.py, which
itself is a hardcoded wrapper for BSDF and normal map shader nodes.

Quick Summary:
If export_params->export_materials is true, we create an empty MTL file
with the same name (not extension, of course) in the same directory.
`frame_writer` writes its name (with extension) to the OBJ file, to
reference it, as per format specs.

MTLWriter class is added in the new files. It uses NodeTreeRef committed
recently in rBe1cc9aa7f281 for a faster way to find two linked sockets.

`frame_writer` instantiates an MTLWriter for an object which then
*appends* that object's material to the previously created MTL file.
Revision 6c98925 by Ankit Meel (soc-2020-io-performance)
June 25, 2020, 16:03 (GMT)
Refactor: create separate files for mesh & nurbs.

`*exporter_nurbs.{cc/hh}` have been added for OBJNurbs.
`*exporter_mesh.{cc/hh}` have been added for OBJMesh.

Header file cleanup in other files.
June 25, 2020, 12:24 (GMT)
Merge branch 'master' into soc-2020-io-performance
June 24, 2020, 13:59 (GMT)
Cleanup: clang-format.
June 24, 2020, 12:43 (GMT)
Fix repeated UV vertices and their indices

`append`'s usage causes `export_mesh_eval->totloop` many UV vertices
being written to the OBJ file. There are duplicates in that list.

So _tot_uv_vertices is being used to track the unique ones.
June 24, 2020, 10:08 (GMT)
Add support for exporting nurbs curves & surfaces

Added functionality in OBJNurbs & OBJWriter to export nurbs curve, not
as vertices and edges, but rather control points.

Nurbs surfaces are always converted to mesh and then exported as a
regular mesh with vertices, normals, UV (if it has any), and edges
(if it has no polygons) etc.
June 23, 2020, 21:30 (GMT)
Add support for curves to be exported as nurbs
June 23, 2020, 18:58 (GMT)
Review update: move more things to private access

Review as per D8089:

Add constructors and destructors for both OBJWriter and OBJMesh classes

Move more variables to private and access the required via getters.

Remove unnecessary variables.

Rename ob_mesh to export_mesh_data.
June 22, 2020, 19:01 (GMT)
Add support for curves to be exported as meshes.

An option in the exporter UI is added for exporting curves as NURBS.
But it doesn't do anything. All curves are exported as a mesh with
vertex coordinates and edges indexing into those coords.

The code duplication is obvious, it will be refactored to be reused
and with keeping object oriented style in mind.
June 22, 2020, 19:01 (GMT)
Optimisation: reserve memory early; use UNLIKELY

Since we know the minimum number of UV vertices that a mesh can have,
its memory is reserved in advance. `append` later in the loop simply
checks whether there's sufficient space and edits the vector.

Also, in the edge writer, the last iteration is very unlikely :).
June 22, 2020, 19:01 (GMT)
Remove unused comments.
June 22, 2020, 19:01 (GMT)
Renaming: Specify mesh objects instead of object

No functional change is there.

This change is required to distinguish mesh objects from curve objects.
Both of them have different requirements for the structs they'd use to
store their processed data.
So instead of adding if-else everywhere, curves and meshes can be
separated into different files.
June 22, 2020, 19:01 (GMT)
Use blender::Vector and Array instead of std

The equivalent functions have also been replaced:
`back()` -> `last()`
`push_back()` -> `append()`
June 22, 2020, 19:01 (GMT)
Refactor: arrange the code in OOP style.

The OBJWriter class' one instance writes to one file.
All OBJWriter handles is writing to the file after calling functions
of OBJMesh which collect the required data.

OBJNurbs and OBJMaterial will be added soon too.
June 22, 2020, 19:01 (GMT)
Review update: Renaming, comments, minor refactor

Review update for comments in D7959. No new feature has been added.
Changes here:

Use PIL_time.h instead of chrono. Use BLI_path_util.h instead of stdio.

Remove redundant `_to_export` suffix from some variables.

Clarify that `object_to_export` is `ob_mesh` to distinguish it from
curves objects later on.

Edited comments.

Change in face normal calculation in one loop instead of three for the
three axes components.

Add const where required.

Not hardcode Blender version but use `BKE_blender_version_string()`.

Add filenames to error messages in file opening.
June 22, 2020, 18:58 (GMT)
Merge branch 'master' into soc-2020-io-performance
June 22, 2020, 08:15 (GMT)
Merge branch 'master' into soc-2020-io-performance
June 18, 2020, 08:19 (GMT)
Merge branch 'master' into soc-2020-io-performance
June 18, 2020, 08:15 (GMT)
Export triangulated mesh, not modifying the scene

Add UI checkbox for triangulating before writing the OBJ file.
The scene is not modified at all. Actual modifier should be used if one
needs the mesh to be modified too.

The settings for triangulation are the same as default ones of the
modifier:
ngon-method: "Beauty", quad-method: "Shortest Diagonal", min vertices:4
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021