Auto-Smooth does not work on Alembic meshes without normals #69182

Closed
opened 4 years ago by NikoMaisuradze · 15 comments

System Information
Operating system: Windows-8-6.2.9200-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.71

Blender Version
Broken: version: 2.81 (sub 3), branch: master, commit date: 2019-08-25 19:05, hash: af8e8be7b1
Worked: (optional)

Short description of error
When importing alembic with varying vertex count, normals on object appear to be always flat, whether reading them from alembic or smoothing them manually (autosmooth)

Exact steps for others to reproduce the error

  1. Import alembic with varying vertex count (see attached abc file, test.abc )
  2. Try to smoothing objects normals, disable "face" in alembic modifier and enable autosmooth.
  3. Normals either will be always flat, or will be smoothed only at first frame.
**System Information** Operating system: Windows-8-6.2.9200-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.71 **Blender Version** Broken: version: 2.81 (sub 3), branch: master, commit date: 2019-08-25 19:05, hash: `af8e8be7b1` Worked: (optional) **Short description of error** When importing alembic with varying vertex count, normals on object appear to be always flat, whether reading them from alembic or smoothing them manually (autosmooth) **Exact steps for others to reproduce the error** 1. Import alembic with varying vertex count (see attached abc file, [test.abc](https://archive.blender.org/developer/F7704803/test.abc) ) 2. Try to smoothing objects normals, disable "face" in alembic modifier and enable autosmooth. 3. Normals either will be always flat, or will be smoothed only at first frame.
Poster

Added subscriber: @NikoMaisuradze

Added subscriber: @NikoMaisuradze
Collaborator

#70710 was marked as duplicate of this issue

#70710 was marked as duplicate of this issue
Collaborator

Added subscribers: @dr.sybren, @lichtwerk

Added subscribers: @dr.sybren, @lichtwerk
Collaborator

Since e9c149d911, reading loop normals should be supported.
In your file, normals dont seem to be exported:

AbcEcho for Alembic 1.7.8 (built May 11 2019 13:50:14)
  file written by: Maya 2018 AbcExport v1.0
  using Alembic : Alembic 1.5.8 (built Jul 13 2016 18:28:45)
  written on : Mon Aug 26 19:38:40 2019
  user description : Exported from: D:/work/livingstone/baloon/untitled

  ScalarProperty name=.childBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=120
  ScalarProperty name=statistics;interpretation=;datatype=string;arraysize=1;numsamps=1
  ScalarProperty name=1.samples;interpretation=;datatype=uint32_t;arraysize=1;numsamps=1
Object name=/pCube1
  CompoundProperty name=.xform;schema=AbcGeom_Xform_v3
Object name=/pCube1/pCubeShape1
  CompoundProperty name=.geom;schema=AbcGeom_PolyMesh_v1
    ScalarProperty name=.selfBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=120
    ArrayProperty name=P;interpretation=point;datatype=float32_t[3];arraysize=386;numsamps=120
    ArrayProperty name=.faceIndices;interpretation=;datatype=int32_t;arraysize=1536;numsamps=120
    ArrayProperty name=.faceCounts;interpretation=;datatype=int32_t;arraysize=384;numsamps=120
    CompoundProperty name=uv;schema=
      ArrayProperty name=.vals;interpretation=vector;datatype=float32_t[2];arraysize=441;numsamps=120
      ArrayProperty name=.indices;interpretation=;datatype=uint32_t;arraysize=1536;numsamps=120

(there should be an entry like this in there if normals are exported)
ArrayProperty name=N;interpretation=normal;datatype=float32_t- [x];arraysize=24;numsamps=50

From quick glance at e9c149d911 it seems that if normals are not in the .abc, then indeed these will default to flat? (might be reading it wrong though... see below)
@NikoMaisuradze: where are you exporting from? Could you try with exporting normals enabled from there?
@dr.sybren: what is the default if we dont have custom normals in the .abc? smooth/flat? no way to 'override'? (I seem to be getting different results here, once with flat like in this report, once with smooth like in untitled2.abc

Since e9c149d911, reading loop normals should be supported. In your file, normals dont seem to be exported: ``` AbcEcho for Alembic 1.7.8 (built May 11 2019 13:50:14) file written by: Maya 2018 AbcExport v1.0 using Alembic : Alembic 1.5.8 (built Jul 13 2016 18:28:45) written on : Mon Aug 26 19:38:40 2019 user description : Exported from: D:/work/livingstone/baloon/untitled ScalarProperty name=.childBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=120 ScalarProperty name=statistics;interpretation=;datatype=string;arraysize=1;numsamps=1 ScalarProperty name=1.samples;interpretation=;datatype=uint32_t;arraysize=1;numsamps=1 Object name=/pCube1 CompoundProperty name=.xform;schema=AbcGeom_Xform_v3 Object name=/pCube1/pCubeShape1 CompoundProperty name=.geom;schema=AbcGeom_PolyMesh_v1 ScalarProperty name=.selfBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=120 ArrayProperty name=P;interpretation=point;datatype=float32_t[3];arraysize=386;numsamps=120 ArrayProperty name=.faceIndices;interpretation=;datatype=int32_t;arraysize=1536;numsamps=120 ArrayProperty name=.faceCounts;interpretation=;datatype=int32_t;arraysize=384;numsamps=120 CompoundProperty name=uv;schema= ArrayProperty name=.vals;interpretation=vector;datatype=float32_t[2];arraysize=441;numsamps=120 ArrayProperty name=.indices;interpretation=;datatype=uint32_t;arraysize=1536;numsamps=120 ``` (there should be an entry like this in there if normals are exported) `ArrayProperty name=N;interpretation=normal;datatype=float32_t- [x];arraysize=24;numsamps=50` From quick glance at e9c149d911 it seems that if normals are not in the .abc, then indeed these will default to flat? (might be reading it wrong though... see below) @NikoMaisuradze: where are you exporting from? Could you try with exporting normals enabled from there? @dr.sybren: what is the default if we dont have custom normals in the .abc? smooth/flat? no way to 'override'? (I seem to be getting different results here, once with flat like in this report, once with smooth like in [untitled2.abc](https://archive.blender.org/developer/F7706017/untitled2.abc)
Poster

I'm exporting from maya (2018) . I was sure the test file had normal export enabled. Here i tried here with another test alembic with normals and it also is importing as flat shaded, smooth shading has only effect on first frame, after disabling face on modifier. sphere_animatedSubdiv.abc

I tried importing it to earlier version of blender (2.80-4ef09cf937f2-win64) and both the test files and production file i'm working with are importing fine there. Also, reexporting it from there and importing it to latest daily build seems to fix the issue, smooth normals are imported.

I'm exporting from maya (2018) . I was sure the test file had normal export enabled. Here i tried here with another test alembic with normals and it also is importing as flat shaded, smooth shading has only effect on first frame, after disabling face on modifier. [sphere_animatedSubdiv.abc](https://archive.blender.org/developer/F7706085/sphere_animatedSubdiv.abc) I tried importing it to earlier version of blender (2.80-4ef09cf937f2-win64) and both the test files and production file i'm working with are importing fine there. Also, reexporting it from there and importing it to latest daily build seems to fix the issue, smooth normals are imported.
Collaborator

In #69182#763465, @lichtwerk wrote:
@dr.sybren: what is the default if we dont have custom normals in the .abc? smooth/flat?

It calls BKE_mesh_calc_normals() on the mesh, which in turn calls BKE_mesh_calc_normals_poly(). Nobody bothered to add a comment to explain what that code actually does.

no way to 'override'?

Nope.

> In #69182#763465, @lichtwerk wrote: > @dr.sybren: what is the default if we dont have custom normals in the .abc? smooth/flat? It calls `BKE_mesh_calc_normals()` on the mesh, which in turn calls `BKE_mesh_calc_normals_poly()`. Nobody bothered to add a comment to explain what that code actually does. > no way to 'override'? Nope.

Added subscriber: @MichaelHermann

Added subscriber: @MichaelHermann

Added subscriber: @grosgood

Added subscriber: @grosgood

Apart from importing via Alembic, there have been issues with smooth/flat object shading regarding NVIDIA cards. See #68681. It is plausible that an Alembic import can be successful, but a manifestation of #68681 disrupts the observation of a flat/smooth object setting.

Apart from importing via Alembic, there have been issues with smooth/flat object shading regarding NVIDIA cards. See #68681. It is plausible that an Alembic import can be successful, but a manifestation of #68681 disrupts the observation of a flat/smooth object setting.
Collaborator

@grosgood #68681 (Hair Dynamics: simulation doesn't work depending on smooth/flat shaded surfaces (and nvidia gpus?)) seems to be about hair simulation, which I doubt is connected to this.

I can confirm this issue, though.

@grosgood #68681 (Hair Dynamics: simulation doesn't work depending on smooth/flat shaded surfaces (and nvidia gpus?)) seems to be about hair simulation, which I doubt is connected to this. I can confirm this issue, though.
dr.sybren changed title from Smooth shading normals do not work on Alembic with varying vertex count. to Auto-Smooth does not work on Alembic meshes without normals 3 years ago
Collaborator

The issue was in the handling of normals when the Alembic mesh doesn't contain any normal info. I've made it so that Auto-Smooth works in such a case; disabling it will show flat-shaded geometry.

The issue was in the handling of normals when the Alembic mesh doesn't contain any normal info. I've made it so that Auto-Smooth works in such a case; disabling it will show flat-shaded geometry.
Collaborator

This issue was referenced by dffe702d78

This issue was referenced by dffe702d782990b2b6fd36767254d35ab47f25eb
Collaborator

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
dr.sybren closed this issue 3 years ago
dr.sybren self-assigned this 3 years ago
Collaborator

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Added subscriber: @Jam-Dalu

Added subscriber: @Jam-Dalu
Sign in to join this conversation.
No Label
Interest/Alembic
Interest/Animation & Rigging
Interest/Asset Browser
Interest/Asset Browser Project Overview
Interest/Audio
Interest/Automated Testing
Interest/Blender Asset Bundle
Interest/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
Interest/Eevee & Viewport
Interest/Freestyle
Interest/Geometry Nodes
Interest/Grease Pencil
Interest/ID Management
Interest/Images & Movies
Interest/Import/Export
Interest/Line Art
Interest/Masking
Interest/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
Interest/Python API
Interest/Render & Cycles
Interest/Render Pipeline
Interest/Sculpt, Paint & Texture
Interest/Text Editor
Interest/Translations
Interest/Triaging
Interest/Undo
Interest/USD
Interest/User Interface
Interest/UV Editing
Interest/VFX & Video
Interest/Video Sequencer
Interest/Virtual Reality
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
Module › Animation & Rigging
Module › Core
Module › Development Management
Module › Eevee & Viewport
Module › Grease Pencil
Module › Modeling
Module › Nodes & Physics
Module › Pipeline, Assets & IO
Module › Platforms, Builds, Tests & Devices
Module › Python API
Module › Render & Cycles
Module › Sculpt, Paint & Texture
Module › Triaging
Module › User Interface
Module › VFX & Video
Platform/FreeBSD
Platform/Linux
Platform/macOS
Platform/Windows
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#69182
Loading…
There is no content yet.