How do I call the Script editor and explorer as a cmd?

Discussions concerning programming of SOFTIMAGE©
bergj
Posts: 36
Joined: 06 May 2012, 03:58

How do I call the Script editor and explorer as a cmd?

Post by bergj » 07 May 2012, 17:42

As the title says, Im looking to call these two and probably others from a button on a py window.

How do I do this? I can see that only some commands show up in results window and in the sdk guide.

For example, I can call the preferences window with
Application.InspectPreferences("")

but I cant find bindings for a lot of other things like the script ed/Hotkey Ed

:)]

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: How do I call the Script editor and explorer as a cmd?

Post by EricTRocks » 07 May 2012, 17:56

You need to create views of them. Not sure there are commands for that but you can create views through the object model. This will allows you to also change the size and placement of the Windows. Look at these docs for examples of how to open and create views.

Do note that you can only have one script editor open. Im not sure the key map editor is able to be opened through scripting.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: How do I call the Script editor and explorer as a cmd?

Post by xsisupport » 07 May 2012, 18:01

Check out Layout.CreateView in the docs.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

bergj
Posts: 36
Joined: 06 May 2012, 03:58

Re: How do I call the Script editor and explorer as a cmd?

Post by bergj » 08 May 2012, 04:17

Thanks guys. I was able to map it to a key with

Application.Desktop.ActiveLayout.CreateView( "Script Editor", "My script editor" )
and
Application.Desktop.ActiveLayout.CreateView( "Explorer", "Explore" );




Having said that, is it possible to map scripts to mouse button combos such as Shift+RMB or alt+RMB etc ? I dont see this option in the hotkey ed.

Thanks.

User avatar
myara
Posts: 406
Joined: 28 Sep 2011, 08:33

Re: How do I call the Script editor and explorer as a cmd?

Post by myara » 08 May 2012, 04:57

For Explorer, Script Editor, etc, I use only OpenView.

Code: Select all

OpenView("Explorer")
And loop ActiveLayout.Views types to see if it has been already opened.

Ex: Close All Texture Editor windows

Code: Select all

//JScript
var views = Application.Desktop.ActiveLayout.Views
for (var i=0, a=views.count; i< a; i++){
   if (views(i).type == "Texture Editor")   views(i).state = siClosed;
}
M.Yara
Character Modeler | Softimage Generalist (sort of)