PDA

View Full Version : Naive user experience/ disappointments



jeric_synergy
09-10-2012, 10:35 PM
So, I'm trying to come up to speed as a non-programmer with Python. I'm just relating my experience today here so NewTek can see what a user may experience.

I figured I'd start by examining a NewTek supplied basic python script. Looking in the Python Layout folder I see "basic_barn.py" and "basic_barn.pyc". I try to use the Python dialog to run them both, but I get an error (see jpg).107801

Figuring I'm maybe going about it wrong, I attempt to load the PYC version as a plugin. It appears to load OK, but when I go looking for it in the MENU EDITOR, neither "barn", "Barn", nor "Basic" appears when doing a Search.

Note that this is a NewTek script.

Does this matter: the script has "import sys" and "import lwsdk". "lwsdk.pyc" exists, but I couldn't find a "sys.pyc" anywhere on the system . Does that matter?

Very disappointing, as it's either futzed up or less intuitive than I had hoped.

BeeVee
09-11-2012, 09:48 AM
Did you read the Python section of the addendum Jeric? It explains the difference between a .py and .pyc file and there is a large section documenting how to create a Python plugin for LightWave.

B

BeeVee
09-11-2012, 09:48 AM
Did you read the Python section of the addendum Jeric? It explains the difference between a .py and .pyc file and there is a large section documenting how to create a Python plugin for LightWave.

B

jeric_synergy
09-11-2012, 09:25 PM
I did. Since Python automatically creates a PYC file whenever it loads a PY file, and then runs that, the difference seems mainly academic.

My question here is why a NewTek supplied script fails on a newly installed version of LW11.0.3. I'm just pointing out the pitfalls a beginning user can/may encounter, and looking for a solution.

For instance, in the previous problem I encountered, system variables PYTHONHOME and PYTHONPATH had gotten overwritten by badly designed software. Only after extensive searching did I even learn of these critical variables.

Also, looking for clarification as why "lwsdk.pyc" is easily findable, while "sys.pyc" (??? correct extension?) is not, since in the script in question they are probably critical to its operation. This seems an appropriate question for the Python Scripting forum.

The ADDENDUM I'm looking at is dated 3/29/12. It has a short Python section, but no instructions on writing a plugin. I have a separate document by bob hood, "Writing a Python Plugin", but it is not part of the Addendum document, unless there's a later version.

BeeVee
09-12-2012, 03:58 AM
The ADDENDUM I'm looking at is dated 3/29/12. It has a short Python section, but no instructions on writing a plugin. I have a separate document by bob hood, "Writing a Python Plugin", but it is not part of the Addendum document, unless there's a later version.

There is a later version, two in fact and the most recent one can always be found on your account page on www.lightwave3d.com :) One of your requests was that documentation should be updated, I agree but you have to keep up too :)

B

PetGerbil
09-12-2012, 04:06 AM
I'm not a machine where I can check but, I vaguely remember seeing the basic_barn in the Item properties bit where the "Item Shape" resides. I seem to remember It
draws a barn shaped wire-frame when you add it to a null.

BigHache
09-12-2012, 06:08 AM
Yes this plug-in is used in the Item Properties, Geometry tab, Add Custom Object drop-down. There's been discussion about this how it's not always immediately clear how/where to use Python plug-ins, and where I think we started going was it should be the plug-in writer's responsibility to put this in comments in the code.

Also writing a Python plug-in is more closely related to writing a C/C++ plug-in than say LScript. As such you'll find the info in the C/C++ SDK more useful than LScript docs. The SDK will describe concepts but the syntax will not be what Python wants.

jeric_synergy
09-12-2012, 07:56 AM
Were documentation updates announced, or better, notifications emailed to users?

jeric_synergy
09-12-2012, 08:02 AM
I'm not a machine where I can check but, I vaguely remember seeing the basic_barn in the Item properties bit where the "Item Shape" resides. I seem to remember It
draws a barn shaped wire-frame when you add it to a null.
The point is it generates an error and doesn't appear to work.

And the commenting is just annoying. Since this is part of the LW distro, it should have a bit more educational value.

