Age | Commit message (Collapse) | Author |
|
this is a part of patch 29534, being applied separately
from patch [#29534] Change Matrix Representation and Access in Python to Conform with Standard Notation
by Andrew Hale (trumanblending)
|
|
* 1. Resize 4x4, code was ridiculously complex (cleanup only)
* 2. matrix * matrix checking for compatibility wasn't working right (bug in last release)
* 3. fix for result size for matrix * vector if matrix is 4x4 and vector size 3 (bug in recent patch)
* 4. fix for result size vector * matrix if matrix is 4x4 and vector size 3 (bug in recent patch)
|
|
|
|
breaking matrix*vector.
|
|
Commit 42752
from Andrew Hale
|
|
Matrix.contigPtr --> matrix
Matrix.row_size --> num_col
Matrix.col_size --> num_row
|
|
|
|
Shows Columns as Columns
from Andrew Hale
converted from python string formatting to using BLI_dynstr
|
|
|
|
row/col individually.
- creating a new non-square matrix would use uninitialized memory.
|
|
instead use macros to access row/column's.
also add an assert so invalid index access will raise an error in debug mode, without this it was quite easy to access invalid memory without meaning to.
no functional change.
|
|
|
|
patch http://codereview.appspot.com/5482043
from Andrew Hale
* Text from the submission *
This patch adds the ability to use arbitrary sized vectors from mathutils.
Currently vectors are only of size 2, 3 or 4 since they are generally restricted
to geometric applications. However, we can use arbitrary sized vectors for
efficient calculations and data manipulation.
|
|
(in keeping with most of blenders code)
also split some long lines in own code.
|
|
|
|
|
|
|
|
from Andrew Hale (trumanblending)
Tracker description
*******************
The current python noise module included with Blender has yet to be updated to the new Py API. This patch does so, with the following major points:
- The noise module has now been moved to a submodule of mathutils, it can be accessed by mathutils.noise. It was moved from it's own module as it will now return mathutils types and also have greater visibility to the user.
- All functions which return vectors will now return mathutils.Vector types to be consistent with the rest of the API. Previously (x, y, z) tuples were returned.
- A different implementation of random_unit_vector is now used, this allows 2D, 3D and 4D vectors to be returned. Previously only 3D was possible.
- Some function names have been changed to remove ambiguities and make naming consistent within the module. noise.vector is now noise.noise_vector and noise.vl_vector is now noise.variable_lacunarity
- Doc strings have been updated to be compatible with auto docs.
- Code style and internal naming has been changed to match the conventions in other mathutils code.
Thanks,
Andrew
|
|
|
|
functional changes)
|
|
from Andrew Hale (trumanblending), with some edits to use these in mathutils.Vector added.
Added Functions:
- dot_vn_vn - Dot product of two arrays
- normalize_vn_vn - Normalize an array and store the result in a second array
- normalize_vn - Normalize an array inplace
Renamed Functions:
Some functions have been renamed to make them consistent with the naming conventions used by fixed length array functions.
- fill_vni to fill_vn_i
- fill_vn to fill_vn_fl
|
|
- isect_plane_plane_v3 uses better method
- minor refactor - arg name changes & some args as const.
|
|
|
|
|
|
|
|
|
|
function, BLI math version too.
|
|
|
|
|
|
- remove recently added sphinx reference workaround.
- tested doxygen, correct some warnings, set tab width and added pymathutils group.
- added convenience target 'make doc_doxy'
|
|
add in safety checks for inf/nan values which could happen in some cases.
|
|
|
|
|
|
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
nothing to effect translations.
|
|
- added API examples for mathutils.Color/Euler/Quaternion/Matrix.
- corrected own bad spelling matricies --> matrices.
- minor pep8 edits.
- update CMake ignore file list.
|
|
|
|
Quaternion object.
|
|
|
|
|
|
exception messages and minor style edits.
|
|
some minor changes to exception messages.
|
|
single_axis_angle_to_mat3(mat3, axis, angle), copied out from mathutils, axis arg is a char 'X/Y/Z' rather then a vector like axis_angle_to_mat3().
|
|
from Fedora but applied changes elsewhere too), also replace PyList_Size with PyList_GET_SIZE where typechecking is already done.
|
|
added back as row_vector_multiplication bu to avoid confusion for a bit just disable it altogether so script authors get an error on use and update their scripts.
|
|
simply vector.dot(vector), so nothing new is really added, but it's nice for writing more intent revealing code. In other words:
if vec.dot(vec) > some_distance*some_distance:
do_something()
might not be quite as obvious looking as:
if vec.length_squared > some_distance*some_distance:
do_something()
As to why you'd want to use length_squared over length is that length uses a square root, which isn't always necessary for simple distance checks (e.g., closest object, checks like the ones above, ect).
|
|
vector * matrix
vector *= matrix
vector * quaternion
vector *= quaternion
Use the reverse order instead, enable WITH_ASSERT_ABORT in cmake to promote the warnings into errors.
|
|
[#28032] Python Mathutils: Matrix Multiplication Error
Since they ended up reversing the order we better keep old code unless its proven to be incorrect.
also change Matrix.__repr__ function args to evaluate correctly (need to be inside a tuple).
|
|
with FBX, BVH import/export which are very sensitive to changes in matrix rotation.
|