Page 4 of 5 FirstFirst ... 2345 LastLast
Results 46 to 60 of 74

Thread: nuArchitect python version

  1. #46
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,500
    Ok, I just ran into a show stopper with the GUI designer... pressing f1 for the HTML help page, while bringing up the help page, crashes modeler. 2018.0.7, Windows 10 Pro 1803 (build 17134.590). Perhaps the help function needs to move to it's own button, because lightwave uses the f1 key for it's help function...

    Also, I had an idea - when a new control is added, could it read the location of the x and y guides for placement? That way, it becomes move guides, add control, repeat as needed. Perhaps as an option? Ideally it should all be drag and drop (like QT Designer, Visual Studio and #Develop's forms designer), but such may not be possible under LW_Python....
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  2. #47
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    Quote Originally Posted by Kryslin View Post
    Perhaps the help function needs to move to it's own button, because lightwave uses the f1 key for it's help function...
    At the moment I am working on a new release for the nuArchitect bundle. As it will have complete new UI (using tab in tab) and some new (own controls) the nuGUIDesign will become evtl a complete new Interface and maybe it will be dedicated from the rest. As I must work in any case with the code, I will switch over to an other key for the help. Thank you for reporting this.

    Quote Originally Posted by Kryslin View Post
    Also, I had an idea - when a new control is added, could it read the location of the x and y guides for placement? That way, it becomes move guides, add control, repeat as needed. Perhaps as an option? Ideally it should all be drag and drop (like QT Designer, Visual Studio and #Develop's forms designer), but such may not be possible under LW_Python....
    Have a look at the "Add" Tab. There you can define things like this. There you can define how new controls are named, where they are positioned, the dimensions. Here you can do even a rename of the variables etc. Maybe this is what you have in mind with "read the location of x and y"
    If a control is added, you can drag it around (using the right mouse button)... I am not shure what you mean with drag and drop. But I find the idea really nice. I will think about a tab with"Dummy" controls, that can be used as Drag and Drop source for new controls.

    Python is fast enough to handle things like this. Thank you for the idea, I will try to implement this.
    As the next generation of nuGUIDesign will be able to generate code for the "nuLib" too (can be choosen between "Standard UI" and "nuLib UI") I must code it from the scratch, what makes it more easy to implement such things. But this can take a while.

    I hope this helps you and gives you some anticipation to the next generation of nuGUIDesign.

    Regards,
    Kanuso

  3. #48
    Super Member JohnMarchant's Avatar
    Join Date
    Mar 2003
    Location
    Murcia, Spain
    Posts
    3,012
    Look forward to it Kanuso
    Dell XPS 15
    15.6-inch (3840 x 2160) 4K 282ppi IPS LCD
    Intel i7 7700HQ 2.8GHz
    Windows 10 64Bit
    NVidia GeForce GTX 1050 Ti
    1TB SDD
    32Gb Ram

    LightWave 2019.03

    Very nice Laptop

  4. #49
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,500
    Wow, I learn something new, large or small, every day (right click and drag to position controls). Thank you for considering my ideas. Yes, you've got the idea correct - simply dragging a control from a tool bar, onto a blank panel, and dropping it adds the control to the panel. The other thing would be to make it respect the x and y snap values.

    Still, even the current one saves a lot of time setting up a panel for use in python, so thank you very much.
    (Adds Kanuso to the list of people I need to donate money to...)
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  5. #50
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    I have looked deeper for the issue with opening the help in the GUI-Designer.
    This issue does not only hit the GUI-Designer. It seems like LW doesn't want a command like "os.startfile" (this is the old way to open a external program). I don't know why it works sometimes and sometimes not. But I have tried some other ways to call an external programm. The old way didn't take care of the os and works on all platforms I know.
    I will use the new way in the future (even if there must be taken care to many other things)

    For interested ones:

    Code:
    import os
    import sys
    import subprocess
    ...
    def callprogram(filepath):
        if os.name is "nt":
            subprocess.Popen(filepath,shell=True,stdin=None,stdout=None,stderr=None,close_fds=True)
        elif sys.platform.startswith("darwin"):
            subprocess.call("open",filepath)
        else:
            subprocess.call("xdg-open",filepath)
    The long parameterlist in the "nt" part is to not show the "cmd" window. Because in default the cmd window captures the stdin/stdout and stderr, it will block the calling process. This parameters tells the cmd-window to not do so. So we have a non blocking open of an external program.

    The next generation of nuArchitect and nuGUIDesign will use the new way, so I hope this problem doesn't occure anymore.

    I have tested the old way with a "minimal" python and it crashes too, so I think LW has a problem with the old way. So if anyone wants to start an external program, than the new way should be used (in the python forums the new way is preferred anyway).

    Regards,
    Kanuso
    Last edited by KANUSO; 02-23-2019 at 01:26 AM.

  6. #51
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    Quote Originally Posted by Kryslin View Post
    Ok, I just ran into a show stopper with the GUI designer... pressing f1 for the HTML help page, while bringing up the help page, crashes modeler. 2018.0.7, Windows 10 Pro 1803 (build 17134.590). Perhaps the help function needs to move to it's own button, because lightwave uses the f1 key for it's help function...
    If you want a quick help, than you can change the file __init__.py in the folder "nuArchitect\guiedit"
    In this file find the function "def dohelp(self,tabnr)"
    in this function change the line "os.startfile(file)"
    for NT to:
    subprocess.Popen(file,shell=True,stdin=None,stdout =None,stderr=None,close_fds=True)
    for MAC to:
    subprocess.call("open",file)
    for Linux to:
    subprocess.call("xdg-open",file)

    At the top of this file insert a line:
    import subprocess

    This should work as quick help

    Don't forget to restart LW after this.

    Regards,
    Kanuso

  7. #52
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    Hello together,

    I have spend a complete day to find out how to install PyPNG so that it can be used from LW. Of course the Modeler. Because I didn't find a way to save an image with on bord Modeler functions I had implemented a very simple interpretation of TGA to the nuArchitect scripts. But that wasn't really the finest. So I searched about image file formats in the internet. And so I found PyPNG. A pure Python library to handle PNG files. Oh, fine I don't had to reinvent the wheel. Said and downloaded... But this was only the first step in a walk through the deeper hells of (LW) Python. I did do many (unsuccessful) tries to let it work in LW. But finally I've done. Maybe this is not the correct way, but if you don't find anything about it in the docs and/or the internet, than you take what you get. For all who are interested in...

    This is the way that works for me (and the nuArchitect scripts):
    Download the pypng library from https://pypi.org/project/pypng/
    Do whatever must be done to get normal files and folders (not compressed)
    in my case it was a file named pypng-pypng-0.0.19.tar.gz
    on that tar.gz was embeded pypng-pypng-0.0.19.tar
    in this tar was embeded pypng-pypng-0.0.19 this was the folder i had extracted to a temporary folder
    after getting a closer look to what was in this temporary folder, I noticed a folder "code"
    This folder I had copyed to "LW-Install"/bin/Lib/site-packages (where "LW-Install" is the path where you have installed LW
    After it was placed in this LW-Python "look for extensions" folder, I renamed "code" to "PyPNG"
    Than I had entered this folder and created a file in it named "__init__.py"
    You can leave this file empty, but it must be found there (this I was aware after endles internet searches)

    This are the steps to let you work with PyPNG. And this are the steps that one must do to let the next versions of nuArchitect scripts use PNG as alternative to TGA (which saves a lot of disc-space)

    I even tried PIL (Python Image Library) with this library this didn't work the same way. It seems that if you do an "from PIL import image" the library tries to do something, that LW don't like and so it ends in an error. If someone had found a way to implement PIL in LW, please let me know how.

    The PyPNG library will not be shipped with the nuArchitect bundle (I don't know if this breaks some laws, so everybody must do the above steps the get PNG with the next version of nuArchitect. Currently I am working on new docs to the scripts there are to much changes to let the old ones be alive.

    Regads
    Kanuso
    Last edited by KANUSO; 03-13-2019 at 05:43 AM.

  8. #53
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    Because I don't was able to get the PIL-Library installed in LW-Python, I have installed Python 2.7 parallel. So I have searched for way to handle external python scripts. At this search I find a way to let the nuArchitect scripts handle an interface to other python installations. I don't know if this works with other pythons than Python 2.7. But with this python will it work as so as I thought.
    For example...
    I wrote a script for python 2.7 that works with PIL.
    I was able to call this script from within a nuArchitect script.
    There can be parameters reached over to the script and the output of 'print' that script does can be shown in nuArchitect after the script has ended (even errors are shown)

    So now my question:
    Is there interrest in adding this to nuArchitect scripts, or am I the only one who will find this cool?

    Looking to the future, this may for example be useful to let the nuArchitect scripts handle other fileformats than "TGA" for UV-Images.
    Or (looking far into future) there can be a bunch of scrits that can create wall textures etc...

    Regards,
    Kanuso
    Last edited by KANUSO; 03-15-2019 at 07:01 AM.

  9. #54
    Super Member JohnMarchant's Avatar
    Join Date
    Mar 2003
    Location
    Murcia, Spain
    Posts
    3,012
    Thanks for the updates Kanuso
    Dell XPS 15
    15.6-inch (3840 x 2160) 4K 282ppi IPS LCD
    Intel i7 7700HQ 2.8GHz
    Windows 10 64Bit
    NVidia GeForce GTX 1050 Ti
    1TB SDD
    32Gb Ram

    LightWave 2019.03

    Very nice Laptop

  10. #55
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129
    @ Kryslin:
    I'am working on the next version of nuGUIDesign and it seems like you have worked with nuGUIDesign, so please give me feedback on the feeling with the GUI of the Designer. Have you any wishes that should be implemented? Your idea of drag and drop from a template is being worked on (I think it is allmost done), Your wish about better implementing the snap in the workarea is also under construction. I allso work to make it possible, that the names can be edited (this can be used to name the controls like in LScript even if there can not be found all controls). I think your wish of placing a control initial to the rulers position can be implemented as option. As I'am not sure if I really should implement code generation for nuSoft look and feel (because this is too much contaminated with logos). I allso have no idea if someone ever want to use the nuSoft look.

    @ all other users of nuGUIDesign:
    Can you please give me a short feedback about the positives and negatives of nuGUIDesign? I will try to work on it to make the next GUIDesigner more smart to you.

    Regards,
    Kanuso

  11. #56
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129

    nuGUIDesign2 screenshot

    Hello,

    I want to show you a screenshot of nuGUIDesign2. It has the dimensions, that will be used during work.
    So my question is:
    Is this resolution OK, or should it be changed? The resolution is 1920 * 1040. This is the standard for normal 24" monitors (excluding the lounchbar at the bottom). Can this be viewed by all of you out there? The window itself is sizeable, but its content not. So it would be nice to hear about you out there.

    Click image for larger version. 

Name:	nuGUIDesign2.jpg 
Views:	61 
Size:	329.0 KB 
ID:	145070

    To all who worked with nuGUIDesign here a short description of some changes.
    Some ideas of Kryslin are implemented. For example the drag and drop of new controls. In the middle of the screenshot you will notice a vertical list of controls. This can be used to drag and drop the controls into the workarea. This list can be scrolled with your mousewheel. An other idea is the naming of the controls. The names can be edited, so you can use names like in LScript (even if in LScript are not all controls available directly). This names can be loaded and saved.

    At the moment I am working on the codegeneration for nuSoft styles (using an own dialog strategy and optic). Also it will allow you to use nuSoft controls (there are some extra controls, that can be used by scripts made with nuGUIDesign2). For example there are controls for in script messages, to create icon-definitions and image-definitions. This are mostly complex controls.

    The work on this gets more complex than expected, so it will take a while to complete the work. And if it is done, it must be tested too, this will consume some further time.

    nuGUIDesign2 is able to load old definitions (not all of the old definitions will work with a 100%).
    So another question is:
    Is there a must for this option, or is it OK to you all to revise your old scripts on some points? The transfer to the new format of definitions isn't a easy thing on some parts.

    I hope, I get some response.

    Regards,
    Kanuso

  12. #57
    Super Member JohnMarchant's Avatar
    Join Date
    Mar 2003
    Location
    Murcia, Spain
    Posts
    3,012
    Resolution sounds fine, although i have a 4k screen should still be viewable. Cant wait to see the latest release Kanuso.
    Dell XPS 15
    15.6-inch (3840 x 2160) 4K 282ppi IPS LCD
    Intel i7 7700HQ 2.8GHz
    Windows 10 64Bit
    NVidia GeForce GTX 1050 Ti
    1TB SDD
    32Gb Ram

    LightWave 2019.03

    Very nice Laptop

  13. #58
    Newbie Member
    Join Date
    Nov 2005
    Location
    France
    Posts
    2
    That sounds OK to me.

  14. #59
    Super Member
    Join Date
    Sep 2003
    Location
    France
    Posts
    498
    That sounds OK to me.

  15. #60
    Registered User
    Join Date
    May 2017
    Location
    Lampertheim, Germany
    Posts
    129

    Prior to the files itself - install docs

    Hello,

    I'm on the way to do the last steps prior to release the files. At first I want to release the install docs. This docs are in HTML form. They are in a zip file called
    install.zip
    To look at the install docs, you must extract them to wherever you want.
    In the extracted structure got to the "install" folder and double click the file "install.html"
    This file looks very simple at the first look. But after you extend some regions, the file becomes more complex.
    You are able to look at different categories and so the complexity will slow down.

    I want to ask you if this install docs can be used, or if there should be any additions.

    I am thinking about a script, that tells the recommendet pathes for the installation and a script, that checks if the files are on the right place. But at the moment such scripts doesn't exist.

    Please give me a hint of the quality of the install docs.

    Regards,
    Kanuso

Page 4 of 5 FirstFirst ... 2345 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
  •