Page MenuHome

Child Of Constraint does not allow to set inverse matrix via python API
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Short description of error
Can not create a child of constraint and set it's inverse matrix in python due to the automatic execution of inverse matrix calculation introduced by this commit rBad70d4b0956f5f06f45414cdfae2e2dc19505d71

Exact steps for others to reproduce the error

Run the included script,
Check the constraint's inverse matrix by running this in the console

C.object.constraints['Child Of'].inverse_matrix

It will give you the following matrix:

Matrix(((1.0, -0.0, 0.0, -0.0),
        (-0.0, 1.0, -0.0, 0.0),
        (0.0, -0.0, 1.0, -0.0),
        (-0.0, 0.0, -0.0, 1.0)))

Which is different than the one the script tried to set:

constraint.inverse_matrix = ((-1.0, -0.0, 0.0, -0.0),
							(-0.0, -1.0, -0.0, 0.0),
							(0.0, -0.0, 1.0, -0.0),
							(-0.0, 0.0, -0.0, 1.0))