PDA

View Full Version : nuArchitect python version



KANUSO
10-09-2018, 02:23 AM
The Python Version of nuArchitect is now coded.
Before I will load it up, I will do some final tests to it's scripts.
I looked the code I've coded and must say:
Some of the code would be changed, if I had to code it now. Why is that so? Because the work with Python and the LWSDK was new to me. And I have learned so much things. So with my experience changes, the code would Change too. For example: I would use much more exeption handling. I was not Aware of Python can do this (thanks to Oliver for posting a thred wich made me Aware of exception handling in python).Until now there is nearly no Python exception handling implemented. The libraries of nuArchitect would be more seperated and structured. The object oriented use of code would be more considered. On some of the code you can see steps of a beginner.

First I will Show you how to install the nuArchitect bundle.

At first there must be a Special structure in the filesystem of your Computer. This should look like this:
143048
This structure is a must (and case sensitive). It does not matter where this structure is (this can be set in the scripts).

In the "nuSoft" folder itself are files with data for nuArchitect stored.
Some words about the structure:
It does not care where on your computer this structure of folders is located, but it does care that the names of the folders are the names you can see here. The only exception is the folder "nuSoft". This folder can have any name you want. And this is the folder you should set in the preferences tab (Path) of the scripts of nuArchitect. It must only be set once, all scripts are using the same path.
The folders of the GUI branch are used by nuGUIDesign only and hve the following content:
Code - The code that nuGUIDesign generates will be stored here by default.
Defines - If you save a creation, it goes here by default.
Funcs - Here are subfolders for every event a control can react on. In this folders you find ".txt" files with definitions that can be used in your GUIs. If you become more and more experienced in lwsdk and Python, you can expand this files by yourself. You can change the standard files, but you should not. If you are not satisfied by a standard file than creare a new one and give it a name which is telling you what it does.
GFX - Here you can store your graphics to find them faster in your project. This folder is empty after installation.
Templates - This is the path where nuGUIDesign stores your templates

Help - This folder should hold the Helpfiles of the LScript versions. If you have not installed the LScript versions, this folder and its subfolders are not in use. And they don't need to be installed. See the documentation of the LScript versions for more information.
Helpy - This folder and its subfolders are holding the helpfiles of the Python versions of nuArchitect. I've decided to strictly separate the helpfiles. This should prevent in wrongly mixing the files.
css - here is the stylesheet of the help located
img - here are the images of the helpsystem stored
js - here is the JavaScript of the helpsystem stored. The only function herein is "sizeme" which sizes the help page to display it correct.

Icons - This is the folder where nuIconDesign stores your icons by default.
Images - This is the folder where nuImage2Dat stores the imagedefinitions by default.
UVDefs - In this folder you will find the UV-Definitions from the UV-Map tab by default.

143047
This structure is also a must and case sensitive. It must be placed in a path where Python in LW Looks for scripts. I would prefere the path:
"LW-Installation"\support\plugins\scripts\Python
(MAC users Change the "" to "/")
In this folder you find some folders that are installed during your installation of LW. The LW-Original folders "Common", "Layout", "Modeler" and "PRIS" are located there. Here you should create the following structure (in addition to all that is already located there):
Because Python names its libraries by default as so as the name of the folder of the respective lib, the names of the folders must be named as so as in this picture (case sensitive).
nuArchitect - all the geometry creating scripts should be placed here
dlgedit - here is the "dlgedit" library located.
guiedit - here is the "guiedit" library located.
nuSoftLib - here is the "nuSoftLib" library located.


Yes, the Installation is a bit tricky, but this isnt a single script, it is bundle of scripts with the ability to use stored files.
I am open to ideas on how to Change this to give the user a better way to install.

So far for now and regards,
KANUSO

KANUSO
10-09-2018, 02:49 AM
What is included in the base packet of nuArchitect bundle?


