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 10-11-2011, 09:14 AM   #1
Zbuffer
Expert
Wanabee Scripter
Finland
 
Join Date: Jan 2003
Posts: 562
Maxscript local Help ?

Hi all,

How can I get Maxscript to use the local version instead of the online help?
I have downloaded the Maxscript htlm help, but can't find any way to use from within max.
I managed to get the general help to use the local version (preferences), but can't get it to work for the Maxscript help.

Any clues ?

Regards,
Zbuffer
 
Old 10-11-2011, 10:06 AM   #2
Nysuatro
Veteran
portfolio
Robbert-Jan Brems
Leuven, Belgium
 
Join Date: Oct 2005
Posts: 80
Send a message via MSN to Nysuatro
What version are you using?
Normally there is a helpfile in you programs folder

"C:\Program Files (x86)\Autodesk\3ds Max 2010\help\maxscript.chm"

If you just make a shortcut to that file on your desktop you do not have to connect anymore to the internet.
I did not knew max used the online version .. Is that since 2012 ?
__________________
Portfolio
 
Old 10-11-2011, 10:09 AM   #3
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,436
only way is to code a small macroscript and hook it to your preferred shortcut/menu.
something like

Code:
shelllaunch "D:\\3DSMax2012\\Help\\Maxscript\\index.html" ""


should do it...
Just change the path to your config
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
Old 10-11-2011, 12:17 PM   #4
lucpet
Know-it-All
 
lucpet's Avatar
portfolio
Luke Pettit
Canberra, Australia
 
Join Date: Oct 2006
Posts: 378
Quote:
Originally Posted by Zbuffer
Hi all,

How can I get Maxscript to use the local version instead of the online help?
I have downloaded the Maxscript htlm help, but can't find any way to use from within max.
I managed to get the general help to use the local version (preferences), but can't get it to work for the Maxscript help.

Any clues ?

Regards,
Zbuffer

From what I could work out you can have one or the other, but not both and the other ideas posted here may be your only choice.
__________________
Luke
Web site

3d Max 2012 Win 7
Intel Corei5 8g Ram

 
Old 10-15-2011, 02:35 PM   #5
Zbuffer
Expert
Wanabee Scripter
Finland
 
Join Date: Jan 2003
Posts: 562
Late reply...

