nuArchitect python version

KANUSO

New member
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:
View attachment 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.

View attachment 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
 

Attachments

  • install2.jpg
    install2.jpg
    6.6 KB · Views: 331
  • install1.jpg
    install1.jpg
    29 KB · Views: 395
Description of the contents

What is included in the base packet of nuArchitect bundle?

  1. nuArches - is to create gothic/roman arches
  2. nuArchStones - is to create arches made of single stones
  3. nuBridgeStones - is to create bridges made of single stones
  4. nuCathCei - is to create cathedral like ceilings
  5. nuCirclePlan - is to create Stone circles
  6. nuColumns - is to create columns
  7. nuCrackedStones - is to create cracked stones
  8. nuDoors - is to create doors
  9. nuFences - is to create fences
  10. nuFloors - is to create floors
  11. nuGates - is to create gates
  12. nuGothBlk - is to create blocks of gothic/roman look
  13. nuGothXPass - is to create gothic passes (I don't know if this is called "pass" in english)
  14. nuGroundplan - is to create stonewalls that follow a groundplan
  15. nuOrnaments - is to create ornaments (like those from a blacksmith)
  16. nuPedestals - is to create pedestals
  17. nuPlaque - is to create plaques
  18. nuRoofGable - is to create Roof gables
  19. nuRopePath - is to create ropes/chains that follow a path
  20. nuRopes - is to create ropes/chains that hanging around (sag)
  21. nuRota - is to create rotational objects
  22. nuSockets - is to create sockets like those from statues
  23. nuStairStones - is to create stairs made of single stones
  24. nuTombstone - is to create tombstones
  25. nuWallStones - is to create walls with Windows, passes and doors, made of single stones
  26. nuWell - is to create wells
  27. nuWinsGoth - is to create gothic/roman windows
  28. nuWinsStd - is to create Standard Windows
  29. nuGUIDesign - is to create scripts of a GUI Definition (this is a complex script that is made to create python scripts)
  30. nuIconDesign - is to create Textfiles, that can be used to cut and paste Icon-definitions in a python script
  31. nuImage2Dat - is to create Textfiles, that can be used to cut and paste Image-definitions in a python script
  32. nuUV2TGA - is to save a UV's out to a TGA file

Regards,
KANUSO
 
The files

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
View attachment 143058
includes data that is used by nuArchitect

The file
View attachment 143059
includes html for showing some example Pictures

The file
View attachment 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
 

Attachments

  • nuArchitect_dat1.zip
    4.6 MB · Views: 405
  • nuArchitect_dat2.zip
    3.2 MB · Views: 402
  • nuArchitect_src.zip
    672.2 KB · Views: 385
Last edited:
Additional information

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
 
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?
 
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
 
Last edited:
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
 

Attachments

  • nu.png
    nu.png
    36.8 KB · Views: 350
  • nu_error.png
    nu_error.png
    51.9 KB · Views: 370
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
 
Bugfix

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.

View attachment 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
 

Attachments

  • nuArchitect_fix.zip
    599.3 KB · Views: 359
Last edited:
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?
 

Attachments

  • ERROR.png
    ERROR.png
    57.7 KB · Views: 356
Hello raw-m,

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

View attachment 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.
View attachment 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:
Code:
...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
 

Attachments

  • nuSetPath.zip
    37.2 KB · Views: 370
  • nuSoft.zip
    146 bytes · Views: 352
Last edited:
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
 
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.
 
Last edited:
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...
 
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
 
Last edited:
Back
Top