Results 1 to 9 of 9

Thread: viewport display state toggle

  1. #1
    Super Member geo_n's Avatar
    Join Date
    Aug 2007
    Location
    jpn
    Posts
    4,677

    viewport display state toggle

    Is there a way to make a selected object and its display state toggle via a button or keyboard shortcut? hidden, vertices, shaded, textured, textured wire, etc.
    I click Itemvisibility with command history process Itemvisibility 0,1,2 etc. So does that mean it can be made an lscript? Have no idea with scripting.

  2. #2
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    Yes you can toggle item visibility via lscript. Everything in the command history can be issued through Lscript. If there isn't a specific lscript function for it, you can still call it via CommandInput("ItemVisibility 1");

    Mind you, the command only works for the first selected item, even if you have multiple selected. So if you want to process multiple items, you'll have to select and execute the command once for each item.
    Last edited by evenflcw; 12-28-2010 at 09:51 AM.

  3. #3
    Super Member geo_n's Avatar
    Join Date
    Aug 2007
    Location
    jpn
    Posts
    4,677
    Quote Originally Posted by evenflcw View Post
    Mind you, the command only works for the first selected item, even if you have multiple selected. So if you want to process multiple items, you'll have to select and execute the command once for each item.

    That's ok. Its to toggle back and forth with a character rig.
    So I just make a text file with CommandInput("ItemVisibility 1"); for example and load that as an lscript and make a kb shortcut?

  4. #4
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    For lscript you need a few more lines so LW knows what kind of script it is and were to start.

    Code:
    @version 2.5
    @script generic
    
    generic
    {
        CommandInput("ItemVisibility 1");
    }
    Another option is to do a CS (CommandSequence) macro, preferably through the LScript Commander, in which case a single line will suffice, just "ItemVisibility 1" will do (without the apostrophes). Just start the LS Commander, input the line and choose something like Create Macro or Install from the panels menu, and it'll save it to a file, install it, and give it a button. I would think this is explained in the manual. If not, Proton made a video about it I think (see NT website).

  5. #5
    Super Member geo_n's Avatar
    Join Date
    Aug 2007
    Location
    jpn
    Posts
    4,677
    Thanks for the basic lesson in lscript
    It worked! I can switch between bounding box and shaded instantly for a selected object.
    I wonder if its possible to automatically select the mesh parent when activating this command so that when Im animating controllers or bones and activate it, the mesh object switches to the chosen visibility. Maestro has a button to select the mesh even if its parented to a null.

    The command history is
    Command History
    Interactive Mode
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    SelectItem 10000000
    AddRotation 0 0 0
    InteractiveMode

  6. #6
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    Maestro is written in LScript, not CS. Using CS (CommandSequence; Layouts internal command system; which is not the same as LScript) you can only execute commands. You cannot call any functions or make queries and there are no objects or data types. Only commands and their arguments.

    If you want to select the mesh parent in CS you'll have to find a command to do it. You have commands to select parent, but obviously you have no means to tell when you've reached the mesh and know when to stop. A cheap substitute might be to simply call the command that switches to Object selection mode. But basically, it can't be done reliably in pure CS.

    In LScript you could do it proper via a loop that that traverses the hierarchy until it finds the root mesh. I'd look on flay.com for a script that deals with parent/child selection for a quick way to learn how this is done, or pick up the LScript manual.

  7. #7
    Super Member geo_n's Avatar
    Join Date
    Aug 2007
    Location
    jpn
    Posts
    4,677
    Quote Originally Posted by evenflcw View Post
    Maestro is written in LScript, not CS. Using CS (CommandSequence; Layouts internal command system; which is not the same as LScript) you can only execute commands. You cannot call any functions or make queries and there are no objects or data types. Only commands and their arguments.

    If you want to select the mesh parent in CS you'll have to find a command to do it. You have commands to select parent, but obviously you have no means to tell when you've reached the mesh and know when to stop. A cheap substitute might be to simply call the command that switches to Object selection mode. But basically, it can't be done reliably in pure CS.

    In LScript you could do it proper via a loop that that traverses the hierarchy until it finds the root mesh. I'd look on flay.com for a script that deals with parent/child selection for a quick way to learn how this is done, or pick up the LScript manual.
    Yes that was the problem I saw that if there's a null or any parent over the mesh, it selects that not the mesh. Maestro does it only selecting the mesh in the hierarchy, really smart.
    I will check the docs or video tuts for lscripting, even if I suck at math

  8. #8
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,273
    Push the software, don't let it push YOU!
    My own plugins and work:www.mikegreen.name
    LaptopSetup:corei7 2.4GHz nvidia GT 650M 8Gig win8 64
    WorkSetup:core i7 3.4Ghz nvidia Quadro 2000 12Gig Ram Win7

  9. #9
    Super Member geo_n's Avatar
    Join Date
    Aug 2007
    Location
    jpn
    Posts
    4,677
    How did i miss that! Its not in my mike green plugin folder and not listed in flay ot lwdb. Will check it out. Thanks.

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
  •