Results 1 to 12 of 12

Thread: anyone using Jetbrains PyCharm for LW?

  1. #1
    Registered User sami's Avatar
    Join Date
    Jul 2003
    Location
    TopLeft Viewport
    Posts
    994

    Question anyone using Jetbrains PyCharm for LW?

    Just wondering how it is and if autocomplete works for LW python api with it? I want to switch from LScript to Python and expect that the latest 11.6 build makes Python equivalent or better than LScript for LW and figured PyCharm would make my life/the switch easier if it supported LW's python api in the ide... any thoughts on this or something better than Notepad++?

    http://www.jetbrains.com/pycharm/

  2. #2
    Yep .. use pycharm for about 3 years and also use it for lightwave/houdini python hacking .. is simply the best ide and the money worth a thousand times ( since yesterday there is a free open source edition of pycharm too )
    martin dulovits
    technical director

    www.woogieworks.com

  3. #3
    Just started today. I wrote a script for auto-completion based on other posts here:
    http://forums.newtek.com/showthread....-pycharm-charm
    http://forums.newtek.com/showthread....hlight=pycharm
    http://forums.newtek.com/showthread....Py-amp-WingIDE

    A zip archive containing the scripts is attached.

    Basic steps:
    install python v 2.7.x - "x" is whatever version is current
    install pycharm
    setup pycharm to use the python 2.7.x and the path to the lightwave bin(see the forum posts mentioned earlier)
    unzip the archive to the scripts folder and run the generate_interface_files.py file and choose the python site-packages folder(C:\Python27\Lib\site-packages)

    Notes:
    It works on LW 11.5.1
    I had to comment out the "pcore" sections to get it to work with LW 11.6
    It does not see the PRIS stuff
    Attached Files Attached Files
    Last edited by clintonman; 09-25-2013 at 08:30 PM. Reason: forgot a link

  4. #4
    Registered User sami's Avatar
    Join Date
    Jul 2003
    Location
    TopLeft Viewport
    Posts
    994
    Wow! That's awesome clintonman! Thanks for sharing, I'll download the new free version and try your files. That should certainly help getting up to speed with LW Python much easier!

  5. #5
    http://daniepstein.com/daniepstein/t...t-of-debuggery
    this one sounds really interesting. maybe with this technique it is even possible to debug lightwave or houdini python scripts ..
    martin dulovits
    technical director

    www.woogieworks.com

  6. #6
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,763
    Been a big fan of pyscripter here... https://code.google.com/p/pyscripter/
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  7. #7
    I found a way to make the pris modules work for autocomplete. The way I got it to work is to name the python files with underscores instead of periods. I get autocomplete but the import format is wrong. Can manually change it back with search and replace, but not ideal.

    Basic steps are still the same:
    install python v 2.7.x - "x" is whatever version is current
    install pycharm
    setup pycharm to use the python 2.7.x and the path to the lightwave bin(see the forum posts mentioned earlier)
    unzip the archive to the scripts folder and run the generate_interface_files.py file and choose the python site-packages folder(C:\Python27\Lib\site-packages)

    also works with Python Tools for Visual Studio


    autocomplete works
    Code:
    from lwsdk_pris import center
    from lwsdk_pris_modeler import Mesh, getdir, load, init, fileexists
    required format for Lightwave
    Code:
    from lwsdk.pris import center
    from lwsdk.pris.modeler import Mesh, getdir, load, init, fileexists
    Any ideas?
    Attached Files Attached Files

  8. #8
    Got it! It works if the folder structure and file names are duplicated from C:\Program Files\NewTek\LightWave11.6.3\bin\lwsdk... so instead of lwsdk.py use \lwsdk\__init__.py

    Here's the latest script that provides completion for lwsdk, pris and modeler.
    Attached Files Attached Files

  9. #9
    Registered User Diepgroen's Avatar
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    50
    PyCharm2016 and LW2015 Autocompletion

    I'm really new to LWPython but my curiosity is large .
    I want to play around with the LightwaveSDK and at least start experimenting with code. I got my Jetbrain PyCharm2016.2.1 community edition today and before anything gets to complicated I'm allready stuck.

    In this thread an autocompletion code for the 11.5 SDK was posted 3 years ago? Could there be someone using autocompletion for the latest Lightwave 2015 SDK? There is also a mention about setting up a path to the Lightwave.bin. I've noticed that PyCharm 2016 Settings and interface has changed and things look different. Which makes it a bit confusing to get things setup right.

    If you have some tips and gotcha's on setting up Pycharm2016 to work with the LW2015 SDK and autocompletion. Please give me a shout out.

  10. #10
    Quote Originally Posted by Diepgroen View Post
    PyCharm2016 and LW2015 Autocompletion

    I'm really new to LWPython but my curiosity is large .
    I want to play around with the LightwaveSDK and at least start experimenting with code. I got my Jetbrain PyCharm2016.2.1 community edition today and before anything gets to complicated I'm allready stuck.

    In this thread an autocompletion code for the 11.5 SDK was posted 3 years ago? Could there be someone using autocompletion for the latest Lightwave 2015 SDK? There is also a mention about setting up a path to the Lightwave.bin. I've noticed that PyCharm 2016 Settings and interface has changed and things look different. Which makes it a bit confusing to get things setup right.

    If you have some tips and gotcha's on setting up Pycharm2016 to work with the LW2015 SDK and autocompletion. Please give me a shout out.
    As far as I can remember you have to install with uncompressed python files ( installer ) and then point pycharm to this directory. I will take a look at the current way in the evening and update you.
    martin dulovits
    technical director

    www.woogieworks.com

  11. #11
    Registered User Diepgroen's Avatar
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    50
    Quote Originally Posted by dulo View Post
    As far as I can remember you have to install with uncompressed python files ( installer ) and then point pycharm to this directory. I will take a look at the current way in the evening and update you.
    I'm excited. I did somehow get the 11.6 autocompletion to function as examples has been mentioned before in this thread. Looking forward to getting the 2015.3 autocompletion working.

    Glad you can look into it dulo.

  12. #12
    Registered User Diepgroen's Avatar
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    50
    I finally wrapped my head around using the generate_interface.py script to produce the lwsdk.py and pcore.py for autocompletion in PyCharm. Having little programming experience, a simple task like executing the script was trowing me off. Where do I execute? In LightWave or in PyCharm. This simple logic wasn't obvious at first and than I finally understood what this script was doing and it should be executed from within Layout.

    For those who knows nothing about LWPython, like myself this is how i got it working.

    01) I'm on a mac.
    In Layout I go to Utilities > Python

    02) The file browser opens and I navigate to the generate_interface folder where the two python files are: generate_interface.py and generate_pi.py. You can find the script in this forum thread.

    03) I chose the generate_interface.py and clicked open.

    04) The Generate Python Interfaces window pops up.

    05) The destination folder where the generated files will be stored must be selected. In my case /Library/Python/2.7/site-packages

    06) I press OK

    07) I get an error message [ IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/lwsdk.py']

    08) At this moment I don't have permission to write to this location just yet.

    09) I go to the folder:/Library/Python/2.7/site-packages and I select the folder site-packages and press the keyboard shortcut [cmd i]. This opens the info panel for this folder.

    10) I go to the 'Permissions' dropdown and temporarily change this folder to be writable code 775

    11) I repeat steps 1 to 6 and than the files are generated and saved in the site-packages folder.

    12) I set the "Permission" of the site-packages folder (step 10) back to it's original state code 755

    13) If everything went as planned i can now use the autocompletion in PyCharm for my LightWave Python scripting.

    Hope this helps anyone new to anything Lightwave and Python who are as clueless as I was.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •