Notifications
Clear all

[Closed] Easy question…?

I’m kinda new to maxscript and i’m stumbling upon something that should be quite easy.

I’m trying to place a zero position XYZ X axis into a variable

I can move it use those 2 lines

t =$Teapot001
at time 100 animate on t.pos.controller.Zero_Pos_XYZ.controller.X_Position = 200

but I what i’d like to do is to place the t.pos.controller.Zero_Pos_XYZ.controller.X_Position into a variable but I cant do it

What am I missing?

6 Replies

nvm that
got it working using
tbc = t.pos.controller.Zero_Pos_XYZ.controller[1].controller

Fairly new to maxscript myself, so I hope this helps.

Copy ALL of the code below. Obviously you need an object named Teapot001 in the scene

/*The below varibles hold the Teapots current position in x,y,z */
currentX = t.pos.x
currentY = t.pos.y
currentZ = t.pos.z

/Replace any of the below values after the = sign with currentX, currentY, currentZ above to leave that value alone i.e “y = currentY”/
x= 0
y = 0
z = 0

t =$Teapot001
t.position = [x,y,z]

Position is a Point 3, xyz value so expects 3 numbers in brackets such as:
[0,0,0]
[10,10,10]
[-10,20,30]
with animate on at time 100 do $Teapot001.pos = [0,0,0]

Thats strange. I know what you mean about entering numerical values only, but to keep the current x,y or z I simply used the currentX variable above and it worked fine.

Maybe there is a better way to leave current x,y,z positions intact, like I say I’m still quite new to it myself.

[0,0,0] is a point 3 value so you can access values individually too

a = [0,0,0]
a.x = 1
[1,0,0]

with animate on at time 100 do $Teapot001.pos.x = 1

thanks for all the answer … although I used
tbc = t.pos.controller.Zero_Pos_XYZ.controller[1].controller

to get results