I am using max 2012, so no .chm, only online help.
using 'customize/preferences/help' i can point to a local folder, but there is no setings for the maxScript help :(
shellLaunch can launch index but how to get the current word in Maxscript editor to be passed to the index, replacing the original F1 help that points to the online help ?
 
Old 01-28-2012, 08:58 PM   #6
S-ed
New Member
 
S-ed's Avatar
portfolio
Alexey Mak
a jack of all trades
St.Petersburg, Russia
 
Join Date: Aug 2002
Posts: 12
Send a message via ICQ to S-ed
Helps a little

Maxscript 2012 help launcher
But F1 still not working...
__________________
RTFM
 
Old 01-29-2012, 03:42 PM   #7
Zbuffer
Expert
Wanabee Scripter
Finland
 
Join Date: Jan 2003
Posts: 562
Need Help

Hi,
I have something... but it does not work and I need Help:

Thanks to the one and only DenisT, and his dotnet Magic,
I can retreive the word at the carret position in the editor.
But I can't get the parameters to work with "ShellLaunch"
it only opens the index.html file (and NOT the '?query=MySearch'
Any ideas ?
here is the script so far:
(click a word in MXS editor and evaluate)
Code:
/* MaxScript Local Help */ ( global Win32Assembly local MXS_HELP_DIR="D:/3D/3dsmax2012/maxscript-doc-2012/" fn CreateWin32Assembly forceRecompile:on = ( if forceRecompile or not iskindof ::Win32Assembly dotnetobject or (::Win32Assembly.GetType()).name != "Assembly" do ( source = "using System;\n" source += "using System.Runtime.InteropServices;\n" source += "using System.Text;\n" source += "class Win32\n" source += "{\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " public static extern Int32 SetFocus(Int32 hWnd);\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " internal static extern int GetWindowTextLength(Int32 hWnd);\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " internal static extern int GetWindowText(Int32 hWnd, [Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpString, int nMaxCount);\n" source += " public static string GetWindowText(Int32 hWnd)\n" source += " {\n" source += " int length = GetWindowTextLength(hWnd);\n" source += " StringBuilder sb = new StringBuilder(length + 1);\n" source += " GetWindowText(hWnd, sb, sb.Capacity);\n" source += " return sb.ToString();\n" source += " }\n" source += "}\n" csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider" compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters" compilerParams.ReferencedAssemblies.Add "System.dll" compilerParams.ReferencedAssemblies.Add "System.Drawing.dll" compilerParams.GenerateInMemory = true compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source) Win32Assembly = compilerResults.CompiledAssembly Win32Assembly.CreateInstance "Win32" ) ) global Win32 = CreateWin32Assembly() fn isStopChar s = ( local valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz_0123456789" local i = findstring valid s if i == undefined then true else false ) fn GetWord txt pos = ( local start = for i = pos to 1 by -1 do if (isStopChar txt[i]) do exit with (i+1) local end = for i = pos to txt.count do if (isStopChar txt[i]) do exit with i trimright(substring txt start (end-start)) ) fn LaunchHelp str = ( url="file:///"+MXS_HELP_DIR+"index.html?query=" + str format "URL:%\n" url ShellLaunch url "" ) fn GetWordatCarretPos = ( fn _mxs_Textbox = ( tb = for c in (windows.getchildrenhwnd 0) where c[4] == "MXS_SciTEWindow" do exit with ( for t in (windows.getchildrenhwnd c[1]) where t[4] == "MXS_Scintilla" do exit with t[1] ) if tb != ok then tb else undefined ) val=0 EM_GETSEL = 0x00B0 tb = _mxs_Textbox() tx = Win32.GetWindowText tb CarretPos = (windows.sendmessage tb EM_GETSEL val val)/65535 --print CarretPos --Win32.SetFocus tb GetWord tx CarretPos ) LaunchHelp (GetWordatCarretPos()) )
 
Old 01-29-2012, 10:57 PM   #8
Zbuffer
Expert
Wanabee Scripter
Finland
 
Join Date: Jan 2003
Posts: 562
OK,
I have this kind of working...
but I cannot assign a shortcut that will trigger it while in the MXS editor :(
Otherwise if you comment out the macroscript definition, you can test it on the script itself
Code:
/* MXS_Help.ms MaxScript Local Help Launcher dotnet User32 magic vastely inspired by DenisT */ macroscript MXS_HELP category:"MAX Script" toolTip:"Context Help" ( on execute do ( fn CreateWin32Assembly forceRecompile:off = ( if forceRecompile or not iskindof ::Win32Assembly dotnetobject or (::Win32Assembly.GetType()).name != "Assembly" do ( source = "using System;\n" source += "using System.Runtime.InteropServices;\n" source += "using System.Text;\n" source += "class Win32\n" source += "{\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " public static extern Int32 SetFocus(Int32 hWnd);\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " internal static extern int GetWindowTextLength(Int32 hWnd);\n" source += " [DllImport(\"user32\", CharSet = CharSet.Auto, SetLastError = true)]\n" source += " internal static extern int GetWindowText(Int32 hWnd, [Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpString, int nMaxCount);\n" source += " public static string GetWindowText(Int32 hWnd)\n" source += " {\n" source += " int length = GetWindowTextLength(hWnd);\n" source += " StringBuilder sb = new StringBuilder(length + 1);\n" source += " GetWindowText(hWnd, sb, sb.Capacity);\n" source += " return sb.ToString();\n" source += " }\n" source += "}\n" csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider" compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters" compilerParams.ReferencedAssemblies.Add "System.dll" compilerParams.ReferencedAssemblies.Add "System.Drawing.dll" compilerParams.GenerateInMemory = true compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source) Win32Assembly = compilerResults.CompiledAssembly Win32Assembly.CreateInstance "Win32" ) ) global Win32 = CreateWin32Assembly() /* Launches IE */ fn LaunchHelp str = ( MXS_HELP_DIR="D:/3D/3ds Max 2012/help/maxscript-doc-2012/" IE32 = "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe" IE = "C:\\Program Files\\Internet Explorer\\iexplore.exe" url="file:///"+MXS_HELP_DIR+"index.html" if str.count>0 do url += ("?query=" + str) --ShellLaunch url "" -- :( :( :( DOES NOT PLAY WITH FIREFOX... -- This Works wIth x64 Windows if doesFileExist IE32 then ShellLaunch IE32 url else if doesFileExist IE then ShellLaunch IE url else ShellLaunch url "" ) fn GetWordatCarretPos = ( /* Retreives a complete Word (made of valid chars) at a given position in a string */ fn GetWord str pos = ( fn isStopChar s = ( local valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz_0123456789" local i = findstring valid s if i == undefined or i == 0 then true else false ) local start=pos, end=pos, res="" start = if isStopChar str[pos] then (pos+1) else if isStopChar str[pos-1] then pos else (for i = pos to 1 by -1 do if isStopChar str[i] do exit with (i+1)) end = if isStopChar str[pos+1] then (pos+1) else (for i = (pos+1) to str.count do if isStopChar str[i] do exit with (i)) res = substring str start (end-start) res ) fn _mxs_Textbox = ( tb = for c in (windows.getchildrenhwnd 0) where c[4] == "MXS_SciTEWindow" do exit with ( for t in (windows.getchildrenhwnd c[1]) where t[4] == "MXS_Scintilla" do exit with t[1] ) if tb != ok then tb else undefined ) EM_GETSEL = 0x00B0 tb = _mxs_Textbox() tx = Win32.GetWindowText tb Win32.SetFocus tb CarretPos = (windows.sendmessage tb EM_GETSEL 0 0)/65535 GetWord tx CarretPos ) LaunchHelp (GetWordatCarretPos()) ) )
 
Old 01-31-2012, 03:47 PM   #9
S-ed
New Member
 
S-ed's Avatar
portfolio
Alexey Mak
a jack of all trades
St.Petersburg, Russia
 
Join Date: Aug 2002
Posts: 12
Send a message via ICQ to S-ed
Quote:
My method uses the default methods available in the maxscript editor. You can add your own keyboard shortcuts for some actions in the scintilla editor. One of these actions opens a predefined file: the scintilla helpfile.

http://www.scriptspot.com/3ds-max/t...for-3dsmax-2012


There are not mentioned, but in
Tools -> Open Global Options File
You can find
Code:
# SciTE help command.scite.help="file://$(SciteDefaultHome)\Help\SciTEDoc.html" command.scite.help.subsystem=2
__________________
RTFM

Last edited by S-ed : 01-31-2012 at 04:07 PM.
 
Old 01-31-2012, 06:39 PM   #10
S-ed
New Member
 
S-ed's Avatar
portfolio
Alexey Mak
a jack of all trades
St.Petersburg, Russia
 
Join Date: Aug 2002
Posts: 12
Send a message via ICQ to S-ed
Put this code to Tools -> Open User Options File
Code:
command.name.12.*=Find in Help command.12.*=C:\-blah-blah-blah-\opera\opera.exe "file://C:\-blah-blah-blah-\3ds Max 2012\Help\maxscript\index.html?query= $(CurrentSelection)" command.subsystem.12.*=2 command.mode.12.*=savebefore:no command.shortcut.12.*=Ctrl+F1

You can remove:
command.name.12.*=Find in Help
Replace
C:\-blah-blah-blah-\opera\opera.exe
With any string/browser You wanted.
And
C:\-blah-blah-blah-\3ds Max 2012\Help\maxscript\index.html
To path of Maxscript Help File.
__________________
RTFM
 
Old 02-01-2012, 07:40 PM   #11
grabjacket
Connecting 3D
 
grabjacket's Avatar
portfolio
Klaas Nienhuis
Schiedam, Netherlands
 
Join Date: Sep 2007
Posts: 243
Nice Alex Mak,
this was missing from my solution. The ability to have the help point directly to the item you want help for. I'll update my article to incorporate your solution.
Klaas
 
Old 02-02-2012, 09:44 AM   #12
S-ed
New Member
 
S-ed's Avatar
portfolio
Alexey Mak
a jack of all trades
St.Petersburg, Russia
 
Join Date: Aug 2002
Posts: 12
Send a message via ICQ to S-ed
grabjacket
Thanks to Your info about SciTe.

I'm disappointed about this "decision" to make help online. Legacy .chm was times faster.
Same thing with Adobe.
Seems like Lua disabled in Max's SciTe. =(

Zbuffer
Looks like a lot of work to me.
And most interesting, that maxscript can embed other language, looks fearsome...
__________________
RTFM
 
Old 02-02-2012, 10:52 AM   #13
Zbuffer
Expert
Wanabee Scripter
Finland
 
Join Date: Jan 2003
Posts: 562
Very interesting,
The drawback with the global Options is that it only takes a selection, that's vcery cool
I like the fact to only click on the word and send this to the help file to get a 'real' context help.
(as it was worling previously with .chm)
 
Old 02-02-2012, 01:15 PM   #14
S-ed
New Member
 
S-ed's Avatar
portfolio
Alexey Mak
a jack of all trades
St.Petersburg, Russia
 
Join Date: Aug 2002
Posts: 12
Send a message via ICQ to S-ed
Quote:
to only click on the word
oh, sure...
replace
CurrentSelection
with
CurrentWord
__________________
RTFM
 
Old 02-02-2012, 02:11 PM   #15
grabjacket
Connecting 3D
 
grabjacket's Avatar
portfolio
Klaas Nienhuis
Schiedam, Netherlands
 
Join Date: Sep 2007
Posts: 243
Hey Alex,

I've had to edit the lines of code you posted a little bit, but it really works for me: actual contextual, local maxscript help: yay!
Code:
# point maxscript to a local helpfile command.name.12.*=Find in local Help command.12.*="C:\Program Files (x86)\_web\Firefox\firefox.exe" "file:///C:/Users/klaas/Dropbox/Documentation/maxscript-doc-2012/index.html?query= $(CurrentWord)" command.subsystem.12.*=0 command.mode.12.*=savebefore:no command.shortcut.12.*=Ctrl+F1

I had to set the subsystem to 0 to make it work for me.

I've updated my blog-article and added your solution to it.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:12 PM.


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