Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: Help creating a startup script for Layout

  1. #1
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161

    Help creating a startup script for Layout

    Hi all, I'm tired of always having to manually open the scene editor, motion options, preset shelf and a couple other panels every time I open LW (to complete my gui setup) which is annoying since some of the panels open by default on launch ie. graph editor, image editor, surface editor.. yet others do not. Apparently it's possible to add a startup command to the LW config file so a script is run on LW launch and I'm thinking this is probably the way to go about this. I wonder if anyone can help me write a script or at least point me in the right direction with a subset of commands which would be needed for something like this?

    Basically I'd require the script to do this at launch:
    (applies to all panels: scene editor, preset shelf, graph editor, surface editor, image editor, motion options)

    - check if the panel is not open already
    - if not open, open the panel
    - enable octane plugin
    - open octane editor.

    That's pretty much it, very basic but just knowing where to start is a problem for me.

  2. #2
    Registered User
    Join Date
    Jun 2014
    Location
    Right here
    Posts
    1,535
    Can't help you with the script but for the meantime you can add at least the Scene Editor to Master Plugins. There is also a built-in plugin to define the individual windows sizes and positions.

  3. #3
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246

    Startup script options

    Hi,

    If you load the lscript lscommander from the utilities tab and then load the various panels that you want to have opened you can see the commands that are issued. It you drag these commands into the editing window, select the session drop down and convert to lscript it will give you the basics of a script. I did the following quickly to show what can be generated.

    I didn't copy all the lines into the command window. Not all panels allow access to the tabs via code, it depends on the server. If you search on the forums I think you can find the instructions on how to auto execute an lscript on startup.

    You can save the following as an lscript as a start point.

    Regards

    Iain

    Code:
    @version 2.8
    @warnings
    @script generic
    @name "StartOptions"
    generic
    {
        ApplyServer("MasterHandler", ".SceneEditorStandardBanks");
        ApplyServer("MasterHandler", "SceneEditor");
        EditServer("MasterHandler", 4);
        GraphEditor();
        SurfaceEditor();
        ImageEditor();
        Presets();
    }

  4. #4
    Super Member spherical's Avatar
    Join Date
    Dec 2004
    Location
    San Juan Island
    Posts
    4,686
    Quote Originally Posted by MrFurious View Post
    some of the panels open by default on launch ie. graph editor, image editor, surface editor.. yet others do not.
    I hate that. Uhhhh.... doesn't seem like consistency would be a huge hurdle; other than recognizing that there isn't any. Properties panel is my peeve. Surface, Scene, Image all open in the position where I set their windows; leaving a big void where Properties was. Requested many times. Goes ignored through, heck, a dozen+ versions/updates, now?
    Blown Glass · Carbon Fiber + Imagination

    Spherical Magic | We Build Cool Stuff!

    "When a man loves cats, I am his friend and comrade, without further introduction." - Mark Twain

  5. #5
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246

    Updated script

    I've updated the script so that it will not close a panel if it is already open, but will open it if it is closed. The presets command does not understand the parameter so it will either close or open depending on what state the current panel is in. The motions panel will cannot open unless an item in the scene is selected. By default the scenes current item is an object, in an empty scene this is [none], so the motions panel will not open and the button is not enabled. If you want a different scene editor replace the two ApplyServer and Edit server lines with the single line

    CommandInput("SceneEditor 1");

    Spherical, the same applies to the properties panel, if you do not have anything selected in the scene you will notice that the properties button is not enabled.

    Regards

    Iain

    Code:
    @version 2.8
    @warnings
    @script generic
    @name "Start2"
    generic
    {
        ApplyServer("MasterHandler", ".SceneEditorStandardBanks");
        ApplyServer("MasterHandler", "SceneEditor");
        EditServer("MasterHandler", 4);
        CommandInput("GraphEditor 1");
        CommandInput("SurfaceEditor 1");
        CommandInput("ImageEditor 1");
        Presets();
    }

  6. #6
    Super Member spherical's Avatar
    Join Date
    Dec 2004
    Location
    San Juan Island
    Posts
    4,686
    Yes, that rang true when as read the first paragraph and the behaviour then made "sense"; not that this condition makes any actual sense in the logical useability realm. And the simple solution is that every scene has a light and a camera. Yet, the Devs choose to enable a button that does NOT necessarily have anything to be selected by default. Why am I not surprised? This, then, begs the question: Is there any way to programmatically change the active button from Objects to Lights or Cameras?

    The bigger question, of course, is: Why do we have to resort to these needless, useless, time consuming workarounds when the issue could have been dealt with long ago in the basic code by having a button selected by default that always has something TO SELECT?
    Last edited by spherical; 07-21-2015 at 04:32 PM.
    Blown Glass · Carbon Fiber + Imagination

    Spherical Magic | We Build Cool Stuff!

    "When a man loves cats, I am his friend and comrade, without further introduction." - Mark Twain

  7. #7
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246

    Camera Properties

    Code:
    @version 2.8
    @warnings
    @script generic
    
    
    generic
    {
        EditCameras();
        ItemProperties();
    }
    Regards

    Iain

  8. #8
    Super Member spherical's Avatar
    Join Date
    Dec 2004
    Location
    San Juan Island
    Posts
    4,686
    SWEET! Thanks, Iain. Works a treat. I owe you a pint.

    Which leads me to ponder: That few lines of code and it's a big problem for this function to be integrated into the application itself as default?
    Blown Glass · Carbon Fiber + Imagination

    Spherical Magic | We Build Cool Stuff!

    "When a man loves cats, I am his friend and comrade, without further introduction." - Mark Twain

  9. #9
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246
    I would think that it's most likely to be historical, in that they assume you would load an object before considering opening the properties panel. There's lots of little things like this that could be looked at, it just depends on how much time they have to go through all the code and fix these things. There are lots of panels and commands that I would like to be able to access via scripts but they're not available. Big pain is some panels will accept parameters and others will not. Anyway getting off topic.

    glad it worked, Iain.

  10. #10
    Super Member spherical's Avatar
    Join Date
    Dec 2004
    Location
    San Juan Island
    Posts
    4,686
    Yep. I deployed it to all of my many version installs. Will do the same on my partner's machine, as it's one less thing to break one's concentration when sitting down to do creative work.
    Blown Glass · Carbon Fiber + Imagination

    Spherical Magic | We Build Cool Stuff!

    "When a man loves cats, I am his friend and comrade, without further introduction." - Mark Twain

  11. #11
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161
    Thanks Guys it's helped get me started but this is a completely new language for me so.. I can manage to build something basic with the LS commander its all the other syntax I don't know. Iain your script is great but form some reason the scene editor doesn't appear to open but it's there in the master plugin window..weird. I suppose it's not a big deal the presets window can't detect the current state, as it would always be closed by default on startup. I was thinking with the Object and Motion panels, maybe a workaround could be to have the script (in this order) add a null, open the object properties, delete the null, select the camera, open the motion options panel.? do you think that might work?

  12. #12
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161
    I added the octane part myself, yay!

  13. #13
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161
    This opens the opject properties and motion options panels, but you have to confirm removal of the null


    Code:
    @version 2.8
    @warnings
    @script generic
    @name "Start2"
    generic
    {
        ApplyServer("MasterHandler", ".SceneEditorStandardBanks");
        ApplyServer("MasterHandler", "SceneEditor");
        EditServer("MasterHandler", 4);
        CommandInput("GraphEditor 1");
        CommandInput("SurfaceEditor 1");
        CommandInput("ImageEditor 1");
        Presets();
        AddNull("Null");
        ItemProperties();
        ClearSelected();
        EditCameras();
        MotionOptions();
    }
    Last edited by MrFurious; 07-26-2015 at 04:17 PM.

  14. #14
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161
    Or this which leaves behind the null which can be recycled or deleted later.

    Code:
    @version 2.8
    @warnings
    @script generic
    @name "Start2"
    generic
    {
        ApplyServer("MasterHandler", ".SceneEditorStandardBanks");
        ApplyServer("MasterHandler", "SceneEditor");
        EditServer("MasterHandler", 4);
        CommandInput("GraphEditor 1");
        CommandInput("SurfaceEditor 1");
        CommandInput("ImageEditor 1");
        Presets();
        AddNull("Delete Me");
        ItemProperties();
        EditCameras();
        MotionOptions();
    }

  15. #15
    Registered User MrFurious's Avatar
    Join Date
    Jun 2006
    Location
    Melbourne
    Posts
    161
    Is it possible to force a keystroke in Lscript?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •