Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 72

Thread: Lscript Question

  1. #31
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I'll give it a try. Ooooh, that gives me an idea... Use Cross3D to get a vector perpendicular to both, then use it again to get the actual perpendicular vector I need...

    using 2 dot products yields better results than taking the perpendicular of a projected vector, and reduces the problem area, but it still exists....
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  2. #32
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,054
    Quote Originally Posted by Kryslin View Post
    In lScript, is there any way to get the part name associated with a polygon?
    Quote Originally Posted by Dodgy View Post
    There's no way to retrieve parts in Lscript. You can assign them, but not retrieve them. You'll have to Parts to Surface and back to find those.
    Yes, you can.

    Code:
    @script modeler
    @warnings
    @name "Part Name"
    
    main
    {
        selmode(DIRECT);
        selectedItems = polycount();
    
        if(selectedItems[1] == 0)
        {
            error("Nothing Selected");
        }
    
        editbegin();
            for(loop = 1; loop <= selectedItems[1]; loop++)
            {
                partName = polygons[loop].tag("PART");
    
                info("Part Name: ", partName);
            }
        editend();
    }
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  3. #33
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Matt :

    Coolness. You know, this needs to be added to the lscript docs (amongst a whole lot of other things...)

    RH:

    Here's the results of using the idea you gave me:


    I also added a simple test, based on the dot product - if the dot3d(vn,bv) > .9, I have it check to see if the vertex + bn is greater than vertex + vn; If it is, I swap vn and bn before making the perpendicular vector using 2 cross products.

    I might have to apply some smoothing to even things out, but things look good so far...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  4. #34
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,876
    Just a reminder: input vectors to dot should be normalized.

  5. #35
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,726
    Quote Originally Posted by Kryslin View Post
    Matt :

    Coolness. You know, this needs to be added to the lscript docs (amongst a whole lot of other things...)
    I'd like to think that would go without saying, assuming it's not there. EVEN IF IT IS THERE, it obviously needs to be made more findable.
    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.

  6. #36
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,054
    Quote Originally Posted by Kryslin View Post
    Matt :

    Coolness. You know, this needs to be added to the lscript docs (amongst a whole lot of other things...)
    Yeah, there are a number of omissions in the LScript docs. They haven't really been maintained, something that needs addressing.

    I was at one point wanting to take Mike Green's docs, update them, and make them prettier. This was an initial 1 page test I did a LONG time ago:


    http://www.pixsim.co.uk/mike_green_l...tyle_Test.html
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  7. #37
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,726
    Any estimate on how such an LScript documentation update would cost? EDIT: that is, cost to have done? Not to the users.

    If Python were as fully implemented for LW/LWM as LScript is, I'd say put some LW3D bucks into Python documentation, cookbooks, LScript>>Python conversions, and examples. But it appears we still need LScript.

    (By cookbooks, I mean modular Python routines that are like Legos for constructing other, more complex Python scripts.)
    Last edited by jeric_synergy; 04-03-2015 at 02:27 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.

  8. #38
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,054
    Quote Originally Posted by jeric_synergy View Post
    If Python were as fully implemented for LW/LWM as LScript is
    Python IS far more implemented than LScript. Python wraps the LightWave SDK, so what is available to the C SDK (which is more than LScript has) is available to Python. The only thing is that Python is harder to pick up than LScript, apart from the PRIS (Python Reduced Instruction Set) implementation, which is in Modeler only at present.
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  9. #39
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,876
    Python wraps the LightWave SDK, so what is available to the C SDK (which is more than LScript has) is available to Python.
    I don't think so in Python you will make 3rd party renderer, VPR previewing class, custom polygon, interactive tool, etc. handlers.

  10. #40
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,273
    Argh! Why did I not know this?

  11. #41
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,726
    Quote Originally Posted by Dodgy View Post
    Argh! Why did I not know this?
    errr, which bit?
    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. #42
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I'd like to thank those who gave me some ideas for this... Here's the current result:

    Nearly all the fibers are now pointing the right way now. Instead of using a single method to compute the combing vector, I compute it two different ways, and use the result that has the smaller dot product (the closer to perpendicular they get, the smaller the dot product) with the vertex normal. I also check to see if the result has a great Y value than vertex + vertex normal - if it does, I swap the two before computing the perpendicular.

    The next set of tests will involve a different mesh in a different orientation. It will introduce the requester for which surface to comb away from.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  13. #43
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,273
    Nice stuff
    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

  14. #44
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    lScript question:

    I'm trying to use SelectByName(Name) to select items in my scene. However, it is returning the wrong results!

    Ie: Selecting Lft_Leg1_IKG_mel by name returns the expected Object Agent; selecting Lft_IKRevFoot1_mel by name returns an incorrect match - Lft_IKRevFoot1_mel_MARKER.

    It is as if 2 commands - SelectByName() and SelectByPartialName() return the same results.

    Is this a bug that should be reported? It kind of puts a damper on my experiment, but I think I can code a work around...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  15. #45
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I figured out what was going on... It's the 1000 item limit. When using a scene that had less than 1000 items in it,SelectByName and SelectByPartialName work as expected... Over 1000 items, erroneous results.

    Great. Time to learn how to load all the scene item ID's, name and type into an arrays. Not as easy as it seems, because the top level items are not children of the scene...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

Page 3 of 5 FirstFirst 12345 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
  •