[Closed] UVW Map modifier update
Hey there, it’s me again!
Another day, another question…
Using this code i apply a uvw map modifer to my selection:
themodifier = uvwmap name:"" maptype:0 realWorldMapSize:false length:50 width:50 axis:1 mapchannel:12
addModifier $ themodifier
(mapchannel 12 is intentional)
The modifier gets applied, but it doesn’t seem to work right (i think it doesn’t evaluate/update). I tried the “modPanel.addModToSelection <modifier>” method, i also tried the suggestion from another thread to update with “classoff $”, i also tried to change modifier parameters after applying it, nothing helped.
However i found out that if i select the modifier and hit the reset button it starts to work.
There is another thread with partially the same problem, but it doesn’t give me the solution to fix my problem.
Any ideas how to handle this?
everything works for me as expected. just has to be property used:
delete objects
(
channel = 12
s = sphere()
ch = Checker()
ch.coords.U_Tiling = ch.coords.V_Tiling = 4
ch.coords.mapchannel = channel
s.material = standard diffusemap:ch showinviewport:on
m = uvwmap name:"UV" maptype:0 realWorldMapSize:off length:50 width:50 axis:1 mapchannel:channel
addModifier s m
)
Okay, now i made a weird discovery.
If i add
themodifier.height = 200
it gets updated correctly.
The height does not affect my mapping anyway since i’m mapping planar. Weird thing is that width and length don’t update the modifier, but height does.
So my problem is solved for now. But does someone know why it behaves that way? Is this intentional?
denisT: The problem is when real world map size is active (there’s a checkbox in preferences), it overrides the realWorldMapSize property after the modifier is added to the object.
I made an example to show the behaviour.
delete objects
theteapot = teapot radius:50 segs:20 isSelected:on
themodifier = uvwmap name:"" maptype:0 realWorldMapSize:false length:50 width:50 axis:1 mapchannel:12
addModifier theteapot themodifier
thematerial = standardmaterial()
thenoise = noise()
thenoise.size = 0.1
thenoise.coords.coordType = 2
thenoise.coords.mapChannel = 12
thematerial.diffusemap = thenoise
theteapot.material = thematerial
themodifier.width = 50 -- doesn't help
themodifier.length = 50 -- doesn't help
--themodifier.height = 50 -- helps
Run this and render. For me the mapping doesn’t work properly.
If you uncomment the last line it works.
Working on max 2014…