Export to .ply ignores flat shading #102472

Open
opened 2022-11-13 08:21:44 +01:00 by Василий · 7 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Intel(R) UHD Graphics 630 Intel 4.5.0 - Build 31.0.101.2111

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: blender/blender@b292cfe5a9
Worked: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 'blender/blender@02948a2cab'

Short description of error
When exporting to Stanford format (.ply), regardless of whether the model is smooth shading or flat shading, the normal information always corresponds to smooth shading. Even for a simple cube.
On my laptop everything works correctly (Version 2.92.0)

Exact steps for others to reproduce the error

  1. open the attached "cube.blend" file cube.blend
  2. File - Export - Stanford.ply
  3. Format ASCII - set; Selection only - not set; Transform: Z forward, Y up, Scale 1.00; Geometry: Apply modifiers - not set, Normals - set, UVs - set, Vertex Colors - not set image.png
  4. Press EXPORT PLY button
  5. All normals in the cube.ply are calculated for the smooth shading model cube.ply
**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: Intel(R) UHD Graphics 630 Intel 4.5.0 - Build 31.0.101.2111 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `blender/blender@b292cfe5a9` Worked: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 'blender/blender@02948a2cab' **Short description of error** When exporting to Stanford format (.ply), regardless of whether the model is smooth shading or flat shading, the normal information always corresponds to smooth shading. Even for a simple cube. On my laptop everything works correctly (Version 2.92.0) **Exact steps for others to reproduce the error** 1. open the attached "cube.blend" file [cube.blend](https://archive.blender.org/developer/F13899514/cube.blend) 2. File - Export - Stanford.ply 3. Format ASCII - set; Selection only - not set; Transform: Z forward, Y up, Scale 1.00; Geometry: Apply modifiers - not set, Normals - set, UVs - set, Vertex Colors - not set ![image.png](https://archive.blender.org/developer/F13899523/image.png) 4. Press EXPORT PLY button 5. All normals in the cube.ply are calculated for the smooth shading model [cube.ply](https://archive.blender.org/developer/F13899520/cube.ply)
Author

Added subscriber: @smitch80

Added subscriber: @smitch80
Author

I found a quick workaround for my problem for now
I replaced files in the C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\addons\io_mesh_ply folder with the same files but older version (2.92.0)
Those files are: init.py, export_ply.py and import_ply.py
That worked well for me

I found a quick workaround for my problem for now I replaced files in the C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\addons\io_mesh_ply folder with the same files but older version (2.92.0) Those files are: __init__.py, export_ply.py and import_ply.py That worked well for me
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

New:

1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.375000 0.000000
1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.625000 0.000000
1.000000 1.000000 1.000000 0.577350 0.577350 0.577350 0.625000 0.250000
1.000000 -1.000000 1.000000 0.577350 -0.577350 0.577350 0.375000 0.250000
-1.000000 1.000000 1.000000 -0.577350 0.577350 0.577350 0.625000 0.500000
-1.000000 -1.000000 1.000000 -0.577350 -0.577350 0.577350 0.375000 0.500000
-1.000000 1.000000 -1.000000 -0.577350 0.577350 -0.577350 0.625000 0.750000
-1.000000 -1.000000 -1.000000 -0.577350 -0.577350 -0.577350 0.375000 0.750000
1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.625000 1.000000
1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.375000 1.000000
1.000000 -1.000000 1.000000 0.577350 -0.577350 0.577350 0.125000 0.500000
1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.125000 0.750000
1.000000 1.000000 1.000000 0.577350 0.577350 0.577350 0.875000 0.500000
1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.875000 0.750000
4 0 1 2 3
4 3 2 4 5
4 5 4 6 7
4 7 6 8 9
4 10 5 7 11
4 4 12 13 6

Old:

-1.000000 -1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.000000
-1.000000 -1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.000000
-1.000000 1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.250000
-1.000000 1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.250000
-1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.250000
-1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.250000
1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.500000
1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.500000
1.000000 1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.500000
1.000000 1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.500000
1.000000 -1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.750000
1.000000 -1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.750000
1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 0.750000
1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 0.750000
-1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 1.000000
-1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 1.000000
-1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.500000
1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.500000
1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.750000
-1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.750000
1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.500000
-1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.500000
-1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.750000
1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.750000
4 0 1 2 3
4 4 5 6 7
4 8 9 10 11
4 12 13 14 15
4 16 17 18 19
4 20 21 22 23

It seems the new behavior produces less number of vertices and thus interpolates normals or something. Not sure if this is expected.

New: ``` 1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.375000 0.000000 1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.625000 0.000000 1.000000 1.000000 1.000000 0.577350 0.577350 0.577350 0.625000 0.250000 1.000000 -1.000000 1.000000 0.577350 -0.577350 0.577350 0.375000 0.250000 -1.000000 1.000000 1.000000 -0.577350 0.577350 0.577350 0.625000 0.500000 -1.000000 -1.000000 1.000000 -0.577350 -0.577350 0.577350 0.375000 0.500000 -1.000000 1.000000 -1.000000 -0.577350 0.577350 -0.577350 0.625000 0.750000 -1.000000 -1.000000 -1.000000 -0.577350 -0.577350 -0.577350 0.375000 0.750000 1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.625000 1.000000 1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.375000 1.000000 1.000000 -1.000000 1.000000 0.577350 -0.577350 0.577350 0.125000 0.500000 1.000000 -1.000000 -1.000000 0.577350 -0.577350 -0.577350 0.125000 0.750000 1.000000 1.000000 1.000000 0.577350 0.577350 0.577350 0.875000 0.500000 1.000000 1.000000 -1.000000 0.577350 0.577350 -0.577350 0.875000 0.750000 4 0 1 2 3 4 3 2 4 5 4 5 4 6 7 4 7 6 8 9 4 10 5 7 11 4 4 12 13 6 ``` Old: ``` -1.000000 -1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.000000 -1.000000 -1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.000000 -1.000000 1.000000 1.000000 -1.000000 -0.000000 0.000000 0.625000 0.250000 -1.000000 1.000000 -1.000000 -1.000000 -0.000000 0.000000 0.375000 0.250000 -1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.250000 -1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.250000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.625000 0.500000 1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000 0.375000 0.500000 1.000000 1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.500000 1.000000 1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.500000 1.000000 -1.000000 1.000000 1.000000 -0.000000 0.000000 0.625000 0.750000 1.000000 -1.000000 -1.000000 1.000000 -0.000000 0.000000 0.375000 0.750000 1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 0.750000 1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 0.750000 -1.000000 -1.000000 1.000000 0.000000 -1.000000 0.000000 0.625000 1.000000 -1.000000 -1.000000 -1.000000 0.000000 -1.000000 0.000000 0.375000 1.000000 -1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.500000 1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.500000 1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.375000 0.750000 -1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000 0.125000 0.750000 1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.500000 -1.000000 1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.500000 -1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.875000 0.750000 1.000000 -1.000000 1.000000 0.000000 -0.000000 1.000000 0.625000 0.750000 4 0 1 2 3 4 4 5 6 7 4 8 9 10 11 4 12 13 14 15 4 16 17 18 19 4 20 21 22 23 ``` It seems the new behavior produces less number of vertices and thus interpolates normals or something. Not sure if this is expected.

Added subscriber: @GaryH

Added subscriber: @GaryH

Would love to see this fixed as well! Blender seems to completely ignore normal data when exporting a .ply file. The only way to retain a flat shading is to disable the normal option, however this hack does not allow a mixture of flat and smooth shaded faces, which is crucial to any normal usage of the exporter. Additionally, Blender seems to ignore the smooth-shaded normal too during import.

Would love to see this fixed as well! Blender seems to completely ignore normal data when exporting a `.ply` file. The only way to retain a flat shading is to disable the `normal` option, however this hack does not allow a mixture of flat and smooth shaded faces, which is crucial to any normal usage of the exporter. Additionally, Blender seems to ignore the smooth-shaded normal too during import.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#102472
No description provided.