Skip to main content
replaced http://blender.stackexchange.com/ with https://blender.stackexchange.com/
Source Link

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parentingparenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).


The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).


The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).


The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).

added 142 characters in body
Source Link
David
  • 49.7k
  • 40
  • 162
  • 318

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).


The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).


The blender wiki has a good read for further explanation about the coordinates for parented objects (same principals for constraints).

Source Link
David
  • 49.7k
  • 40
  • 162
  • 318

object.location will never give the "correct" position for a object that has a constraint on it (or a parented object).
That comes from the way parenting and constraints mess with the global coordinates (their effect gets calculated after the object.location).

To get the world position of the a child object (or an object governed by a constraint) you should use object.matrix_world.translation.
matrix_world returns a matrix for the object's transformations in world space. The .translation part will convert the matrix to a location vector (just like .location).