Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having problems changing the realWorldMapSize on a UVWMap

7 REPLIES 7
Reply
Message 1 of 8
RayCollett
431 Views, 7 Replies

Having problems changing the realWorldMapSize on a UVWMap

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

Making pixels with Max since 3DS Max R2
7 REPLIES 7
Message 2 of 8
Steve_Curley
in reply to: RayCollett

How odd. It works fine here the other way around. Preference is Off, code to turn it on just works as expected, but with the preference On it refuses to turn it off (in the UVWMap, works on the base object).
Only way I could get it to work was to add the modifier, select the object, modify mode, then change the property.
(
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.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 3 of 8
RayCollett
in reply to: Steve_Curley

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

Making pixels with Max since 3DS Max R2
Message 4 of 8
Steve_Curley
in reply to: RayCollett

That would be my guess too, but then why does it work here with the option off? Unless it's because I have Max, not design.
Not tried any others, but there's quite a few with that option in them.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 5 of 8
kevinvandecar
in reply to: RayCollett

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


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



Message 6 of 8

The only potential issue is that using Max Modify Mode tends to be slow compared to "normal" maxscript instructions. If the scripts create many objects this could become a problem, if there's only a few then it should be ok.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 7 of 8
RayCollett
in reply to: Steve_Curley

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)

 

 

Making pixels with Max since 3DS Max R2
Message 8 of 8
Steve_Curley
in reply to: RayCollett

http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=GUID-27F58B25-C61E-4658-AB1E-7A6C20B23D1F
Has a list of all affected features, including Modifiers. I suspect, from a brief glance, that the UVWMap is the only one. I just tried with a Shape + Extrude and that seems to work as expected without the need for Max Modify Mode.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report