Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30

Thread: LS Commander: double action on manual entries -- WUWT?

  1. #16
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    No no, you've already done far beyond expectations..... ...It's just when I see the heinous hoops (as illustrated I believe by BigHache) of the convoluted half-Python/half-C-sdk-access syntax one seems obliged to jump through to accomplish the simplest thing, I lose the will to live.

    I mean, LOOK at this mess!:
    Click image for larger version. 

Name:	syntax.jpg 
Views:	100 
Size:	101.2 KB 
ID:	124390

    So, I anticipate turbo-procrastination on this effort.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  2. #17
    Ah well that's Modeler. The scripting in Layout is much easier...at least for me it is...but that's only cuz I've spent more time in Layout than Modeler.

    I'd say start with baby steps. Just figure out the syntax to add a light and then the small steps will start to illuminate how the whole works.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  3. #18
    Quote Originally Posted by jeric_synergy View Post
    If I enter, say:

    AddLight "SpotLight" "Xyzy"

    into the COMMAND line of LScript Commander, I get TWO spotlights named "Xyzy".

    Why is that???

    Thanks.
    I think lscript sees that string as you adding a light called 'Light' and then one called 'Xyzy'.

    To do what you want you need to break it down to individual commands because it looks like you can't feed the name into the Add Light dialogue window. Below is how it should look if you want to add a light called 'Xyzy'. I did this on a blank scene so your SelectItem value may differ if you have other things in your scene.

    Code:
    AddLight "SpotLight" "Light"
    SelectItem 20000001
    Rename Xyzy
    Or use this command:

    Code:
    AddSpotlight "SpotLight"
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  4. #19
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729

    Question

    Huh. I was just copying the line from LSComm's Events window: the 1st parameter should be the light TYPE, the second the light NAME.

    EG:
    AddLight "AreaLight" "Light"
    and
    AddLight "SphericalLight" "Light"

    ..are just C&P'd from the LSComm window-- I haven't edited them at all. And this seems reasonable. EDIT: if you use anything but valid light TYPES for the first parameter, you get an error.

    RE: DOUBLING:
    Regardez lez jhayypeg: I'm just copying and executing lines. I copied the highlighted line, and for this illustration I changed the name to "Spherical" so it would be easier to see what's up, instead of looking at "Light(5)" and "Light(6)".
    Click image for larger version. 

