Previous Thread  Next Thread

chat icon Matrix inconsistencies

z0r

Posted: Wed Oct 18, 2006 5:03 pm
Joined: 18 Oct 2006
Posts: 3
Hi! I'm having trouble with a script I'm writing. I think I've found a bug in Blender, but I thought I'd ask here first.

The script multiplies two transformation matrices together and applies them to an object. In the 3D view this works fine, but when the scene is rendered the object has a different transform. It retains the new (different) transform in the 3D view after rendering.

The object has a parent. I've found that calling object.getMatrix('localspace') is safe, but as soon as object.getMatrix('worldspace') is called, it obtains a new transform.

An example .blend is available at http://phatcore.com/projects/files/EyeDemo.blend. Instructions are available at http://phatcore.com/projects/Track_And_Transform.php. Try rendering the scene after setting up the tracker. Sorry, my site seems to be down at the moment but will hopefully be back online soon! - Edit: Back online now.

So, is this a bug, or am I missing something?

Cheers,
Alex

Last edited by z0r on Thu Oct 19, 2006 4:21 am; edited 1 time in total
Reply with quote


z0r

Posted: Wed Oct 18, 2006 5:14 pm
Joined: 18 Oct 2006
Posts: 3
Here's an excerpt from my script (GPL'd) for reference until my site is back online:

Code:

   # Transform the mesh to match the LOCAL rotation of the tracker.
   tmx = tracker.getMatrix('localspace').rotationPart().resize4x4()
   # Transform again, this time to match the FinalSpace object
   # (which will generally be used for scaling).
   fmx = finalSpace.getMatrix('worldspace')
   
   object.setMatrix(tmx *  fmx)
   # object.getMatrix('worldspace')


If the final line is un-commented, the incorrect transform is applied even in the 3D view. Otherwise, it works as I expect it to.
Reply with quote


z0r

Posted: Wed Oct 10, 2007 2:51 am
Joined: 18 Oct 2006
Posts: 3
This issue won't be fixed - it turns out this type of matrix transformation is not supported by Blender. See this bug report.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group