THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/04/2011 at 10:12, xxxxxxxx wrote:
Hi,
I'm trying to convert my Coffee code that rotates the axis of an object to Python. But my Coffee example uses two functions called GetMulM() & GetMulP(). Which aren't in the Python SDK.
import c4d
from c4d import gui
def main() :
newMatrix = c4d.Matrix(c4d.Vector(45), c4d.Vector(0), c4d.Vector(0), c4d.Vector(0))
obj = doc.GetActiveObject()
points = obj.GetAllPoints();
count = obj.GetPointCount();
mLocal = obj.GetMl() # the local matrix
mGlobal = mLocal.GetMulM(newMatrix) # <------How to do this with python?
obj.SetMl(mGlobal)
invertedMatrix = newMatrix.GetClone()
invertedMatrix.Invert()
for i in range(len(points)) :
points[i] = invertedMatrix.GetMulP(points[i]) # <------How to do this with python?
# Write the points back to the object.
obj.SetPoints(points)
obj.Message(MSG_UPDATE)
c4d.EventAdd()
if __name__=='__main__':
main()
Does anyone know how to convert this to Python?
-ScottA