3
$\begingroup$

So i have been playing with split custom normals. I figured out that i have to add an array of normals to get started. And i also figured out that i have to use zero vectors as placeholders where i do not want to have custom normals.

so:

tgt = bpy.context.object
zv = (0.0,0.0,0.0)                 # my zero vector
normals = [zv]*len(tgt.data.loops) # the array of normals
tgt.data.normals_split_custom_set(normals)

The code above seems to work but i get 2 strange issues:

1.) When i call this code while the object is in edit mode, then actually nothing happens (no split custom normals are assigned to my object)

2.) When i call this code while the object is in object mode, then the array is assigned to the object, but in addition all edges between smooth faces are marked as sharp.

Here is my object before i add the custom split normals:

enter image description here

And this is right after i called the code snippet from above:

enter image description here

I expect to see no changes at all (because the entire normals array has zero vectors). So i guess i have forgotten something to setup. But i have no idea what i am doing wrong.

$\endgroup$
3
  • $\begingroup$ Based on the shown normals, that is the expected result. Why the normals are like that I don't know. $\endgroup$
    – J Sargent
    Apr 11, 2015 at 15:22
  • $\begingroup$ Maybe you want to use an Edge Split modifier with Sharp Edges checked, and then mark some of your edges as being sharp in edit mode. $\endgroup$
    – Mutant Bob
    Apr 11, 2015 at 16:48
  • $\begingroup$ Hi. Thanks for your comments. Actually i have something much more complex in my mind than just adding an array of zero vectors :) And i know that i can not achieve what i want by using the normals modifier. However according to what i read about custom normals, adding a set of zero vectors should not affect the normals at all. But apparently it DOES affect the normals which is either a bug in Blender or i am missing some additional step. It may well be that i have to initialize the custom normals array differently or maybe i have to recalculate the normals somehow to keep them as they are. $\endgroup$
    – Gaia Clary
    Apr 11, 2015 at 22:06

1 Answer 1

2
$\begingroup$

It turned out that this actually was a bug in Blender. This Bug has been fixed and the fix will be in Blender 2.75 Then my initial code snippet will work as expected.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .