Notifications
Clear all

[Closed] setting an objects orientation – help needed

hi guys,

I’m quite new with max scripts (yesterday evening was my first time). Untill now the reference was really helpful but then I got stuck and I hope you can help me…

I want to be able to set my object’s orientation by inputing an absolute angle (0-360).
Not like position and scale, I couldn’t find a way to do that. the only thing
I found is a way to rotate by an angle (relatively to a previous orientation).
To be more clear, I can write something like –
b = box()

b.pos = [0,0,0]
b.scale = [1,1,2]

but –
b.rotate/orient – does not exist.

any thought on that?

thanks,
yoni

12 Replies
 PEN

b.rotation.x_rotation will do what you are looking for. This is assuming default controllers.

thanks man, I knew it had to be something like that, but i just couldn’t find it.

Btw, can I find this somewhere in the reference? maybe i’m not looking right?

You can find help on this on the maxscript reference under a topic called node transfrom properties

/Lui

thanks lui, I’ll check it out.

Another one – What is the function that stands for “link” in max (I’m trying to link between a box to another abject)? the only thing I found was a class called link_constraint but couldn’t figure out how to link between the two object.

many many thanks,
yoni

$blah.parent = $blahparent

mark

hi mark,
can you elaborate a bit, I don’t think I understand
thanks

say you have an object named blah and an object named blahparent
you want to link blah to blahparent

$blah.parent = $blahparent

Hi yonathangz, one thing you could do that might be enough depending on what you want to do is use the objects [color=wheat].dir wich[/color] is the way the objects local z-axis is pointing. So if you supply it with a normal-direction you can say obj.dir = [1,0,0] and it will point the object in the x-axis direction.

cheers,
CML

Rivendale, thanks but I got it with the object.rotation. (still it might come useful in my project).

mark, the “$” is like a pointer or something? when do you use it?

thanks,
yoni

Page 1 / 2