Hello Everyone I am trying to write an add on that swaps the positions of 2 components
but it is driving me crazy. I though it was going to be so simple but I can’t get it to work.
I tried the script below and the crazy thing is that when I print the position values of comp2
for the second time they do match the position values of comp1 in the output panel.
but the components do not move at all they stay in the same place.
Any ideas?
def ReplacePosition(comp1, comp2):
print "Replacing Position"
print comp1.Name
print comp1.PositionMatrix.P.X
print comp1.PositionMatrix.P.Y
print comp1.PositionMatrix.P.Z
print comp2.Name
print comp2.PositionMatrix.P.X
print comp2.PositionMatrix.P.Y
print comp2.PositionMatrix.P.Z
comp2.PositionMatrix = vcMatrix.new(comp1.PositionMatrix)
print comp2.Name
print comp2.PositionMatrix.P.X
print comp2.PositionMatrix.P.Y
print comp2.PositionMatrix.P.Z
sim.update()
app.resetSimulation()