nuArchitect python version

KANUSO

New member
nuHeavyGate extension for nuArchitect

Hello,

the Extension nuHeavyGate is complete.

View attachment nuHeavyGate.zip


You must have installed the nuArchitect bundle in order to use this extension!

What to do with this files?
Place all files with the extension ".html" into the "Helpy" folder of your "nuSoft" structure (see the first post of this thread)
Place all files with the extension ".jpg" into the "img" folder of your "Helpy" folder of your "nuSoft" structure
Place the file nuHeavyGate.py into the folder where you have installed all other nuArchitect .py files

You can look at the jpg-files to get an idea of what nuHeavyGate can do for you.


Regards,
KANUSO
 

KANUSO

New member
Hello jwiede,

Can you please produce an updated nuArchitect archive with all the above fixes included?

Doing a new install is a bit tiresome because of all the individual fixes now needed to reach the "current" version.

I do not know how much space I can use in this forum to upload files. I searched for this info, but I only find that it seems to be limited.
I also do not know how many files I can upload. This also seems to be limited.

It would be nice if someone from LightWave could answer this (or someone who knows the limits).

And there is a Limit in the filelength of a zip. This makes the handling of a complete zip more difficult (not all can be in one single zip)

So again:
Can please someone answer about the limits here in this forum?

It would be nice to know the Overall limit in size, the limit in count of files and the limit in size per zip.

If this will be no Problem (if the Limits are very high), than I will do a new complete archive and load it up.

Regards,
Kanuso
 
Last edited:

KANUSO

New member
nuArchitect new full archive

Hello,

here you have new archives that represent the latest Version(s) of the nuArchitect bundle.
I was not able to upload a single zip file, so the files are splitted as so as in the first upload, so Installation will be equal to that.

The file
View attachment nuArchitectPy_dat1.zip
includes data that is used by nuArchitect

The file
View attachment nuArchitectPy_dat2.zip
includes html for showing some example Pictures

The file
View attachment nuArchitectPy_src.zip
includes the scripts



What to do with that files?
The files has the structure in them, that is in use by the nuArchitect bundle. See the first entry in this thread for further Information.

nuArchitectPy_dat1.zip has the structure of the "nuSoft" path. Copy it complete to anywhere on your Computer. Remember this path and set it in any of the geometry-creating script of the nuArchitect bundle. You will find a tab in those scripts named "Preferences". There you can set the path.

The file nuArchitectPy_dat2.zip has the structure of a html Directory in it, that you can use to Display some example Pictures of the nuArchitect bundle.

The file nuArchitectPy_src.zip includes the structure of the scripts itself. Copy the Contents to any path that Python Looks for scripts in LW. I prefere the path:
"LW-Installation"\Support\plugins\scripts\Python
(MAC users should Exchange the "" to "/")

If you have all done well, than you should restart LW in order to the scripts will be recognized.
You can even edit a menu for the scripts (Edit Menu Layout) in the mainmenu of the modeler. The script nuGUIDesignL.py can be started from the Layout module of LW.

A issue that I am Aware of is:
If you set a new color-Setting with the preferences tab, than you should press "Store" and restart the Modeler. I didn't find how to delete a Surface and overwriting the Settings seem not to lead to the wanted effect. So if you don't restart, the previouse Setting will stay intact.

Regards,
KANUSO
 

Kryslin

Active member
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....
 

KANUSO

New member
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.

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
 

Kryslin

Active member
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...)
 

KANUSO

New member
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:

KANUSO

New member
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
 

KANUSO

New member
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:

KANUSO

New member
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:

KANUSO

New member
@ 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
 

KANUSO

New member
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.

nuGUIDesign2.jpg

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
 

JohnMarchant

Active member
Resolution sounds fine, although i have a 4k screen should still be viewable. Cant wait to see the latest release Kanuso.
 

KANUSO

New member
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
View attachment 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
 
Top Bottom