Hey guys i wanted to start learning scripting, and that's why i want to write a small script helping me UV unwrap what i want to create is a tool that allows me to select 2 vertices in my uv editor and align them on the U or V axis by rotating the entire cluster. could you guys help me or give me any advice how to start…
thank you very much for the answers! no i never scripted before are there any tutorial out there, where i could learn what i need to konw to write such a script?
thanks for the answer, but the mel script that i used, also used math and trigenometrie to calculate how much to rotate, i dont see, why it should not be as accurate as the phython script. i'm talking about the marktin menu in maya, my bad :)
Have you done any scripting before? That might be a bit too difficult for a first script. But basically just store the X/Y of each vertex, treat them as a right triangle to get their X/Y distances and hypotenuse, then get the rotation angle in degrees and rotate the entire shell based on that.
I don't think Python is any more "accurate" at math than MEL is. The reasons why you pick Python over MEL are others: -Much faster (something which becomes clear when you deal with many objects/components or perform math-based operations) -Much better syntax - more readable and not as hard to fuck up with -You still have…
What mark up menu are you talking about? Accuracy - when you have 2 positions of a straight line, you can use math to find the exact angpe that line is doing. You know, math stuff. Python offers you the function to do exactly that. In a sense you can re-write that function yourself if you know the math behind it.
Nightshade UV Editor 2.0.1 has this feature. Select an edge or two UV's and run "Orient Edge". See my signature for the download link. If you still want to code this yourself then you need to calculate the arc tangent in degrees. You will get a result ranging between -90 and +90 degrees - which is the value that you need…