A few issues I found in:
C:\Program Files\Maxon Cinema 4D 2023\resource\modules\python\libs\python39\c4d_init_.py
Line numbers are on the left
36819: >>> # Matrix multiplication is not communicative, i.e., executing the transforms in a
36820: >>> # different order will yield another matrix product.
36821: >>> Z * Y * X
36822: >>> Matrix(v1: (0.5, -0.5, -0.707); v2: (0.146, 0.854, -0.5); v3: (0.854, 0.146, 0.5); off: (0, 0, 0))
36819: >>> # Matrix multiplication is not
communicative commutative , i.e., executing the transforms in a
36820: >>> # different order
wil yield another may result in a completely different matrix product.
...
36822:
>>> Matrix(v1: (0.5, -0.5, -0.707); v2: (0.146, 0.854, -0.5); v3: (0.854, 0.146, 0.5); off: (0, 0, 0))
-------^ Remove erroneous >>> prefix from this line
Also, use of id
for a parameter name in this code (and perhaps other places) is highly discouraged, because such use shadows the built-in function id()
.
E.g.:
>>> help(id)
Help on built-in function id in module builtins:
id(obj, /)
Return the identity of an object.
This is guaranteed to be unique among simultaneously existing objects.
(CPython uses the object's memory address.)
A simple suffix in front of id
would be a good way to fix the issue and make the code more informative. E.g.:
ob_id: int
sub_cont_id: int
# Etc.
I realize that id
is used all over the code and this may not be a simple change, so just a suggested possibility for the next major set of refactoring changes.
Finally the use of l
as a variable name is highly discouraged (see: PEP 8: E741), because it can be easily mistaken for the digit 1
, as you can clearly even see within the context of this forum's formatting of the two code excerpts for l
and 1
! I see that the variable name v
is used for floating point values and the same name could be used for integral values, as well.
For example, change:
37717: def SetInt32(self, id: int, l: int) -> None:
..., to:
37717: def SetInt32(self, id: int, v: int) -> None:
# ---------------------------------^