Page MenuHome

Import/ExportProject
ActivePublic

Members

  • This project does not have any members.
  • View All

Details

Description

Import and export of data from and to external file formats.

Developers

Scripts: @Campbell Barton (campbellbarton)
COLLADA: @Gaia Clary (gaiaclary) @Nathan Letwory (jesterking) @Jeroen Bakker (jbakker)

Recent Activity

Today

Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Updated diff
https://developer.blender.org/D14941

Sat, May 21, 12:48 AM · Pipeline, Assets & I/O, Import/Export, BF Blender

Yesterday

Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Done!, it worked pretty well, all objects passed tris/edges/verts count test and that mesh.validate returned false (tris/edges/verts count was compared before mesh validate ofc)

Fri, May 20, 11:13 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated subscribers of T97882: Native STL IO.

Currently I'm trying to avoid mesh validate, it was needed because I found some stl files that contained duplicated triangles that have different vertex order (yep double checked it)
so I need to implement a structure with commutitave hash and equality as suggested by @Jacques Lucke (JacquesLucke)

Fri, May 20, 10:27 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Revision updated
Most notable changes

Fri, May 20, 9:05 PM · Pipeline, Assets & I/O, Import/Export, BF Blender

Thu, May 19

Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Thu, May 19, 2:59 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Updated revision D14941

Thu, May 19, 2:59 PM · Pipeline, Assets & I/O, Import/Export, BF Blender

Tue, May 17

Hans Goudey (HooglyBoogly) added a project to T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes: Geometry Nodes.
Tue, May 17, 9:18 AM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender

Mon, May 16

Bastien Montagne (mont29) moved T68936: Faster I/O for OBJ, PLY, STL: Design from Blender 3.2 to Blender 3.3 on the Pipeline, Assets & I/O board.
Mon, May 16, 3:55 PM · BF Blender (3.3), Restricted Project, Pipeline, Assets & I/O, Import/Export

Sat, May 14

Scurest (scurest) added a comment to T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.

This is what the Python OBJ exporter does to get the materials

Sat, May 14, 12:28 AM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender

Fri, May 13

Ankit Meel (ankitm) removed a watcher for Import/Export: Ankit Meel (ankitm).
Fri, May 13, 6:03 PM
Bastien Montagne (mont29) updated the task description for T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.
Fri, May 13, 5:35 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Bastien Montagne (mont29) added a comment to T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.

I am not sure yet, I would hope that doing that on evaluated objects should give you the 'final' list of materials... But this needs to be investigated. Also need to check OBJ to understand why it's working there.

Fri, May 13, 5:34 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Scurest (scurest) added a comment to T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.

So what's the correct way to fetch materials now? The old way was to read ob.material_slots[n].material.

Fri, May 13, 4:22 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Bastien Montagne (mont29) moved T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes from Backlog to Long-Term - Official on the Pipeline, Assets & I/O board.
Fri, May 13, 3:28 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Bastien Montagne (mont29) updated the task description for T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.
Fri, May 13, 3:28 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Bastien Montagne (mont29) renamed T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes from Apply modifier on export breaks geonodes materials to Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.
Fri, May 13, 3:25 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Bastien Montagne (mont29) triaged T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes as Low priority.

Materials have always been handled as 'fixed' info available from the object/obdata, they were never really 'editable' by the modifier stack, at least not beyond re-assigning different material indices (i.e. shuffling around assignment of materials defined 'statically' in the object's material slots.

Fri, May 13, 3:16 PM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender

Thu, May 12

Aras Pranckevicius (aras_p) closed D14936: OBJ: improve new importer file parsing performance on windows.
Thu, May 12, 12:50 PM · Import/Export, Pipeline, Assets & I/O, BF Blender
Howard Trickey (howardt) accepted D14936: OBJ: improve new importer file parsing performance on windows.

Those speedups are definitely worth this change.

Thu, May 12, 12:18 PM · Import/Export, Pipeline, Assets & I/O, BF Blender
Aras Pranckevicius (aras_p) retitled D14936: OBJ: improve new importer file parsing performance on windows from OBJ: improve new importer file parsing performance to OBJ: improve new importer file parsing performance on windows.
Thu, May 12, 12:01 PM · Import/Export, Pipeline, Assets & I/O, BF Blender

Wed, May 11

Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Ok will make a revision asap

Wed, May 11, 9:46 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Ankit Meel (ankitm) added a comment to T97882: Native STL IO.

@Iyad Ahmed (iyadahmed2001) Creating and uploading diffs seems cumbersome.
You can keep updating a revision or even better maintain a branch in your own blender fork. (gitlab/ github)

Wed, May 11, 7:01 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Wed, May 11, 6:34 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Current progress,
new stuff:

  • Moved mesh validation to main importer function (outside the binary importer)
  • Base filename is now used as object and mesh name
Wed, May 11, 6:33 PM · Pipeline, Assets & I/O, Import/Export, BF Blender

Tue, May 10

Aras Pranckevicius (aras_p) closed T96399: Regression: New 3.1 OBJ exporter is missing Path Mode setting as Resolved by committing rB3bc037a7eb8d: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 6:00 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) closed D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 6:00 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) added inline comments to D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 1:40 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Howard Trickey (howardt) accepted D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.

