Page MenuHome

Can't set normals with foreach_set
Closed, ResolvedPublic

Description

--- Operating System, Graphics card ---
Arch Linux 64-bit
Nvidia GTX 295

--- Blender version with error, and version that worked ---
Error: Blender 2.66.0 r54697
Working: Blender 2.65 r53177

--- Short description of error ---
Normals can't be set using foreach_set in Blender 2.66. For example, something like this doesn't work anymore:
verts.foreach_set("normal", normal_list)

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
1. Open Blender and make sure default "Cube" is available.
2. Copy this code into the Text Editor (or open the attached Blend file):

import bpy
import random

verts = bpy.data.meshes["Cube"].vertices
for v in verts:
print(v.normal)
print('----------')
random_normals = [random.uniform(-1.0, 1.0) for i in range(0, 24)]
verts.foreach_set("normal", random_normals)
for v in verts:
print(v.normal)

3. Hit the "Run Script" button.
4. Verify that normals weren't updated in the console.

Event Timeline

Fix in svn, thanks for the report.

Brecht Van Lommel (brecht) changed the task status from Unknown Status to Resolved.Feb 28 2013, 5:12 PM