normals_split_custom_set() does not behave as documented #44359

Closed
opened 2015-04-12 10:39:48 +02:00 by Gaia Clary · 6 comments
Member

The script below creates an array of zero entries, converts the array into a list of tuples,
then it calls the function normals_split_custom_set().
According to the documentation:

  normals_split_custom_set(normals)  
     Define custom split normals of this mesh
     (use zero-vectors to keep auto ones)
     Parameters:	
     normals (float array of 3 items in [-1, 1]) – Normals

So i expect that when i use a list of zero vectors, then the mesh should not change at all,
but actually it changes a lot. Here is the blend file quarter_ring_custom_normals.blend and here is the script:

  import bpy
  ob   = bpy.context.object
  mesh = ob.data
  normals = [0.0] * len(mesh.loops) * 3
  bpy.ops.object.mode_set(mode='OBJECT')
  tnormals = tuple(zip(*(iter(normals),) * 3)) 
  mesh.normals_split_custom_set(tnormals)
  bpy.ops.object.mode_set(mode='EDIT')

I am not even sure if this is a bug or just a lack of knowledge on my side.
But i could not find any information for the case where i want to
keep almost all normals as they have been calculated by Blender and
just add some corrections for a few normals.

The script below creates an array of zero entries, converts the array into a list of tuples, then it calls the function normals_split_custom_set(). According to the documentation: ``` normals_split_custom_set(normals) Define custom split normals of this mesh (use zero-vectors to keep auto ones) Parameters: normals (float array of 3 items in [-1, 1]) – Normals ``` So i expect that when i use a list of zero vectors, then the mesh should not change at all, but actually it changes a lot. Here is the blend file [quarter_ring_custom_normals.blend](https://archive.blender.org/developer/F161156/quarter_ring_custom_normals.blend) and here is the script: ``` import bpy ob = bpy.context.object mesh = ob.data normals = [0.0] * len(mesh.loops) * 3 ``` ``` bpy.ops.object.mode_set(mode='OBJECT') tnormals = tuple(zip(*(iter(normals),) * 3)) mesh.normals_split_custom_set(tnormals) bpy.ops.object.mode_set(mode='EDIT') ``` I am not even sure if this is a bug or just a lack of knowledge on my side. But i could not find any information for the case where i want to keep almost all normals as they have been calculated by Blender and just add some corrections for a few normals.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Bastien Montagne was assigned by Gaia Clary 2015-04-12 10:39:48 +02:00
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary

Yeah, something sound strange here… investigating.

Yeah, something sound strange here… investigating.

This issue was referenced by 8ad37b0d22

This issue was referenced by 8ad37b0d224fcf3eb09dd2b7def8bdcc386af1a1

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 8ad37b0d22.

Closed by commit 8ad37b0d22.
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
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#44359
No description provided.