CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 09-20-2011, 04:03 AM   #1
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
Setting viewport antialiasing through maxscript

How can I set d3d viewport antialiasing sample settings (None/8 Samples) with maxscript?
What I'm trying to achieve is very similar to this:
http://forums.cgsociety.org/showpos...947&postcount=6
I tried to modify it but couldn't get it working.
Anyone could help?
 
Old 09-21-2011, 04:19 PM   #2
Panayot
Frequenter
portfolio
Panayot Karabakalov
Technical Artist
Bulgaria
 
Join Date: Mar 2011
Posts: 212
I'm in Max 2009 and here still not such settings for Direcr3D, but recently friend of mine with Max 2011 ask me the same script. In his config dialog he has only 3 items to choose from ("None", "2 Samples", "4 Samples"), so I made a script to toggle those combobox by index between 0 and 2 (first and third) item. I have no idea how to check how many items has this combobox, so if you has more items, modify that index. The script is tested on Max 2011 only. I hope it helps anyway.
Attached Files
File Type: txt toggleD3DAASamples.ms.txt (2.3 KB, 26 views)
__________________
* everyone can win previous war
 
Old 09-21-2011, 04:53 PM   #3
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,865
Send a message via ICQ to denisT
don't go wild, everything is much easier:
Code:
dx_ini = getdir #maxroot + "d3dgfx.ini" AALines = getINISetting dx_ini #Settings "AALines" setINISetting dx_ini #Settings "AALines" (1 as string) -- enable Antialised Lines AAQuality = getINISetting dx_ini #Settings "AAQuality" setINISetting dx_ini #Settings "AAQuality" (2 as string) -- set Antialiasing to "2 samples" --- changes will take effect next time you start MAX
 
Old 09-21-2011, 05:15 PM   #4
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
@Panayot

Thank you very much!!! it was easy to adapt it for 8x. I just changed state to 3.

@denisT

Thanks. It's indeed easily altered by editing the .ini file but unfortunately as you mentioned max needs to be restarted. But Panayot's script makes this change on-the-fly.
 
Old 09-21-2011, 06:09 PM   #5
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,865
Send a message via ICQ to denisT
Quote:
Originally Posted by halloween
Panayot's script makes this change on-the-fly.


no, it doesn't. you have to restart max to take effect of the change.
 
Old 09-21-2011, 10:08 PM   #6
Panayot
Frequenter
portfolio
Panayot Karabakalov
Technical Artist
Bulgaria
 
Join Date: Mar 2011
Posts: 212
Quote:
Originally Posted by denisT
don't go wild, everything is much easier:
Code:
dx_ini = getdir #maxroot + "d3dgfx.ini" AALines = getINISetting dx_ini #Settings "AALines" setINISetting dx_ini #Settings "AALines" (1 as string) -- enable Antialised Lines AAQuality = getINISetting dx_ini #Settings "AAQuality" setINISetting dx_ini #Settings "AAQuality" (2 as string) -- set Antialiasing to "2 samples" --- changes will take effect next time you start MAX

Nice!
Just to remember, I'm on Max 2009 and no such ini file here.
I just make a friendly favour with what I have
__________________
* everyone can win previous war
 
Old 09-21-2011, 10:35 PM   #7
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
Quote:
Originally Posted by denisT
no, it doesn't. you have to restart max to take effect of the change.


Then how come I can see the antialiasing effect on viewport instantly after executing the script, without even restarting max? Is it related to graphics card, or its driver or 3ds max version?
 
Old 09-21-2011, 10:48 PM   #8
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,865
Send a message via ICQ to denisT
Quote:
Originally Posted by halloween
Then how come I can see the antialiasing effect on viewport instantly after executing the script, without even restarting max?


the answer is very simple. NO WAY. you can't see effect without restarting max, and max tells you about it every time when you change any configuration parameter manually.
 
Old 09-22-2011, 04:47 AM   #9
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
Quote:
Originally Posted by denisT
the answer is very simple. NO WAY. you can't see effect without restarting max, and max tells you about it every time when you change any configuration parameter manually.


I dont know why but none of those configuration parameters showing me any restart warning and they're being applied after closing the dialogue. Check this:

http://www.youtube.com/watch?v=diNV9Mcfu9c
 
Old 09-22-2011, 05:13 AM   #10
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,865
Send a message via ICQ to denisT
probably you have a gift version of max ...
 
Old 09-22-2011, 09:39 AM   #11
Kameleon
Expert
 
Kameleon's Avatar
portfolio
Artur Leao
Co-Founder / Project Manager
You can do it! VFX
Porto, Portugal
 
Join Date: Sep 2004
Posts: 1,030
Or simply because he has a Quadro? :P
__________________
Artur Leao | Co-Founder / Project Manager
You can do it! VFX
Porto/Lisbon - Portugal
http://www.ycdivfx.com
 
Old 09-22-2011, 10:25 AM   #12
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
And this is how Panayot's uiaccessor script works:
http://www.youtube.com/watch?v=f6kb5fW8lmo
Script's first run takes couple of seconds, but subsequent runs are almost instant.
 
Old 09-22-2011, 11:00 AM   #13
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,865
Send a message via ICQ to denisT
could you give your max version, graphic card, and drivers version please?
 
Old 09-22-2011, 11:09 AM   #14
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92
max: 2012 x64 (sp1 and hotfixes installed)
card: Quadro 4000
driver: 280.19
 
Old 09-22-2011, 11:17 AM   #15
halloween
Veteran
 
halloween's Avatar
Evren
Turkey
 
Join Date: May 2004
Posts: 92


and these are my d3d settings, it's relevant maybe?
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:27 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.