PDA

View Full Version : Layout Command Port Python Package Bug



kmacphail
01-03-2018, 05:32 PM
Hi All,

I was exploring some of the new Layout Command Port features and ran across a bug when following the Python Package video tutorial from the new documentation:
https://docs.lightwave3d.com/display/LW2018/Command+Port

I get the following error after cd'ing into D:Program Files\NewTek\Lightwave_2018.0\support\python and executing the Python commands from the tutorial that should launch a new instance of Layout:


PS D:\Program Files\NewTek\LightWave_2018.0\support\python> python
ActivePython 2.7.10.12 (ActiveState Software Inc.) based on
Python 2.7.10 (default, Aug 21 2015, 12:07:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from lwcommandport import layout
>>> l = layout.Layout()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "lwcommandport\layout\__init__.py", line 126, in __init__
raise Exception(msg)
Exception: LightWave does not appear to be installed on your machine!
>>>

The solution is to edit the layout\__init__.py file and change line 110 from:

ver = kwargs.get("version", "2016")

...to...

ver = kwargs.get("version", "2018")

At that point the LightWave install is found and Layout launches as it should:


PS D:\Program Files\NewTek\LightWave_2018.0\support\python> python
ActivePython 2.7.10.12 (ActiveState Software Inc.) based on
Python 2.7.10 (default, Aug 21 2015, 12:07:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from lwcommandport import layout
>>> l = layout.Layout()
Launched Layout process with args "--command-port=LW_46A738BB"
>>>

I've filed a bug report but maybe this will help someone else in the meantime.

Cheers,

-Kevin