Duplicate long shapekey names crash Blender
Closed, ResolvedPublic

Description

Blender 2.60.5, r42004, Win 7 64 bit

The following code makes Blender hang. The problem is evidently that long shapekey names are not truncated uniquely.
-------------------------------------------
import bpy

def makeShapeKey(name):
bpy.ops.object.shape_key_add(from_mix=False)
skey = bpy.context.object.active_shape_key
skey.name = name
return

makeShapeKey("Basis")
makeShapeKey("This-is-a-very-long-shape-key-name-number-1")
makeShapeKey("This-is-a-very-long-shape-key-name-number-2")


Details

Type
Bug

Will look into this issue.

Hrm, noticed two things. First is that it's not so simle to assign bugs to myself in google chrome - "Assigned To" is getting reset when focus is leaing combobox, but it's side note.

About this hung. Looks like it's old issue in code which makes names unique. Attached patch should solve this, but it's code used all over so extra eyes on checing it are welcome. Mabe Campbell can help here?

Discussed with Campbell. Its more complicated fix which chould be performed here: at every string clamp itteration string should be verified if it's still a valid utf8 sequence.
Just a not which should be taken into account if somebod would want to commit or use this patch.

Seems this was fixed but the report not closed yet.
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42029

Brecht Van Lommel (brecht) closed this task as "Resolved".Nov 23 2011, 3:55 PM