0
votes

If I want the position to be based off of one of the corners of an object how do I do that? I currently have an editable poly that I'm setting the x, y position values for with a default z of 0.

obj.pos = [700, 700, 0]

This is moving the object's center point to that position which I don't want. I found a function for selecting all vertices but I'm not sure what to do with it. Current use is just causing all objects to stack at the world origin [0,0,0] so that's no good.

verts = obj.selectedVerts
for v in verts do
(
v.pos = [(v.pos.x+700), (v.pos.y+700), (v.pos.z+0)]
)
1

1 Answers

0
votes

I believe I figured it out. All I had to do was adjust the pivot of the plane object. No need to convert it to an editable poly after all.

obj.pivot = [(-(obj.width)/2)as Integer, ((obj.length)/2)as Integer, 0]

This made it so that the pivot point was located at the top left corner of the object instead of at the center. You can reset it to center by doing:

obj.pivot = [0, 0, 0]

This is assuming the object hasn't already been moved.