Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Probably an easy question...
  RSS 2.0 ATOM  

Probably an easy question...
Rate this thread
 
25714
 
Permlink of this thread  
avatar
  • Total Posts: 13
  • Joined: 19 March 2009 12:00 AM

How can I tell 3ds in Maxscript to open the listener window?



Max 2010 (SP1), Windows Vista 64bit
NVIDIA Quadro FX 1600M, 4GB RAM

Replies: 0
avatar

Search for ‘actionMan Interface’ in Maxscript help files

This opens the window:

actionMan.executeAction 0 “40472”
<returns True/False>



Replies: 0
avatar

not too sure how to apply that. I’ve put that at the top of my script and I get “-- Argument count error : executeAction wanted 2, got 1”



Max 2010 (SP1), Windows Vista 64bit
NVIDIA Quadro FX 1600M, 4GB RAM

Replies: 0
avatar
  • deftang1
  • Posted: 17 April 2009 08:18 PM

Sounds like you put the code in the wrong spot and now maxscript is confused.  Can you show us your code?  Also, just out of curiousity, why do you want to open the listener at the start of your script?



Replies: 0
avatar

1. The actionMan.executeAction function needs 2 parameters , 1 an integer (0 i.e. zero), 1 a string ("number")

so, if you wrongly type:

actionMan.executeAction function “40472”

It will return “Wanted 2, got 1”, because you only gave it 1 rather than 2 parameters

So, the correct line with 2 parameters is:

actionMan.executeAction function 0 “40472”

2. If you call actionMan.executeAction from within a special function, then it can go where you want in the script:

example 1 (Invites you to pick 2 points, then opens window):

d = pickOffsetDistance prompt:"set a point” pt2Prompt:"set another point” snap:#3D—asks to pick 2 points on screen

winOpen 0 “40472” --calls function named winOpen takes an Integer and a String arguement to Open window
print d --print distance between the 2 points in window

function winOpen int str =
(
actionMan.executeAction int str --opens window
)

example 2 (opens window, then invites you to pick 2 points):

winOpen 0 “40472” --calls function named winOpen takes an Integer and a String arguement to Open window

d = pickOffsetDistance prompt:"set a point” pt2Prompt:"set another point” snap:#3D—asks to pick 2 points on screen
print d --print distance between the 2 points in window

function winOpen int str =
(
actionMan.executeAction int str --opens window
)



Replies: 0