ok soo i have made a new shelf and i have made a command that rotates an object 90 degrees. but it only rotates once.. i need it to continually be able to rotate any ideas guys? thanks.
i also have hotkeys for rotating it and i made to hotkeys rotate 90 and rotate 180 and i can switch between the 2 and get the right effect but then theres also moving the object left and right. i need to be able to move it 10 spaces each time i use the command not just move TO 10.. do u guys know wat im talking about??
You could try this code. It grabs the first object in the selection (by the sounds of it you would have only 1 item selected anyway). It stores the current translation X value and adds 10. You could add checks to throw warnings if nothing is selected or the attribute doesn't exist on the object but maybe that's overkill.
Code:
// get obj
string $sel[] = `ls -sl`;
string $obj= $sel[0];
// get current translate x value
int $translateX_value = `getAttr ($obj+ ".translateX")`;
// add 10 to said value
setAttr ($obj+ ".translateX") ($translateX_value + 10);
Yes, you're probably doing it wrong.
It might be helpful to know a) What your experience level is with MEL and b) What exactly you did to create the rotater hotkeys.
that command works on the current selection, so for example if you run `rotate -r - os 10 0 0;`
it will add 10 to the degrees to the x ( sorry forgot to say this command expects a vector, i put the x in to as the variable, it doesnt define the axis.
ok well for the rotater hotkeys i just went to the hotkey editor and made a few custom hotkeys and then used the commands rotate -90 x etc.. i made one for rotating it -90 +90 -180 +180 and 0 degrees.. see wats happening and i realize t now is that i have the commands/hotkeys to rotate the object to the desired degree.. ex: -90.. but i want to be able to keep rotating the object everytime i use the hotkey that way there is only one key i have to use to keep rotating the object untill i get the desired effect is there a script or command i can use that can like set the origin of the object after it rotates soo i can then rotate it from there.. i hope you understand wat im talking about i feel like im talking gibberish!!
What you're saying is making sense, but I really feel like you should take a bit of time off this Tetris project and learn some scripting (MEL, and Python if you feel like going the extra mile). What you're asking about is quite simple using MEL, but if you don't understand the foundation of it, you'll be asking for help with every single step. I hope that's reasonable, and you understand my reason for saying so.
no i understand and actually right now i'm spending every minute i can studying MEL and scripting.. and i am learning alot. But i have just touched the tip of the iceberg. so thanks i'll try to figure it out on my own.
You may not post new threads |
You may not post replies |
You may not post attachments |
You may not edit your posts |
BB code is On |
Smilies are On |
[IMG] code is On |
HTML code is Off