Hi,
I understand retrieving world space has been discussed before like in this thread (https://plugincafe.maxon.net/topic/11586/get-deformed-points-from-skin-deformer)
Sorry for asking the questions, but I can't seem to set the Vector Y of the points to 0 (in world space). Basically, I'm mimicking the "Set Point Value" command.
You can see an illustration of the problem here:
https://www.dropbox.com/s/v7ty3z52hh0ie89/c4d103_set_y_vector_to_world_zero.png?dl=0
For the illustration file, you can check it here:
https://www.dropbox.com/s/takdka6wkj4jw71/c4d103_set_y_vector_to_world_zero.c4d?dl=0
The code used is as follow:
import c4d
def set_Y_vector(obj, value):
oldPoints = obj.GetAllPoints()
obj_mat = obj.GetMg()
inv_obj_mat = ~obj_mat # Not used
newLocalPoints = [c4d.Vector(p[0], p[1]*value, p[2]) for p in oldPoints]
# The zero Y value in newLocalPoints is in local space. So I'm trying to convert it on global space below
newWorldPoints = [p * obj_mat for p in newLocalPoints]
obj.SetAllPoints(newWorldPoints)
obj.Message (c4d.MSG_UPDATE)
c4d.EventAdd()
set_Y_vector(op, 0)
Is there a way around this?
Thank you for looking at the problem.