evenflcw
09-12-2012, 04:05 PM
it should be the plug-in writer's responsibility to put this in comments in the code.

Documentation could often be better. But you don't need to be able to read code or separate documentation to find out where a newly installed plugin can be accessed. Via the Edit Plugin panel just browse to the file you just installed, expand that node and observe what plugins are contained in the file! If you've used LW for a while, in 95% of the cases, you should be able to recognize the plugin class names and from that understand where they are accessed in the LW GUI. The remaining 5% are sets of plugins which mix various classes to try and go beyond what LWs plugin architecture was/is designed to do.

The things I found lacking in the Python/development docs was:
1) a guide to setup and develop using a more serious development environment than LWs built in Python Console. Compared to C-SDK, where a solution and projects for Visual Studio is provided, Python IS lacking!
2) an explanation about a couple of the funky files included with the LW installation - why they are there and what they could possibly be used for. These include: .../sdk/lwsdk11.0.zip; .../sdk/lwcoresdk11.0.zip; .../sdk/pdbs.zip; .../include/LWSDK/...; .../bin/python27.zip. I've now understood many of them are leftovers from the Core application. But if that's the case, they should be removed to avoid confusion. If that is not the case, I'd like to know why they are included and if I can benefit from them somehow.

jeric_synergy
09-12-2012, 04:22 PM
Via the Edit Plugin panel just browse to the file you just installed, expand that node and observe what plugins are contained in the file! If you've used LW for a while, in 95% of the cases, you should be able to recognize the plugin class names and from that understand where they are accessed in the LW GUI. The remaining 5% are sets of plugins which mix various classes to try and go beyond what LWs plugin architecture was/is designed to do.
This seems like a lot to put on the user, esp newbies. Confused me, at any rate.

BeeVee
09-13-2012, 03:03 AM
The things I found lacking in the Python/development docs was:
1) a guide to setup and develop using a more serious development environment than LWs built in Python Console. Compared to C-SDK, where a solution and projects for Visual Studio is provided, Python IS lacking!


Not sure what you mean here evenflcw? Since Python is scripting you can use any text editor, you don't need an IDE - Notepad++ is great and offers syntax highlighting and so on? If you want an IDE Microsoft has just released the 2012 version of Visual Studio Express.



2) an explanation about a couple of the funky files included with the LW installation - why they are there and what they could possibly be used for. These include: .../sdk/lwsdk11.0.zip; .../sdk/lwcoresdk11.0.zip; .../sdk/pdbs.zip; .../include/LWSDK/...; .../bin/python27.zip. I've now understood many of them are leftovers from the Core application. But if that's the case, they should be removed to avoid confusion. If that is not the case, I'd like to know why they are included and if I can benefit from them somehow.

As for these files, they are all still relevant to LightWave as it stands.

B

evenflcw
09-13-2012, 11:29 AM
With 1) I want a guide to setup the windows/osx environment and a common IDE for developing plugins so it has not just syntax highlighting, but also autocomplete! It saves so much time and helps you familiarize yourself with all the classes much faster.

For 2) the only one I know the use for is " .../sdk/lwsdk11.0.zip" (the c sdk). The rest I don't. Sure I see " .../bin/python27.zip" contains the python language source files or whatever... but does LW use it somehow or am I supposed to use it rather than grab the installer from python.org? How is lwcoresdk11.0.zip still relevant with the core application abandoned? I know some features of core have been implemented into classic LW. But does this SDK work with LW11 too? PDB files seems to be related to debugging. But are they for the c sdk or the python sdk? core or classic sdk?

BigHache
09-13-2012, 12:15 PM
For 2) the only one I know the use for is " .../sdk/lwsdk11.0.zip" (the c sdk). The rest I don't. Sure I see " .../bin/python27.zip" contains the python language source files or whatever... but does LW use it somehow or am I supposed to use it rather than grab the installer from python.org?

LW would have to use that python27.zip file, otherwise if you installed Python 3.x on the computer and LW looked for that it would create issues. Other files LW uses for Python are lwsdk.pyc and pcore.pyc. It helps if you get help on each of these and then save that console output as a .py file that you can reference as you develop plug-ins:


