Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#24660] (vector * matrix) fails, (matrix * vector) succeeds

Date:
2010-11-11 12:34
Priority:
3
State:
Closed
Submitted by:
Tom Edwards (artfunkel)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Python
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
(vector * matrix) fails, (matrix * vector) succeeds
Detailed description
See the attached blend for a demonstration. Here is the code:


import bpy

loc = bpy.data.objects['Plane'].data.vertices[0].co
mat = bpy.data.objects['Plane'].matrix_world

print(loc) # [0,-2,0], local position

print(loc*mat) # [0,-2,0], no change
print(mat*loc) # [0,-2,2], correct worldspace position

Followup

Message
  • Date: 2010-11-11 12:57
  • Sender: Ton Roosendaal
  • For campbell to check on. Note that matrix multiplication is not commutative. AB is not equal to BA.
  • Date: 2010-11-12 02:49
  • Sender: Campbell Barton
  • your correct, really good you noticed this now.
    from looking into numpy and scientific python libs this is standard.

    changed r33029.
 

Attached Files:

Name Date Download
vm-mv.blend 2010-11-11 12:34 Download

Changes:

Field Old Value Date By
ResolutionInvestigate2010-11-12 02:49campbellbarton
close_date2010-11-12 02:492010-11-12 02:49campbellbarton
status_idOpen2010-11-12 02:49campbellbarton
ResolutionNone2010-11-11 12:57ton
assigned_tonone2010-11-11 12:57ton
File Added13518: vm-mv.blend2010-11-11 12:34artfunkel