setting invalid vector swizzle attributes (from blender2.4x docs for instance), could crash blender.

- disallow setting swizzle's that have duplicate values: vec.xxx = [1,2,3]
 - raise an error if the list setting a swizzle's longer.
 - mathutils write callback was running on the wrong vector, which could crash blender.
This commit is contained in:
2010-01-31 22:50:07 +00:00
parent fd3842f3a2
commit f776303de1
2 changed files with 372 additions and 349 deletions

View File

@@ -50,6 +50,6 @@ vec2d[:] = vec3d[:2]
# Vectors support 'swizzle' operations
# See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)
vec.xyz = vec.zyx
vec.xy = vec.zw
vec.xxy = vec.wzz
vec.yzyz = vec.yxyx
vec.xy = vec4d.zw
vec.xyz = vec4d.wzz
vec4d.wxyz = vec.yxyx