Hello, I try to manipulate a polygon point in Python with the SetPoint() command.
So for instance I want to double the Values for X,Y en Z of point[0] = testPnt (for instance Vector(1,1,1))
I use the values of the point to double them. (I used the '×' to indicate multiplication the '*' messes up the post)
op.SetPoint(0,c4d.Vector(testPnt.x×2,testPnt.y×2,testPnt.z×2))
If later somewhere else in my code I change these values again, say I triple them
op.SetPoint(0,c4d.Vector(testPnt.x×3,testPnt.y×3,testPnt.z×3))
and print the values I still get the unchanged values. i.e. Vector(1,1,1)
I want to get (6,6,6) at the end.
Here my testing code:
def main():
op = doc.GetActiveObject() #select a polygon object with Point[0] at (1,1,1) as example
puntenLijst = op.GetAllPoints()
testPnt = puntenLijst[0]
print 'pnt0 at start: ' ,testPnt # check the coordinates before manipulation
*#prints: pnt0 at start: Vector(1,1,1) ok*
op.SetPoint(0,c4d.Vector(testPnt.x*2,testPnt.y*2,testPnt.z*2))
print 'pnt0 after SetPoint:' ,testPnt
*#prints: pnt0 after SetPoint: Vector(1,1,1) not ok, got to send Message(c4d.MSG_UPDATE)*
op.Message (c4d.MSG_UPDATE)
print 'pnt0 after MSG_UPDATE' ,testPnt
*#prints: pnt0 after MSG_UPDATE: Vector(1,1,1) not ok, got to do the c4d.EventAdd()*
c4d.EventAdd()
print 'pnt0 after c4d.EventAdd():' ,testPnt
*#prints: pnt0 after c4d.EventAdd(): Vector(1,1,1) not ok, got to do ??*
op.SetPoint(0,c4d.Vector(testPnt.x*3,testPnt.y*3,testPnt.z*3))
print testPnt
# hoping for Vector(6,6,6) but nope got Vector(1,1,1)
finaly in the Structure Manager after running this code the point has coordinates (3,3,3) and not (6,6,6) the last SetPoint used the startingpoint(1,1,1) and I want to continue with the changed values i.e. (2,2,2)