I made a couple of comments which you can answer/address, but then you can commit this.

Tue, May 10, 1:19 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Ok I see now

Tue, May 10, 12:42 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) added a task to D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting: T96399: Regression: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 10:41 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) added a revision to T96399: Regression: New 3.1 OBJ exporter is missing Path Mode setting: D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 10:41 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) requested review of D14906: Fix T96399: New 3.1 OBJ exporter is missing Path Mode setting.
Tue, May 10, 10:41 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) added a comment to T97882: Native STL IO.

@Aras Pranckevicius (aras_p) btw why where string utils moved back to obj importer?
No worries I will move it back to io common when I get to the ascii importer

Tue, May 10, 8:25 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Tue, May 10, 6:44 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

@Aras Pranckevicius (aras_p) btw why where string utils moved back to obj importer?

Tue, May 10, 6:41 AM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Tue, May 10, 6:35 AM · Pipeline, Assets & I/O, Import/Export, BF Blender

Mon, May 9

Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Did a profile, BKE_mesh_validate is at the top, I should make validating mesh optional, just like the obj importer

Mon, May 9, 3:31 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Dalai Felinto (dfelinto) updated the task description for T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes.
Mon, May 9, 11:24 AM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender
Dalai Felinto (dfelinto) changed the subtype of T96721: Exporters (add-ons and compiled) need to be updated to support new fully dynamic material assignment possible from Geometry Nodes from "Report" to "Bug".

I can reproduce the bug and it also happens with GLTF2.

Mon, May 9, 11:23 AM · Geometry Nodes, Collada, USD, Alembic, Add-ons (Community), Add-ons (BF-Blender), Pipeline, Assets & I/O, Nodes & Physics, Import/Export, BF Blender

Sat, May 7

Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Resrving memory for the map used to merge duplicated vertices helped reduce time further,
The plan now is to profile and use this script instead of a one time import: https://devtalk.blender.org/t/native-stl-importer/22428/2
I may also modify the script to compare number of verts/tris/edges

Sat, May 7, 11:56 AM · Pipeline, Assets & I/O, Import/Export, BF Blender

Fri, May 6

Julian Eisel (Severin) closed T97751: New OBJ import: fileselector doesn't filter *.obj but shows all model-like files as Resolved by committing rBaae2ff49f5b8: Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtl.
Fri, May 6, 11:05 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Current progress

Fri, May 6, 7:26 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

will upload diff asap so we can see current state

Fri, May 6, 7:21 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Fri, May 6, 7:20 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Binary importer first results!
New importer ~1.6 sec
Old importer ~3.5 sec
File:

Fri, May 6, 7:18 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

here's the current definition of the Mesh data structure wrapper, as you can see, it makes it as easy as calling add_triangle from the ASCII or Binary STL importer,

the reason there are two constructors is that for ASCII we don't know the number of triangles, but in binary STL the number of triangles is included in file,
this helps reduce number of memory reallocations,
it can be written in different ways but that's one way

memory is managed in the implementation of add_vertex_unique and add_triangle

in addition to managing memory, this class also deduplicates vertices with the help of a map, we need to deduplicate vertices as they are stored duplicated and not indexed in the STL file, this creates an interesting situation, it can result in degenerate triangles, which should be handled

/* Abstraction on top of Blender's Mesh data structure */
class STLMeshHelper {
 private:
  Mesh *mesh;
  uint32_t verts_capacity;
  uint32_t tris_capaicity;
  blender::Map<float3, uint32_t> vertex_id_map;

  /* Returns the index of vertex if it there's a vertex with same location in space,
   * otherwise, create a new vertex and return its index.
   */
  uint32_t add_vertex_unique(float3 co);
  /* Shrink memory allocated for Mesh data structure to fit the vertex and face count without
   * excess.
   */
  void shrink_mem();

 public:
  STLMeshHelper();
  STLMeshHelper(uint32_t num_tris);

  /* Create a new triangle from specified vertex locations,
   * vertices with same location are merged.
   */
  void add_triangle(float3 a, float3 b, float3 c);
  /* Get final mesh after calculating edges and shrinking memory. */
  Mesh *get_final_mesh();
};
Fri, May 6, 3:08 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) updated the task description for T97882: Native STL IO.
Fri, May 6, 2:26 PM · Pipeline, Assets & I/O, Import/Export, BF Blender
Aras Pranckevicius (aras_p) closed D14871: obj: move parsing utilities out of io_common, since they are fairly obj specific.
Fri, May 6, 1:55 PM · Import/Export, BF Blender
Campbell Barton (campbellbarton) accepted D14871: obj: move parsing utilities out of io_common, since they are fairly obj specific.

Looks good to me.

Fri, May 6, 1:28 PM · Import/Export, BF Blender
Iyad Ahmed (iyadahmed2001) added a comment to T97882: Native STL IO.

Ran into and interesting issue while writing the operator
IO_stl.h is a header in source/blender/io, while io_stl.h is in source/blender/editors/io
it caused issues, the compiler is not finding structs
I'm on Windows so maybe the problem is case insensitive filesystem, going to have to choose a different name for one of them

Fri, May 6, 1:20 PM · Pipeline, Assets & I/O, Import/Export, BF Blender