Notifications
Clear all

[Closed] getting vertex position within unwrap modifier

Hi guys!

I can figure out how to do this. I want to read the position of a vertex within the unwrap, to round it value in X axes. (ej: vertex1 = 2.345 and move it to 2)

the help says that:

<void><Unwrap_UVW>.sketch <int array>indexList <point3 array>positionList

but am not able to undertand it so I cant do it. I dont even know if this is what I should use :S

To round the value I’ll use this:


-- rounds a value to n decimal places
fn round_to val n = 
(
local mult = 10.0 ^ n
(floor ((val * mult) + 0.5)) / mult
)

-- example
(round_to 3.625 0) as integer

4 Replies
 fn roundFloat d pre:0.001 = 
 (
 	d /= pre
 	(if (d - (v1 = floor d)) > ((v2 = ceil d) - d) then v2 else v1)*pre
 )

Hi DenisT!

Thanks for your reply! But I dont get it. Is it to round a float value?

My problem is that I dont know wich sentence I have to write to get as answer the value of the X asexs from a vertex inside the unwrap modifier, to be able to change that value and round it

Find and download TexTools.
Unzip the mzp installer and look at the ms files.
You will find how th get the position of a UVW vertex and how to move it.
The function from Denis will helps you to round the position of the vert.

Thanks miauu!

I have find what I wanted in thoes scripts :D! Thanks a lot! I will share the script when I finish it