[#18678] Swizzle properties for Mathutils.Vector

patch from Alex Fraser (z0r)

eg.
  - vec.xyz = vec.zyx
  - vec.xy = vec.zw
  - vec.xxy = vec.wzz
  - vec.yzyz = vec.yxyx

See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)

made some minor modifications to this patch.

tested access times and adding 336 attributes to vectors doesn't make a noticeable differences to speed of existing axis attributes (x,y,z,w) - thanks to python dict lookups.
This commit is contained in:
2009-05-03 17:52:03 +00:00
parent 03a0770df5
commit 8a83aff9f5
7 changed files with 347 additions and 7 deletions

View File

@@ -286,6 +286,8 @@ void BPY_end_python( void )
free_libblock( &G.main->script, script );
}
Mathutils_Free(NULL);
Py_Finalize( );
BPyMenu_RemoveAllEntries( ); /* freeing bpymenu mem */