nuArches - is to create gothic/roman arches
nuArchStones - is to create arches made of single stones
nuBridgeStones - is to create bridges made of single stones
nuCathCei - is to create cathedral like ceilings
nuCirclePlan - is to create Stone circles
nuColumns - is to create columns
nuCrackedStones - is to create cracked stones
nuDoors - is to create doors
nuFences - is to create fences
nuFloors - is to create floors
nuGates - is to create gates
nuGothBlk - is to create blocks of gothic/roman look
nuGothXPass - is to create gothic passes (I don't know if this is called "pass" in english)
nuGroundplan - is to create stonewalls that follow a groundplan
nuOrnaments - is to create ornaments (like those from a blacksmith)
nuPedestals - is to create pedestals
nuPlaque - is to create plaques
nuRoofGable - is to create Roof gables
nuRopePath - is to create ropes/chains that follow a path
nuRopes - is to create ropes/chains that hanging around (sag)
nuRota - is to create rotational objects
nuSockets - is to create sockets like those from statues
nuStairStones - is to create stairs made of single stones
nuTombstone - is to create tombstones
nuWallStones - is to create walls with Windows, passes and doors, made of single stones
nuWell - is to create wells
nuWinsGoth - is to create gothic/roman windows
nuWinsStd - is to create Standard Windows
nuGUIDesign - is to create scripts of a GUI Definition (this is a complex script that is made to create python scripts)
nuIconDesign - is to create Textfiles, that can be used to cut and paste Icon-definitions in a python script
nuImage2Dat - is to create Textfiles, that can be used to cut and paste Image-definitions in a python script
nuUV2TGA - is to save a UV's out to a TGA file


Regards,
KANUSO

3dworks
10-09-2018, 03:12 AM
great and congratulations for getting this out! looking forward to this...

erikals
10-09-2018, 04:03 AM
looks nice   :king:

this will run faster than the lws files then?

JohnMarchant
10-09-2018, 05:24 AM
Great work, cant wait to test the speed using python.

Kryslin
10-09-2018, 10:17 AM
Excellent...I was just going to ask when the GUI designer would be released...

KANUSO
10-10-2018, 02:08 AM
The Python nuArchitect bundle is as so as all other Versions released as donationware. There is no must of any donation, but if you find this usefull or use it Commercial than you should (no must) donate to [email protected] via PayPal.


The file
143058
includes data that is used by nuArchitect

The file
143059
includes html for showing some example Pictures

The file
143060
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.

nuArchitect_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 nuArchitect_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 nuArchitect_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

KANUSO
10-10-2018, 02:22 AM
All future extensions, bugfixes, changes will be posted here in this thread.

At the Moment there is planned a Extension "nuFountain" wich will create fountains.


@erikals and JohnMarchant:
I didnt stop times, but...
Yes the scripts will run faster (exept the parts where the Speed depends on the LW-core for example togglepatches/freezecurves etc.)
On some parts the Speed is increased very high, on other parts not noticeable. So I would say, Yes but....

But you should make your own tests.

@Kryslin:
You should see the Step by Step examples in the Documentation. There you can see how the things work together

Best regards,
KANUSO

raw-m
10-10-2018, 08:12 AM
Big thanks, looking forward to this! But, I'm afraid I can't make any sense of the installation guides!

I'm on a Mac, I've put the the nuArchitect folder here:
....LightWave3D_2018.0.6/support/plugins/scripts/Python

I've moved the nuArchitect_dat1 folder elsewhere so I can enter it's path in the your nuArchitect preference.

I've no idea what plugin to run in Modeller to get to the nuArchitect interface, all I get are errors.

Sorry if I'm being daft, what am I missing?

KANUSO
10-10-2018, 08:33 AM
Hello raw-m,

to help you out, I must get more Information about how exactly you install the bundle. What errors are fired? If all is right installed, every script shown in the previouse post "Description of the contents" should run. They all start with "nu" and Ends with ".py". If you enter the "Edit Menu Layout" form the mainmenu of the Modeler, and type in "nu" in the left TextBox, are than the scripts listed? If not there is something wrong with the Installation.

As nobody in my Company works with MAC anymore (the one we had isn't anymore present), so I cant test. Maybe someone who is working with MAC can help, if this is a Problem only on MAC.

Regards,
KANUSO

raw-m
10-10-2018, 11:03 AM
Thanks for your patience KANUSO!

I think the python scripts loads automatically which is great. Not sure which one I need to load in order to get the interface up? If I create a shortcut to "Python nuArches" for instance, I get the attached error.

If any Mac users have better luck please share :D

KANUSO
10-10-2018, 12:13 PM
Ok, this Looks like there is a bug in my code. This will affect all scripts. I will Change them and upload them again. I don't know how Long this will last. I will check the code for other path-issues with MAC.

Sorry for that.

If all goes well you only have to Exchange the old scripts with the new ones...

Rgards,
KANUSO

raw-m
10-10-2018, 12:59 PM
Cheers KANUSO, looking forward :D

KANUSO
10-10-2018, 03:33 PM
Bugfix to all scripts in the nuArchitect bundle.

There is an error, that belongs to all scripts. After a new Installation of nuArchitect bundle, the engine can't find the file "nuSoft.dat". This is because the path isn't defined to the scripts. To solve this Problem I have coded a script to initial set the path. This script is named "nuSetPath.py".
Please overwrite the scripts you have previousely installed with the ones from the following file.

143064

After you have installed the new Versions, restart LW.
Start the Modeler.
Change to the menu "Utilities"
Click on "Python" on the left side
Navigate to the path where you have installed the scripts
Choose the file "nuSetPath.py" and click "Open"
In the Dialog that opens, use the "Path" control to navigate to the path where you have the "nuSoft" structure installed (or enter the path by your own)
Click Store
Click the "nuSoft" button to the bottom right

Now the scripts should run correct.

Sorry again and regards,
KANUSO

raw-m
10-11-2018, 07:09 AM
Hi KANUSO

Nearly there but getting an error.

The new script works well. nuSetPath.py opens up and I can select my path and hit Store - everything seems OK, but when I click on the logo the window closes but nothing else happens.

Running any off the scripts gives me the attached errors. What is the make of the python script I should apply to the menus to open the interface?

KANUSO
10-11-2018, 08:44 AM
Hello raw-m,

here is a new nuSetPath.py
Please overwrite to old one with this.

143077

With the new one (which is much more wide) you will see after you press "Store" 2 pathes in the message-area.
The first one (the upper) will show the path that is stored, the second one (the lower) will Show where the file "nuSoft.dat" is stored.

Please check if this is both correct. And check if you will find the file "nuSoft.dat" in the second path.

If the file "nuSoft.dat" isnt present there, than you can try to create it by your own there (I don't know if the MAC maybe not allow you [the script] to write there).
Maybe a MAC-User can help out here.

The following is a copy of the file on my PC. You can edit it with a simple Editor for txt-files.
143078
The first line is the path where the nuSoft-structure is searched
The second line is a bool of the global TGA Status
The third is a bool of use the Color as Default
the 4th, 5th and 6th are the rgb values for the Color you want
the last 5 values are the values of the material-category

You can edit this file and place it where the error message say it is not found.

The last error on your console says:


...2018/nuSoft

this is the path where the files *.nal and so on are searched (the path which is to be set)
Is this really the right path or did this path really not exist?

Regards,
KANUSO

raw-m
10-11-2018, 12:05 PM
Thanks again for persisting. I’m away from my computer for the rest of the day and will pick it up in the morning:D

mummyman
10-12-2018, 07:51 AM
Kanuso.. do you have a video of all the useful items being used? I thought a while back, you did.. unless I'm thinking of something else. No biggie. Thanks!

edit... maybe I'm just thinking of the document page with the pictures.

Kryslin
10-13-2018, 08:37 AM
I will assume that the fix downloads aren't needed for Windows?

I put the nuSoft directory in my user directory, and the nuArchitect stuff in my LW_Python directory, and everything worked.

As a suggestion, for future versions, how about an installer script?

And now, to play with the GUI designer...

KANUSO
10-15-2018, 01:30 AM
I will assume that the fix downloads aren't needed for Windows?


If all scripts are working with your Installation, than you do not need the fixes. But if you get strange Messages in the python console about missing or wrong pathes, than you should use the fixes. In the creationprocess of the scripts, there is no Change.



As a suggestion, for future versions, how about an installer script?


Yes, I think this would be a nice idea, but on the rapid there will no idea comming up to me on how to do this.
The script must work on PC and MAC, it must handle every single file, and so on. If anybody can give me an idea on how to make such a script, I will work on it.
Maybe in the first step a script that creates the pathes and a description of what file must be installed where. I was not able to upload a single zip with all files in it, that is one of the reasons why I did not create a installer script.



And now, to play with the GUI designer...


You can use "F1" in the GUI-Designer to reach a HTML-Help.

Regards,
KANUSO

KANUSO
10-15-2018, 01:42 AM
Kanuso.. do you have a video of all the useful items being used? I thought a while back, you did.. unless I'm thinking of something else. No biggie. Thanks!

edit... maybe I'm just thinking of the document page with the pictures.

There is a Video out there from an early Version of nuArchitect. Maybe you have this in mind... It was created by erikals. If we all beg him to create an actual one, than he would maybe do it again :)
An Example HTML is to be found in the "nuArchitect_dat2.zip" This is a html wich shows examples of the modeler-output of the actual scripts.

Regards,
KANUSO

raw-m
10-16-2018, 03:43 AM
Thanks KANUSO! Got it working but couldn't have done it without your .dat example. In my case, I had to add a forward slash at the front of the path name - it's now working :D Thank you :D

Kryslin
10-16-2018, 12:31 PM
Some minor, annoying things from the Panel Designer:
-It is spamming 4193 to the python console.
-Also, clicking on a control in the previewed panel doesn't automatically select that control in the control list...
-Alternatively, the controls could be labeled like their lscript counterparts. Or is this something a template does?

Otherwise, very neat plugin. I had the framework for the Python version of my Symmetric Weight Assignment set up in minutes.

KANUSO
10-16-2018, 12:42 PM
Hello Kryslin,

the nuPanelDesign is accidently in the bundle. It is a pre-Version of the nuGUIDesign. So you should use nuGUIDesign. The spam is from "print the reached keycode". I will look at this an do not print further... sorry, I didn't remove the "hint-debug".

I don't know what you mean with:
Alternatively, the controls could be labeled like their lscript counterparts. Or is this something a template does?

Regards,
KANUSO

Kryslin
10-16-2018, 03:18 PM
Here's one from the nuGUIDesign...

Traceback (most recent call last):
File "C:\Users\Kryslin\My Python\nuArchitect\nuGUIDesign.py", line 45, in process
guiedit.designdialog(8,30,self.nusoftpath,nuSoftLi b.nulib)
File "C:\Users\Kryslin\My Python\nuArchitect\guiedit\__init__.py", line 856, in designdialog
dlg.extrainit(nsp)
File "C:\Users\Kryslin\My Python\nuArchitect\guiedit\__init__.py", line 1109, in extrainit
self.utempfill()
File "C:\Users\Kryslin\My Python\nuArchitect\guiedit\__init__.py", line 3706, in utempfill
dmytxt=[x for x in os.listdir(lookpath) if x.endswith(".nut")]
WindowsError: [Error 21] The device is not ready: 'D:\\nuSoft\\GUI\\Templates/*.*'

Something tells me I don't have something installed...

With regards to my second item:
The controls are named with their panel names. I was curious if there was a way to display the more familiar (to me, anyway) lscript names.

Kryslin
10-16-2018, 11:31 PM
Nevermind, I got it working. I did need to run the fix nuSetPath script.

KANUSO
10-17-2018, 02:02 AM
-Alternatively, the controls could be labeled like their lscript counterparts. Or is this something a template does?


The names, that will be generated by nuGUIDesigner are directly based on what you see in the leftmost listbox. So showing the names from LScript is not implemented in a fast way... But maybe I will find a way and a future version can Show LScriptnames too.

I think you are a bit confused about nuGUIDesign and the use of "Templates". The stored Templates (if you save a template, there is no saved template after installation) are nothing other than saved GUI's. So if you save a GUI, you indirectly have a template (or vice versa). The difference is the last char of the filename Extension (.nug .nut). This is a remnant of the early nuGUIDesign scripts.

I hope this will help you further.

Regards,
KANUSO

Kryslin
10-17-2018, 07:41 AM
Yep, it does.

Now, to figure out what ctlsep() is in panel-ese...
(Sym. Weight Assign uses them. So does Build Null Objects. And a few others.)

KANUSO
10-17-2018, 08:29 AM
Now, to figure out what ctlsep() is in panel-ese...


You can use a "canvas" to create a seperator. Use a canvas with reduced height to 0 or 1 (or at last very low) for a horizontal one, and with reduced width to build a vertical one.

Regards,
KANUSO

Kryslin
10-17-2018, 10:56 AM
Danke.

KANUSO
11-01-2018, 03:53 AM
-Also, clicking on a control in the previewed panel doesn't automatically select that control in the control list...


This is because I had an active bug-report open. The report has now been answered by a developer. It seems that I used a wrong function to update the selected items in a multilist. The developer told me to use the ctl.set_addr_int() instead of ctl.set_int() to handle it right. The next Version of nuGUIDesign will do this.

Regards,
KANUSO

KANUSO
11-02-2018, 03:12 AM
Hello,

the extension nuFountain is complete.
The Fit-Boxes are not active and not all UV-Mappings are generated. This will coming soon.

143266

Contents of the nuFountain.zip

exfountain1.jpg
exfountain2.jpg
exfountain3.jpg
fountain1.jpg

ggbhhd3.lwo
ggbhhd4.lwo
ggsnhd3.lwo
ggsnhd4.lwo

nuFountain.html
nuFountain1.html
nuFountain2.html
nuFountain3.html
nuFountain4.html

nuFountain.py

nuFountain.txt


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 all files with the extension ".lwo" into your "nuSoft" folder
Place the file nuFountain.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 nuFountain can do for you.

In the file nuFountain.txt you will find the text you are reading now. This file is not in use by nuArchitect.


Regards,
KANUSO

KANUSO
11-03-2018, 02:59 AM
Here the Version with active Fit-Boxes and UV-creation full active.

143275

You must have installed the nuFountain from the previous post!

Simply Change the nuFountain.py with the one from this fix.

Sorry for the inconveniences.

Regards,
KANUSO

KANUSO
11-03-2018, 04:46 AM
Hello,

this update fixes:
spam of "4193" (all keystrokes int) isn't present anymore
the selection of selected controls is updated in the "Active Controls" tree.

143277

In this zip you will find a file called "__init__.py"
What to do with this file?

Find the Folder "guiedit" in your "nuArchitect" structure. In this Folder you find a file called "__init__.py". Change this with the file from this zip.
Be careful, there are many files "__init__.py" in the nuArchitect structure. This is because how Python works.
In the case of interrest for us, we want to update the "guiedit" library from the "nuArchitect" library. So be sure to Change the "__init__.py from the Folder "...../nuArchitect/guiedit". And only this one.

Regards,
KANUSO

KANUSO
11-06-2018, 02:05 AM
Hello,

the Extension nuStoneSkin is complete.

143299

Contents of nuStoneSkin.zip

exstoneskin1.jpg
exstoneskin2.jpg
exstoneskin3.jpg
exstoneskin4.jpg
exstoneskin5.jpg
exstoneskin6.jpg

stoneskin1.jpg

nuStoneSkin.html
nuStoneSkin1.html
nuStoneSkin2.html
nuStoneSkin3.html
nuStoneSkin4.html

nuStoneSkin.py


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 nuStoneSkin.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 nuStoneSkin can do for you.


Regards,
KANUSO

KANUSO
11-09-2018, 03:50 AM
nuSelAssist is free

143327

nuSelAssist is to assist you in selecting
nuSelAssist is made to work in the Modeler

There are 2 types of selections nuSelAssist can aid you.
1: Pointselection
2: Polygonselection

And there are 2 modes of the selections.
1: Exclude
2: Include

And for every axis there are 3 settings.
1: All
2: -
3: +

And you have a value for each axis.

The selection is build as the following:
If the type is "Point", than you get a point selection.
If the type is "Polygon", than you get a polygon selection.

In point selection mode "Exclude" means that the axisvalue is excluded from the selection.
In polygon selection mode "Exclude" means only a polygon, that is complete in the "selection box" will be selected.

Axis setting "All" means that all values of the given axis are in the "selection box"
Axis setting "-" means that all values lower than "axis value" in the given axis are in the "selection box"
Axis setting "+" means that all values higher than "axis value" in the given axis are in the "selection box"

Play around with nuSelAssist to find out how it can aid you.

Regards,
KANUSO

KANUSO
11-10-2018, 03:39 AM
Fix:
If nuSelAssist is called prior to any nuArchitect bundle script, it ends up with an error. This is fixed.

Enhancement:
The selectionbox can now be entered directly

in selection box mode, the "Include" and "Exclude" with pointselection does not care because the Modeler do the VOLUME mode by itself.

To update you just have to excange the old nuSelAssist.py with the one from this zip.

143335

The nuSelAssist.py file should be placed where all other .py files you use with LW are located.

Regards,
KANUSO

KANUSO
11-11-2018, 02:15 AM
Sorry for updating in such a short period.

My colleagues asked me if they can get some spherical selection. So I worked again with the code of nuSelAssist.

Fix:
if nuSelAssist was started with something selected, it worked not correct. Now it deselects old selections prior to select new selection

Enhancement:
There is a new selection mode implemented. "Radial Selection"
This works as follows:
Imagine 2 spheres with their Center at a defined Point. Call them "Inner Sphere" and "Outer Sphere"
In pointmode all Points that are found in the outer sphere and not in the inner sphere are selected. If you choose "Use Outer Only", than all Points in the outer sphere are selected.
In polygonmode all Polygons that are complete placed in the outer sphere and have no Point within the inner sphere are selected.


For those of you who are experienced in coding:
In the code you will find code to create test objects. this is commented out, you can react it to test around, if you want to enhance nuSelAssist by your own. If you enhance it by your own, it would be nice if you share it here.

Simply Exchange the nuSelAssist.py with the one from this zip.

143338

Regards and sorry again,
KANUSO

erikals
11-11-2018, 02:49 PM
Sorry for updating in such a short period.
no problem, curiously following, as i'm sure so do others   :)

jwiede
11-13-2018, 05:13 PM
Kanuso,

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.

Thanks!

KANUSO
11-15-2018, 02:45 AM
Hello,

the Extension nuHeavyGate is complete.

143368


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
11-15-2018, 02:55 AM
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

Kryslin
11-15-2018, 09:08 AM
I would send a quick PM off to SBowie. He should be able to answer.

KANUSO
11-15-2018, 02:31 PM
I would send a quick PM off to SBowie. He should be able to answer.

Thank you. I sent a PM to SBowie.

KANUSO
11-16-2018, 04:01 AM
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
143371
includes data that is used by nuArchitect

The file
143372
includes html for showing some example Pictures

The file
143373
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
02-16-2019, 09:05 AM
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
02-16-2019, 10:50 AM
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

JohnMarchant
02-16-2019, 10:53 AM
Look forward to it Kanuso

Kryslin
02-16-2019, 03:26 PM
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
02-23-2019, 01:24 AM
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:



import os
import sys
import subprocess
...
def callprogram(filepath):
if os.name is "nt":
subprocess.Popen(filepath,shell=True,stdin=None,st dout=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

KANUSO
02-23-2019, 01:57 AM
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
03-13-2019, 05:39 AM
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

KANUSO
03-15-2019, 06:57 AM
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

JohnMarchant
03-15-2019, 07:36 AM
Thanks for the updates Kanuso

KANUSO
03-27-2019, 02:38 AM
@ 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