[Bf-blender-cvs] CVS commit: blender/source/blender/python BPY_interface.c blender/source/blender/python/api2_2x Bone.c Mathutils.c Mathutils.h NMesh.c Object.c Object.h Types.c Window.c euler.c euler.h gen_utils.c gen_utils.h matrix.c matrix.h quat.c quat.h vector.c vector.h
Joseph Gilbert
models at paposo.com
Fri May 20 21:28:05 CEST 2005
ascotan (Joseph Gilbert) 2005/05/20 21:28:05 CEST
Modified files:
blender/source/blender/python BPY_interface.c
blender/source/blender/python/api2_2x Bone.c Mathutils.c
Mathutils.h NMesh.c
Object.c Object.h
Types.c Window.c euler.c
euler.h gen_utils.c
gen_utils.h matrix.c
matrix.h quat.c quat.h
vector.c vector.h
Log:
-rewrite and bugfixes
----------------------------------
Here's my changelog:
-fixed Rand() so that it doesn't seed everytime and should generate better random numbers
- changed a few error return types to something more appropriate
- clean up of uninitialized variables & removal of unneccessary objects
- NMesh returns wrapped vectors now
- World returns wrapped matrices now
- Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
- Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
- Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
- Removed memory allocation (unneeded) from all methods
- Vector's resize methods are only applicable to new vectors not wrapped data.
- Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
- Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
- Euler.rotate does internal rotation now
- Slice assignment now works better for all types
- Vector * Vector and Quat * Quat are defined and return the DOT product
- Mat * Vec and Vec * Mat are defined now
- Moved #includes to .c file from headers. Also fixed prototypes in mathutils
- Added new helper functions for incref'ing to genutils
- Major cleanup of header files includes - include Mathutils.h for access to math types
- matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
- Matrix() with no parameters now returns an identity matrix by default not a zero matrix
- printf() now prints with 6 digits instead of 4
- printf() now prints output with object descriptor
- Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
- Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence. index cannot go above the row size of the matrix.
- slice operations on matrices work with sequences now (rows of the matrix) example: mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
- slice assignment will no longer modify the data if the assignment operation fails
- fixed error in matrix * scalar multiplication
- euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
- Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
- Quats can be created with angle/axis, axis/angle
- 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
- vec *quat / quat * vec is now defined
- vec.magnitude alias for vec.length
- all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
- these methods have been deprecated (still functioning but suggested to use the corrected functionality):
* CopyVec() - replaced by Vector() functionality
* CopyMat() - replaced by Matrix() functionality
* CopyQuat() - replace by Quaternion() functionality
* CopyEuler() - replaced by Euler() functionality
* RotateEuler() - replaced by Euler.rotate() funtionality
* MatMultVec() - replaced by matrix * vector
* VecMultMat() - replaced by vector * matrix
- New struct containers references to python object data or internally allocated blender data for wrapping
* Explaination here: math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
* otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
Revision Changes Path
1.68 +2 -2 blender/source/blender/python/BPY_interface.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/BPY_interface.c.diff?r1=1.67&r2=1.68&cvsroot=bf-blender>
1.26 +45 -105 blender/source/blender/python/api2_2x/Bone.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Bone.c.diff?r1=1.25&r2=1.26&cvsroot=bf-blender>
1.9 +932 -1263 blender/source/blender/python/api2_2x/Mathutils.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Mathutils.c.diff?r1=1.8&r2=1.9&cvsroot=bf-blender>
1.4 +37 -3 blender/source/blender/python/api2_2x/Mathutils.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Mathutils.h.diff?r1=1.3&r2=1.4&cvsroot=bf-blender>
1.69 +6 -6 blender/source/blender/python/api2_2x/NMesh.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/NMesh.c.diff?r1=1.68&r2=1.69&cvsroot=bf-blender>
1.115 +36 -41 blender/source/blender/python/api2_2x/Object.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Object.c.diff?r1=1.114&r2=1.115&cvsroot=bf-blender>
1.25 +2 -6 blender/source/blender/python/api2_2x/Object.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Object.h.diff?r1=1.24&r2=1.25&cvsroot=bf-blender>
1.20 +2 -1 blender/source/blender/python/api2_2x/Types.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Types.c.diff?r1=1.19&r2=1.20&cvsroot=bf-blender>
1.32 +3 -3 blender/source/blender/python/api2_2x/Window.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/Window.c.diff?r1=1.31&r2=1.32&cvsroot=bf-blender>
1.5 +309 -253 blender/source/blender/python/api2_2x/euler.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/euler.c.diff?r1=1.4&r2=1.5&cvsroot=bf-blender>
1.3 +14 -20 blender/source/blender/python/api2_2x/euler.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/euler.h.diff?r1=1.2&r2=1.3&cvsroot=bf-blender>
1.28 +26 -1 blender/source/blender/python/api2_2x/gen_utils.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/gen_utils.c.diff?r1=1.27&r2=1.28&cvsroot=bf-blender>
1.22 +7 -1 blender/source/blender/python/api2_2x/gen_utils.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/gen_utils.h.diff?r1=1.21&r2=1.22&cvsroot=bf-blender>
1.15 +644 -847 blender/source/blender/python/api2_2x/matrix.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/matrix.c.diff?r1=1.14&r2=1.15&cvsroot=bf-blender>
1.4 +20 -25 blender/source/blender/python/api2_2x/matrix.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/matrix.h.diff?r1=1.3&r2=1.4&cvsroot=bf-blender>
1.8 +461 -435 blender/source/blender/python/api2_2x/quat.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/quat.c.diff?r1=1.7&r2=1.8&cvsroot=bf-blender>
1.3 +17 -23 blender/source/blender/python/api2_2x/quat.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/quat.h.diff?r1=1.2&r2=1.3&cvsroot=bf-blender>
1.19 +562 -617 blender/source/blender/python/api2_2x/vector.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/vector.c.diff?r1=1.18&r2=1.19&cvsroot=bf-blender>
1.9 +17 -23 blender/source/blender/python/api2_2x/vector.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/python/api2_2x/vector.h.diff?r1=1.8&r2=1.9&cvsroot=bf-blender>
More information about the Bf-blender-cvs
mailing list