I'm having problems making the realWorldMapSize setting stick in my max scripts. I've tried it several different ways and it refuses to work for me.
Max 2015 Design (17.0 SP2, Extension 1)
In Preferences -> General, the Use Real-World Texture Coordinates is enabled
(
newObj = plane ()
addModifier newObj (UVWMap realWorldMapSize:false)
print newObj.modifiers[1].realWorldMapSize
)
This code prints false, but in the modifiers panel, the UVW Map has the checkbox enabled. I've also tried the following:
( newObj = plane () newMod = UVWMap realWorldMapSize:false addModifier newObj newMod )
( newObj = plane () newMod = UVWMap () newMod.realWorldMapSize = false addModifier newObj newMod )
( newObj = plane () newMod = UVWMap () addModifier newObj newMod newMod.modifiers[1].realWorldMapSize = false )
( newObj = plane () select newObj modPanel.addModToSelection (UVWMap realWorldMapSize:false) )
None of these methods seem to work. I can include print statements within the code and it always reports back that the RWS is false, but when I check the modpanel it's on.
All my prior installs of Max has had the program preferences set to RWS off, but my artists have wanted this option enabled so I caved in this time and now it's causing me problems. I'm now needing to make these explisit RWS off commands in all the scripts I have written over the years.
Thanks for any ideas/solutions!
Ray
( obj = plane() obj.realWorldMapSize = false addmodifier obj (UVWMap()) select obj max modify mode obj.modifiers[1].realWorldMapSize = false )If I could find a way to flip the preference (turn it off at the beginning of the script and back on at the end) then that would be a whole lot easier, but I can't see how to do that.
Thanks Steve, at least I know I'm not loosing my mind. This seems to be a bug to me. The RWS preferences should be considered at the moment the UVWMap modifier is created, not after the script has completed. I assume that triggering the max modify mode somehow finalizes the creation of the object and triggers the code that blindly sets the RWS system preferences. I wonder what other modifiers have this issue?
Ray
Yes, I also confirmed it behaves badly and can report it.
But is the workaround acceptable that was specified by Steve? I also tested it and it seems like a viable solution. What I can guess is that the constructor initialization order is goofed up and overrides the intialization with the preference, instead of keeping the explicit value passed in. Once it is constructed, then you can change it afterwards.
Thanks,
Kevin
Correct, the use of the max modify mode does work for now as a workaround, but as noted it will probably be a lot slower than if it worked properly. I also wonder if other modifiers are effected by this same issue. I have not had time to try any of the others out.
I did report this. If anyone cares, here is the bug number and title.
BSPR-16427 RWS option in UVWMap gets overwritten to TRUE if global RWS preference is enable
(BTW, I think it's really stupid that the bug report form has an 80 character limit on the title, yet there is no mention of that on the form unless you exceed it, plus there is no character counter to let you know how many characters are in use. grrr)