Name:	double.jpg 
Views:	79 
Size:	87.7 KB 
ID:	124395
    Still executing TWICE. I have no idea why. Anybody else experiencing this?
    Last edited by jeric_synergy; 09-19-2014 at 02:35 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  5. #20
    You know what...I think after you're typing and hitting enter its executing twice. Do this...type in what you want...then just click off of LSCommander...your command still gets executed. So the combination of hitting enter to enter the text is being read as well. Seems like a design flaw.

    Also if you leave your last command in...and then click in and hit enter just one light gets added.

    Something about the entering of text is funky.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  6. #21
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    Quote Originally Posted by ernpchan View Post
    Seems like a design flaw.
    A design flaw, in LIGHTWAVE? (I can't make my eyes roll hard enough for the dev team to hear from here up the coast....)

    The manual scroll issue is, IMO, an even bigger flaw in something that is supposed to EASE the learning of LScript. Instead it actively inhibits learning by concealing stuff egregiously.

    "Bitter?" you ask?

    ++++++
    Since LSCommander is due to be deprecated, I doubt this will get addressed. I just hope "Python Commander" doesn't suffer similar weaknesses.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  7. #22
    Quote Originally Posted by jeric_synergy View Post
    I just hope "Python Commander" doesn't suffer similar weaknesses.
    Not sure how python commander would work...python is more obscure than lscript.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  8. #23
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    That's why we need all the help we can get.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

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

    Adding lights

    I entered a line in LS Commander to create a light with a specific name eg Addlight "Spotlight" "Xyzw", it only created one copy of the light when using the Execute button and the text in the window. When trying this on the command line of LS Commander I got 2 lights. I then tried with an actual script and only got one light, note where the quotation marks are. The conversion in LS Commander didn't give me the correct output, it was looking for a server called Spotlight. I've not tried this with python yet.

    Regards

    Iain

    Code:
    @warnings
    
    generic
    {
    	CommandInput("AddLight SpotLight Xyzw" );
    }

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

    Python version

    Python version of adding a Spotlight

    Regards

    Iain

    Code:
    #! /usr/bin/env python
    # -*- Mode: Python -*-
    # -*- coding: ascii -*-
    
    """
    This is a LightWave Generic plug-in that adds a new Light object
    and positions it at <0, 1, 0>.
    """
    
    import sys
    import lwsdk
    
    __author__     = ""
    __date__       = ""
    __copyright__  = ""
    __version__    = "1.0"
    __maintainer__ = ""
    __email__      = ""
    __status__     = "Example"
    __lwver__      = "11"
    
    class add_named_light(lwsdk.IGeneric):
        def __init__(self, context):
            super(add_named_light, self).__init__()
    
        # LWGeneric -------------------------------------------
        def process(self, ga):
            result = ga.evaluate(ga.data, "AddLight SpotLight Abcd")
            result = ga.evaluate(ga.data, "Position 0 1 0")
    
            # if 'autokey' is not turned on, we need to explicitly
            # create keys for the object at the current time offset
    
            interface_info = lwsdk.LWInterfaceInfo()
            if not (interface_info.generalFlags & lwsdk.LWGENF_AUTOKEY):
                ga.evaluate(ga.data, "CreateKey %f" % interface_info.curTime)
    
            return lwsdk.AFUNC_OK
    
    ServerTagInfo = [
                        ( "Python Create Named Light", lwsdk.SRVTAG_USERNAME | lwsdk.LANGID_USENGLISH ),
                        ( "Create Named Light", lwsdk.SRVTAG_BUTTONNAME | lwsdk.LANGID_USENGLISH ),
                        ( "Utilities/Python", lwsdk.SRVTAG_MENU | lwsdk.LANGID_USENGLISH )
                    ]
    
    ServerRecord = { lwsdk.GenericFactory("LW_PyAddNamedLight", add_named_light) : ServerTagInfo }

  11. #26
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    Quote Originally Posted by iain_r View Post
    I entered a line in LS Commander to create a light with a specific name eg Addlight "Spotlight" "Xyzw", it only created one copy of the light when using the Execute button..

    Code:
    @warnings
    
    generic
    {
    	CommandInput("AddLight SpotLight Xyzw" );
    }
    Hmmm, in LScript "SpotLight" needs quote around it. At least, that's what shows up in LSCommander. You used the EXECUTE button, I just hit RETURN-- perhaps that's the difference.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  12. #27
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246
    Okay, been trying a few things with LS Commander. If you type your command on the command line and hit return it creates 2 copies of the object. It you then hit return again it only creates one copy. If you change the name of the light and hit return it creates two copies. Also regarding the other thread on the list not displaying the last command, if you add a light with AddLight SpotLight Abcd it creates two lights and issues two refresh commands which you have to scroll down the list to see, both the refresh commands are not automatically displayed. On the command line to add the spotlight I didn't bother with the quotes and it still added the lights, the command listing displays the command with the quotes.

    Regards

    Iain

  13. #28
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    Thanks for the confirmation, iain_r. So, everybody, that's a bug, no?

    That's the problem: I start using stuff new to me, and I immediately find two bugs.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  14. #29
    You could submit a bug report. They might respond confirming it's a bug or clarify the proper usage.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  15. #30
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    I don't think either can be explained away with 'proper usage'.

    But, I should definitely submit a bug report, although LSCommander is probably a bit of a dead letter. At this point I'd much rather see a "Python Commander"-- not least because it's such a GREAT NAME!!!
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •