1
$\begingroup$

I'm trying to get the current evaluated transform from a simulated rigid body. I have tried to use the evaluated depsgraph but that doesn't seems to work like expected:

obj = bpy.context.object
dg = bpy.context.evaluated_depsgraph_get()
dg.update()
eval = obj.evaluated_get(dg)
eval.matrix_world
obj.matrix_world

This returns the same thing for both the non evaluated and the evaluated object.

>>> obj = bpy.context.object
>>> dg = bpy.context.evaluated_depsgraph_get()
>>> dg.update()
>>> eval = obj.evaluated_get(dg)
>>> eval.matrix_world
Matrix(((0.7632400989532471, -0.6457931399345398, 0.020389333367347717, 2.950727939605713),
        (0.6242920756340027, 0.728961706161499, -0.2808455526828766, -4.03101921081543),
        (0.1665050983428955, 0.22708149254322052, 0.9595363736152649, 4.02522611618042),
        (0.0, 0.0, 0.0, 1.0)))

>>> obj.matrix_world
Matrix(((0.7632400989532471, -0.6457931399345398, 0.020389333367347717, 2.950727939605713),
        (0.6242920756340027, 0.728961706161499, -0.2808455526828766, -4.03101921081543),
        (0.1665050983428955, 0.22708149254322052, 0.9595363736152649, 4.02522611618042),
        (0.0, 0.0, 0.0, 1.0)))

How could I solve this?

$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .