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

Closed
opened 2019-08-26 18:00:10 +02:00 by Niko Maisuradze · 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.

Added subscriber: @NikoMaisuradze

Added subscriber: @NikoMaisuradze

#70710 was marked as duplicate of this issue

#70710 was marked as duplicate of this issue
Member

Added subscribers: @dr.sybren, @lichtwerk

Added subscribers: @dr.sybren, @lichtwerk
Member

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)

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.

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.

@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.
Sybren A. Stüvel 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 2019-10-17 11:14:31 +02:00

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.

This issue was referenced by dffe702d78

This issue was referenced by dffe702d782990b2b6fd36767254d35ab47f25eb

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sybren A. Stüvel self-assigned this 2019-10-17 11:27:04 +02:00

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
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
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
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
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
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 Info 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
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#69182
No description provided.