help('lwsdk')


help('pcore')

The pcore.pyc file is +18k lines so make sure you up the max lines in your PCore console accordingly, and get a sammich because it takes a minute.

Regarding your 1), thinking...

skarloc
09-13-2012, 01:09 PM
For 1), would Eclipse help ? My former company used that and showed me auto-complete stuff. My current company is heavily Linux/MacOS oriented, and they love using vim with additional stuff allowing auto-complete and templates. Fortunately, I'm not a developer for them, so I'm not subjected to vi... However, I'm not an Eclipse expert. I use wscite, and that doesn't have auto-complete, as far as I've worked out...

BeeVee
09-13-2012, 01:46 PM
Okay, I have more clarification. "The lwcoresdk Zip and the PDBs should be ignored." They will be removed from the builds from now on as well. Thanks for spotting them. :) I can say also that most of our developers use Visual Studio Express, not only to code for the program but also to write LScripts and Python scripts. I believe VS' "intellisense" is an autocomplete function.

B

BeeVee
09-13-2012, 01:46 PM
Okay, I have more clarification. "The lwcoresdk Zip and the PDBs should be ignored." They will be removed from the builds from now on as well. Thanks for spotting them. :) I can say also that most of our developers use Visual Studio Express, not only to code for the program but also to write LScripts and Python scripts. I believe VS' "intellisense" is an autocomplete function.

B

evenflcw
09-13-2012, 07:40 PM
Thanks BigHache, skarloc and good to hear BeeVee! I just want as clean install as possible so I know I'm not overlooking any available alternatives. If there's stuff I'm confused about, I keep thinking maybe there's a silver bullet, and I'm missing out. Just knowing NT is using VS Express themselves is good to know and a good place to start.

jeric_synergy
09-13-2012, 10:17 PM
Thanks BigHache, skarloc and good to hear BeeVee! I just want as clean install as possible so I know I'm not overlooking any available alternatives.
For people less experienced that evenflcw, a clean install is even more important, because superflous and/or redundant files can be super confusing.

I'm still not sure if the python27.zip is a file that NEEDS to be left in place, or if it's just a convenience that one can ignore.

Would it be too much to ask for a simple list of all files and their functions in an install?

BeeVee
09-15-2012, 04:06 AM
As BigHache says: "LW would have to use that python27.zip file, otherwise if you installed Python 3.x on the computer and LW looked for that it would create issues. Other files LW uses for Python are lwsdk.pyc and pcore.pyc. It helps if you get help on each of these and then save that console output as a .py file that you can reference as you develop plug-ins:"

B

jeric_synergy
09-15-2012, 01:13 PM
As BigHache says: "LW would have to use that python27.zip file, otherwise if you installed Python 3.x on the computer and LW looked for that it would create issues. Other files LW uses for Python are lwsdk.pyc and pcore.pyc. It helps if you get help on each of these and then save that console output as a .py file that you can reference as you develop plug-ins:"
B
1) It's still not clear to me if that file is actually accessed by LW. Does LW actively look inside that ZIP?

2) Why the heck should users have to do this? Can't someone at NewTek do that ONCE, include it in the distro, and save us all untold man-hours of doing it ourselves???

It's like some sort of hazing ritual. :devil:

GregMalick
09-15-2012, 01:24 PM
jeric is right.

I thought the new philosophy was that people shouldn't have to do what the computer is best at -- I think the ZBrush directory setup was the example....
so NT, please don't torment us -- give us candy instead.

BigHache
09-15-2012, 05:14 PM
2) Why the heck should users have to do this? Can't someone at NewTek do that ONCE, include it in the distro, and save us all untold man-hours of doing it ourselves???

I agree with this, but I don't have an answer. If I were to speculate it would lean toward Python not being the sexiest of new features so it still has some polishing needed. It's like Python is there... sorta. Even all LW plug-in classes are not yet available for Python. The class that I would like to see added is Nodes, but we're still only working with 1/3 of the total classes to LW.

The attachment contains two .py files, both being just saved logs from the PCore Console after getting help. I know it's not the solution but it's the best I got.