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

Thread: Kryslin's Python Questions

  1. #16
    Quote Originally Posted by Kryslin View Post
    I am seriously thinking about it. Part of the problem is that the Python SDK documentation is incomplete - nothing on panels, or controls on panels. I had to trouble shoot a missing argument in an auto generated GUI. Not an easy task, with incomplete documentation.

    And yes, I know about the help command... pcore never lets me enter the interactive mode.

    I'll be gearing up to start in on my hair tools in Python next week.
    its part of the regular sdk.. and pretty much exacly the same.

  2. #17
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    120
    Hello Kryslin,

    the problem with the docs in python had hit me too. So I digged myself deeper into the lwsdk and as a result I wrote a python script that mainly is to create python scripts. You can create a GUI in a WYSIWYG art and let the script do the work for you. You can save the raw-definitions, so it is no problem to change the design. Because a Picture says more than 1000 words here a screenshoot:
    Click image for larger version. 

Name:	nuGUIDesign.jpg 
Views:	92 
Size:	228.9 KB 
ID:	142487

    As you can see, there are GFX-Buttons as well as Tab in Tab in this demo.

    This GUI-Designer gets part of the nuArchitect bundle which will be complete in python. I'm on the way to create the helpsystem for the python Versions. This may take some days, but it is on the way to get released.

    The idea of discord is fine, but the Information should go in this Forum too. The main reason is: This is the official place of the lightwave Forum. How should the developers know our thinking, if we don't write it here?

    I will look for discort in the next days...

    Regards,
    KANUSO
    Last edited by KANUSO; 08-12-2018 at 03:04 AM.

  3. #18
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Most of mine are fire and forget modeler scripts, like my hair & spline tools ( and stitch, fuse poly pairs, and my little volume cutter), so a UI isn't an issue. Even my fractal foil generator has a simple UI.

    However, Things like Style Comb... that's probably the most complicated UI programming wise in lscript I've done. And, I've got ideas... ( Be afraid... be very, very afraid.)
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  4. #19
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Quote Originally Posted by oliverhotz View Post
    its part of the regular sdk.. and pretty much exacly the same.
    I filed it as a bug report, anyway...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  5. #20
    Registered User Diepgroen's Avatar
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    50
    Kanuso, thats a sexy UI creator I understand your point. You can always be active here. The speed of interaction is different there. LW Developers on Discord are really helpful when you are stuck. You can interact directly or in private if information is delicate. We love to see more developers working on LightWave plugins and script. Good job!

  6. #21
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Another question, non-critical :

    Is there a way, in the case of an error, to perform a specific task before aborting to console?

    Her's why I'm asking... I was converting some of my fire and forget tools over to modeler, namely Weld Pairs and Stitch ( Weld Pairs Average). During debugging, I had a few instances of it erroring out of a mesh edit op. Should I try to run it again, It couldn't initialize another m esh edit op, and on the next try, it would crash, sometimes bringing up the crash reporter, sometimes going straight to the desk top.

    Despite the PythonSDK's best efforts, I did manage to get both converted, and they both work nicely. But still, I have to ask if there is a way to close out the meshedit op before hitting the console with an error...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  7. #22
    you want to wrap your task inside try/except/raise/finally. that way. if the meshop errors.. its save. and you dont have to restart.

  8. #23
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Got it. I'll start doing that.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  9. #24
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Ok, the try:..except: ... finally: makes debugging thing much easier.

    New question : I need to switch to point selection after I get done. I know this has to be a modeler command, called by mod_command.evaluate().

    What's the character string I should be looking for? I've tried what I've used in lscript, "sel point", and variations thereof.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  10. #25
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    120
    You can look at this in the file "__init__.py" of the modeler functions of the "PRIS" module.
    This file is located in
    "installpath_of_LW"\bin\lwsdk\pris\modeler
    In this file you can search for "selpoint". What you find is how it will be handled in "PRIS". You will find many commands in this file, that you know already from LScript.

    In the nuArchitect bundle I use the PRIS module which offers me most of the world of LScript.

    Regards,
    KANUSO
    Last edited by KANUSO; 09-05-2018 at 03:02 AM.

  11. #26
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    I'm aware of the PRIS module, yes. However, this isn't the selpoint/selpolygon lscript command, but switching between point mode, edge mode, and polygon mode, which was done via cmdSeq("Sel Point") / cmdSeq("Sel Polygon") in lscript.

    I managed a kludge, which forced modeler into point mode; After I scan my polygons to check for curves (why doesn't lscript have fast_poly/point/edge scan?), I use mod_command.evaluate("SELPOINT CLEAR") before I iterate through the curves to get the start / end points. I uses meo.pntSelect(pID,1) to select my points while using meo.polSelect(ID,0) to deselect the polygons in that loop(meo = mesh edit operation).
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  12. #27
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Ok, this is more of a "Is this possible" question.

    I wish to wrap the F9 /F10 rendering options; mainly I want to check to see if FiberFX is applied to the scene, and if it is disabled, ask the user if they want to enable it. When the render finishes, i'd like the script to turn FiberFX off. While I know how to toggle an applied plugin on and off, is it possible to trap the closing of the render process (either by completion, or by abort)?

    The reason : Frame by frame lag after the first render with FiberFX gets intolerable - I have examples of 20-30 seconds, just scrubbing the timeline - with the more layers you add. The work around is to disable the FiberFX pixel filter, and re-enable it before rendering. I'd like to automate that process, turning it on before rendering, and turning it off after a frame or sequence is done.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  13. #28
    yes.. possible... as master plugin. you can check for the events and do whichever you want on those events.

  14. #29
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Got it, thanks.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  15. #30
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,452
    Another question:

    How does Lightwave evaluate open curves? I can properly select my span and the points needed to evaluate it, but my actual evaluation has a fair amount of error.

    Keep in mind I've tried 3 different Catmull-Rom formulae - Vanilla C-R has the greatest amount of error, followed by a formula I pulled out of the include files. Closest I've gotten is centripedal C-R, but even that has a tiny bit of noticeable error. I'm probably missing something obvious, but I know other people have done it, so there must be a way to do it.

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

Page 2 of 2 FirstFirst 12

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
  •