Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Gilbert <ascotan@gmail.com>2006-01-04 19:02:02 +0300
committerJoseph Gilbert <ascotan@gmail.com>2006-01-04 19:02:02 +0300
commit9e36d4bc8e853027d4b766d60cf5c73d591d135e (patch)
tree8e10e55698a95083f813f9b6ee171ef53aaa6e6d /source/blender/python/api2_2x/matrix.c
parent4cb838d54f6a84e2717fce580a65d205f3980b03 (diff)
[ #3661 ] resize4x4 in Matrix class doesn't set ones on the diagonal
* resizing a matrix now puts 1's back on the diagonals.
Diffstat (limited to 'source/blender/python/api2_2x/matrix.c')
-rw-r--r--source/blender/python/api2_2x/matrix.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c
index d1e6a53bae5..c66482eab1c 100644
--- a/source/blender/python/api2_2x/matrix.c
+++ b/source/blender/python/api2_2x/matrix.c
@@ -100,7 +100,7 @@ PyObject *Matrix_toEuler(MatrixObject * self)
//---------------------------Matrix.resize4x4() ------------------
PyObject *Matrix_Resize4x4(MatrixObject * self)
{
- int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows;
+ int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index;
if(self->data.blend_data){
return EXPP_ReturnPyObjError(PyExc_TypeError,
@@ -125,7 +125,12 @@ PyObject *Matrix_Resize4x4(MatrixObject * self)
//move data to new spot in array + clean
for(blank_rows = (4 - self->rowSize); blank_rows > 0; blank_rows--){
for(x = 0; x < 4; x++){
- self->contigPtr[(4 * (self->rowSize + (blank_rows - 1))) + x] = 0.0f;
+ index = (4 * (self->rowSize + (blank_rows - 1))) + x;
+ if (index == 10 || index == 15){
+ self->contigPtr[index] = 1.0f;
+ }else{
+ self->contigPtr[index] = 0.0f;
+ }
}
}
for(x = 1; x <= self->rowSize; x++){