Notifications
Clear all

[Closed] change code for 2009

hello, I trying to adjust the stereocam modifier script by louis marcoux. The problem is that when I use it in 3ds max 2009 I get an error while using the preview function, At the point of error in the script I found that the code he using is new feature in 2010, I was wondering if there was an alternate way to do the same thing in max 2009. I have highlighted the problematic code below.

execute(“viewport.settype #” + (OriginalType as string))

			viewport.setTM OriginalTM 
			[B]viewportbuttonMgr.EnableButtons = true		[/B]
5 Replies

Just add – in front of the offending line as it is not needed in 2009, or delete it completely.

Alternatively, you can add an IF test for Max version and only execute the line if Max 2010 or higher is running. For example

if (maxVersion())[1]/1000 > 11 do viewportbuttonMgr.EnableButtons = true		

(Max 2009 is version 11. The rule of thumb is that if you sum the digits of the year, you get the version – 2008 = 2+8 = 10, 2009 = 2+9 = 11, 2010 = 2+10= 12 and so on. This applies only to Max because version 10 was renamed 2008, it does not apply to Maya etc.)

unfortunately I think this script needs that line of code to work ie to make the preview. I was hoping that there was a way to do the same function with a simile code in 2009.

1 Reply
(@bobo)
Joined: 2 years ago

Posts: 0

That line deals with the visibility of the viewport “button text” which was broken lately and stays visible when creating a preview. In earlier versions of Max, the viewport labels would disappear automatically when performing a preview, so there was no need for that function and it did not exist.

Have you actually tried to disable the line before contradicting me?

Haha MR Bobo, it would be foolish of me to blindly contradict someone of your reputation, I must admit I did it hastily before I left work yesterday. So I will try again. Thanks for the explanations.

I tried again putting – in front of the code and also deleting the whole line but what happens is, when i press the preview button instead of seeing the geometry in anaglyph mode it just comes out white. I tried to dig around in the script and see if I could change it but i am quite new to scripting and this script is quite vast. If anyone would like to take a crack at it I would be grateful.