Age | Commit message (Collapse) | Author |
|
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.
|
|
- bpy.app moved into PyStructSequence (used by sys.float_info)
- added buildinfo into bpy.app.build_*
- bpy.ui removed (wasnt used)
- include external example files in Mathutils docs (only Mathutils and Vector are currently written)
- added support to auto document PyStructSequence's
- CMake had "'s inside all its strings.
|
|
|
|
access Matrix.is_negative
renamed Mathutils attribute wrapped -> is_wrapped
|
|
http://www.blender.org/documentation/250PythonDoc/Mathutils.html
* Vector.difference() needed normalized vectors
* bpy.DEUBG -> bpy.app.debug
|
|
quat = vec.difference(other)
also pedantic change with enum names.
|
|
|
|
getset'ers in docs)
- Mathutils.MidpointVecs --> vector.lerp(other, fac)
- Mathutils.AngleBetweenVecs --> vector.angle(other)
- Mathutils.ProjectVecs --> vector.project(other)
- Mathutils.DifferenceQuats --> quat.difference(other)
- Mathutils.Slerp --> quat.slerp(other, fac)
- Mathutils.Rand: removed, use pythons random module
- Mathutils.RotationMatrix(angle, size, axis_flag, axis) --> Mathutils.RotationMatrix(angle, size, axis); merge axis & axis_flag args
- Matrix.scalePart --> Matrix.scale_part
- Matrix.translationPart --> Matrix.translation_part
- Matrix.rotationPart --> Matrix.rotation_part
- toMatrix --> to_matrix
- toEuler --> to_euler
- toQuat --> to_quat
- Vector.toTrackQuat --> Vector.to_track_quat
|
|
* inline some more functions, from math_base and math_vector
* also made some changes to the way inline is done so it can
work for more than one file
* reflect_v3_v3v3 requires input vectors to be normalized now.
* added rgb_to_grayscale
* added zero_v4, copy_v4_v4, swap_v4_v4, is_one_v3
* added box_clip_bounds_m4 to clip a bounding box against a
projection matrix
|
|
|
|
|
|
Also added matrix.median_scale attribute to get the average scale from the matrix, use for scaling bone envalopes.
|
|
animated its over 4x faster.
* utility function BLI_findstring to avoid listbase lookup loops everywhere.
eg:
ListBase *lb= objects= &CTX_data_main(C)->object;
Object *ob= BLI_findstring(lb, name, offsetof(ID, name) + 2);
* made some more math functions use const's, (fix warnings I made in previous commits)
|
|
maintain a reference to the original rna property with callbacks.
also needed for functions that return vectors/matrix's
|
|
From 2 triangles and 1 point, the relative position between the point and the first triangle is applied to the second triangle to find the target point.
the barycentric weights are calculated in 2D space with a signed area so values outside the triangle bounds are supported.
wrapped by python:
pt_to = Geometry.BarycentricTransform(pt_from, t1a, t1b, t1c, t2a, t1b, t1c)
NOTE:
- moved some barycentric weight functions out of projection painting into the math lib.
- ended up making some of the math functions use const args.
TODO:
- support exceptional cases. zero area tries and similar.
|
|
misunderstanding of matrix theory. More details in bug report.
|
|
(parfoure) thanks
From the tracker:
- typo was making the multiplication to transpose resulting matrix
eg
####
from Mathutils import *
from math import radians
cont = GameLogic.getCurrentController()
owner = cont.owner
owner.worldOrientation = RotationMatrix(radians(1), 3, 'z') * owner.worldOrientation
####
|
|
- console import autocomplete wasnt including modules defined in C like BGL, Mathutils
|
|
- the scripts path set in the user preferences or ~/.blender/scripts/ui (io, op, io etc..) will be used to load scripts.
- the default home dir part probably only works in *nix os's
- Added a missing sync callback to vector.toTuple()
|
|
number of decimal places.
- added Mathutils vector method, vec.asTuple(round), since this is tedious in python and fairly common task.
|
|
|
|
|
|
matching pythons dict.get()
removed checks for a failed PyObject_New(), if python cant make a new object your probably going to crash anyway.
|
|
|
|
|
|
- new id property array method convert_to_pyobject()
- editing an array in the UI broke
- fixed for own error when updating ID prop api
|
|
made it possible to remove properties from rna types.
eg.
del group["someprop"]
|
|
keys(), values() & items()
ed...
print(bpy.context.active_object.keys())
Possible name conflict here, need to keep an eye on it.
|
|
- removed 'group.has_key("key")', use... '"key" in group' instead
- removed verbose float and int conversions that are not needed
- fixed memory leak
|
|
|
|
|
|
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
conversion script instead, if they use a lot of math functions
in new code:
http://www.pasteall.org/9052/python
|
|
----------
Incorrect row and column values were passed to newMatrixObject() by
Matrix_new() when the argument to Matrix() was a matrix.
|
|
|
|
- terrible typo was making the multiplication to run in an infinite loop.
- Any matrix * vector multiplication would crash Blender.
eg
####
import Mathutils
from Mathutils import *
vec_ray = Vector(0.0, 0.0, 1.0)
tilt_mat = RotationMatrix(0.0, 3, "y")
vec_ray = tilt_mat * vec_ray
####
|
|
- was imperfect calculation for points marking shortest distance for non-crossing lines in 3d
|
|
|
|
AxisAngleToMat3
|
|
|
|
|
|
strangely vector.c was skipped in last merge from trunk.
-----------------------------------
Mathutils fix: Vector.reflect
* correct function for reflection and moving it to arithb.c
|
|
MathUtil matrix type follows Blender convention of column
major storage. This means that the elements on one column
are contiguous in memory. Vectors are one dimensional
arrays that can be considered in row or in column but
the Blender convention is column so vector should only
be considered as row. This means that the only logical
multiplication operation between matrix and vector is
matrix * vector.
This convention is respected in all parts of MathUtil
except in matrix/matrix and matrix/vector multiplication
where the row major convention is assumed, which in the
and is equivalent to reversing the order of multiplication.
This is clearly a bug and must be corrected but the side
effect is that it will break all scripts using these
operations. Script writers who care about the correctness
of the matrix operations have already implemented work around:
1) change order of matrix/vector multiplication.
vec2 = vec1 * mat1
This must be changed to the normal order:
vec2 = mat1 * vec1
2) change order of matrix/matrix multiplication
(with matl a local transform in matw reference)
mat3 = matl * matw
This must be changed to the normal order:
mat3 = matw * matl
3) transpose before an after the multiplication
matl.transpose()
matw.transpose()
mat3 = matw * matl
mat3.transpose()
This must be changed to:
mat3 = matw * matl;
|
|
getValue() rather than setValue()
- added GPL header to bpy_interface.c from 2.4x's BPY_interface.c
- warning fixes
|
|
- removed unused defines STREQ, STREQ2, STREQ3 and MINSIZE
|
|
Directories intern/ and source/blender/ now compile warning
free again here with scons/gcc.
|
|
- set python to 3.1 on linux (dont use FindPackage for now)
- remove duplicate settings (disable cache for copied settings, was quite confusing)
- added an option WITH_INSTALL, when disabled scripts and language files wont be copied to the target dir (better for quick builds)
- remove .svn (was still CVS), and pyc/pyc files after copy
- copy the 'io' as well as 'ui'
|
|
* Removed CD Actuator
* Removed bSample and bSoundListener
* Removed SoundSystem
* Removed -noaudio parameter
|
|
|
|
also fixed smoke comparing a float's mem-location rather then its value.
|
|
|