Notifications
Clear all

[Closed] Why the uvw_mapping length(width) is not equal the box length(width)?

hi,everybody
i try this ms:


b = box()
W = b.max.x – b.min.x
L = b.max.y – b.min.y
addModifier b (uvwmap())
mod_L = b.uvw_mapping.width
mod_L = b.uvw_mapping.length

get result:


$Box:Box01 @ [0.000000,0.000000,0.000000]
25.0
25.0
OK
25.025
25.025
OK

i wonder the box.uvw_mapping.width != the box.width?

It looks like (b.uvw_mapping.width – b.width) = b.width/1000

this is why?

any reply are very grateful

2 Replies

This also happens when you manually assign a uvw modifier to an object. It has been like this since Max 1 and possibly even before that. Adding 1/1000 prevents a texture from tiling on the edges of your object caused by roundoff errors.

Martijn

Thank you,Martijn
You are so quick

And I have the second question:
I have two teapots and run this ms:

obj = getCurrentSelection()
obj.count
for i in obj do
(
addModifier i (uvwmap())
if i.uvw_mapping.width > i.uvw_mapping.length then
(
size = i.uvw_mapping.width
)
else
(
size = i.uvw_mapping.length
)
print size
deleteModifier i 1
)

When only a teapot is selected,get:

#($Teapot:Teapot02 @ [-5.358948,-63.382111,0.000000])
1
40.3532
OK
OK

The size is right!

But two teapots are selected,get:

#($Teapot:Teapot02 @ [-5.358948,-63.382111,0.000000], $Teapot:Teapot01 @ [-36.750366,-54.127594,0.000000])
2
1.0
1.0
OK
OK

The size is 1.0!

why?