Page 1 of 5 123 ... LastLast
Results 1 to 15 of 72

Thread: Lscript Question

  1. #1
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527

    Lscript Question

    Ok, I'm cobbling together an lscript that assigns weights symmetrically, (Given right and left tags for the weights and bones, it's actually pretty trivial) to bones in a rig. I would like to select the item I choose in my bones popup menu, and center it, so the user can see where the selected bone is in the rig, so as to aid weight map selection.

    I'm using a ctlpopup for my list of bones, but nothing I'm reading in my documentation says anything about having a UDF attached to it to handle this...

    Any suggestions?
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  2. #2
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,771
    you wanna use the refresher...

    mypopup = ctlpopup(blah);
    ctlrefresh(mypopup,"callBackFunc");

    callBackFunc:val
    {
    something = val;
    }
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  3. #3
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    Thanks, that should do nicely.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  4. #4
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    I'll necro this thread, trying to keep my questions in 1 thread...

    In lScript, is there any way to get the part name associated with a polygon?

    Skelegons have their bone name in two locations; 1 is the part name, the other is a tag. I know you've got to use either python or the SDK to read the tag, but can lScript read a part name from an arbitrary polygon?

    Hmm, a cheat would be parts to surfaces - changing all the skelegon surfaces from bone to <bonename>... but I'd rather not have to make such a change (easy enough to restore, though...)
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

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

  6. #6
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    That's the conclusion I came to as well, after reading through the lscript docs on your site.

    cmdseq("Parts to Surf"); does the job, though it requires manual input of a "Y" or "N". I'll have to see if adding the Y/N as a parameter does anything.

    If I leave the part name intact after a parts -> surfs command, all I have to do is restore the surface to the skelegon - usually Default or bone.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  7. #7
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    Another necro of this thread...

    Has anyone else had trouble with LW2015 and the debug(); command? I mean the debugger works, but what I'm experiencing is not good behavior - when ever the debugger throws an error (while debugging an lscript, this is fairly common), it's crashing LW2015, with a critical error message, and going to the desk top. I've reported it, but I was curious if anyone else was experiencing this - It's even doing this with an error() statement!
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  8. #8
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    And yet another question:

    I'm going to assume that the only option I have to work with skelegons in a scripting environment with Lightwave is Python; I cannot find any skelegon related information beyond the options in selpolygon (BONE, SKELEGONPATCH). Any of the people who know lscript better than I care to confirm this, or point me in the right direction?

    Here's the why: Someone upstairs released a nice little plugin for generating weight waps based on skelegons. Coolness. While DStorm has a bones -> skelegons updater, it currently requires editing of the scene file version number for it to work. So, I wrote my own bone exporter (since export rig has a minor issue that makes it unsuitable for reloading a hierarchy (and it has been reported, but I doubt anything will be done, since it's been around since 9.x). I can reload the information, and generate 2 pt. polygons that follow the structure of the bones exactly, including getting the last poly pointing in the right direction. However, once there... I'm stuck. I have no option to create a skelegon and/or rename it. Any clues?
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  9. #9
    You can create skelegons. I have a lscript that automatically converts polylines to skelegons. If memory serves you have to call the Modeler command. Doing stuff in Modeler is more based on invoking the command versus methods like in Layout.

    When I return from visiting family I'll dig it up. Won't be for a few more days though.

    Does that help?
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  10. #10
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    Helps somewhat. It's not a big deal, I like seeing what I can get lscript to do... If I get a useful tool out of it, even better.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  11. #11
    TD/Animator lino.grandi's Avatar
    Join Date
    Jun 2003
    Location
    Rome
    Posts
    1,701
    To rename a skelegon in Modeler, you need to access its polygon tags.

    Try this:

    main

    {
    name="custom_name";

    cmdseq("SetTag", "PART "+name);
    cmdseq("SetTag", "BONE "+name);
    }

    This will rename the currently selected skelegon as "custom_name". Hope this helps.
    Lino Grandi
    3D Development, LightWave 3D Group/NewTek, Inc.

    https://www.lightwave3d.com/

    LightWave 3D Group YouTube channel:

    http://www.youtube.com/user/Official...?feature=watch

    My YouTube Channel:

    http://www.youtube.com/user/linograndi?feature=mhee

  12. #12
    Thanks Lino!
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  13. #13
    TD/Animator lino.grandi's Avatar
    Join Date
    Jun 2003
    Location
    Rome
    Posts
    1,701
    Sure!
    Lino Grandi
    3D Development, LightWave 3D Group/NewTek, Inc.

    https://www.lightwave3d.com/

    LightWave 3D Group YouTube channel:

    http://www.youtube.com/user/Official...?feature=watch

    My YouTube Channel:

    http://www.youtube.com/user/linograndi?feature=mhee

  14. #14
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    That is indeed useful, and it works wonderfully.

    I think I've got a way to load skelegons back into modeler from a rig in layout. I just need to refine the 2 scripts a bit...

    Oh, yes... they need refining, but I managed to get most of a rig from a Rhiggit2 rig into modeler as Skelegons!
    (It would probably work better if I used the z-bones only rig, but I got all 78 skelegons from the joints rig, just not connected up right)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	importedskelegons.jpg 
Views:	171 
Size:	51.7 KB 
ID:	126318  
    Last edited by Kryslin; 12-27-2014 at 10:38 PM.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  15. #15
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,901
    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.
    But if we know names of parts in advance (f.e. let user enter it), we can use f.e.

    cmd
    SEL_POLYGON SET PART "[name]"

    Then use mesh scanning to learn which polygons are selected (so they're in part), and which are not.

Page 1 of 5 123 ... 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
  •