Results 1 to 13 of 13

Thread: Python help

  1. #1
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818

    Python help

    Hello.. I have no clue how to use Python. Can anyone point me in the right direction to getting this code working: http://www.clintons3d.com/plugins/lightwave/sosl.html

    I copied the whole page and pasted it into the Python Console... then clicked CTL-Enter to "run" it. Nothing but errors. Would love some help on this one!

    Thanks
    Brett

  2. #2
    Save it to a text file that has the file extension .py and install it like you would a plugin.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  3. #3
    On my website I have a script that does something similar. It's called Surface Copy if you're looking to just batch copy surfaces from one object to others.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  4. #4
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818
    I am... I'll check it out... thank you.

    Update... I got yours to run, but once I picked the folder, it gave me a bunch of line errors.. no clue..

  5. #5

  6. #6
    Quote Originally Posted by mummyman View Post
    I am... I'll check it out... thank you.

    Update... I got yours to run, but once I picked the folder, it gave me a bunch of line errors.. no clue..
    What are the line errors?

    We're you able to get Clinton's to work?
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  7. #7
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818
    No... Clintons did something similar in giving errors in the console. After I run yours and pick the designated folder, I get the Console window and it shows:

    Traceback (most recent call last):
    File "D:\Scripting\SurfaceCopy\SurfaceCopy.py", line 48, in process
    File "D:\Scripting\SurfaceCopy\SurfaceCopy.py", line 59, in execute
    File "C:\Program Files\NewTek\LightWave_2015.3\bin\lwsdk\pris\__ini t__.py", line 2020, in store
    raise InitException('Could not determine id of current script')
    lwsdk.pris.InitException: Could not determine id of current script

  8. #8
    OK I'll look into this. Never seen this error before and the script works on my end.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  9. #9
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818
    Most likely, it's on my end / user error.. lol At least I usually assume that. In my objects folder, is 1 object, then the 100 object sequences. Is there a limit to how many objects should be in the folder?

  10. #10
    Not to my knowledge as the idea behind the script is very basic. Do you have files other than lwos in the folder?
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  11. #11
    Just call me "Ray" raymondtrace's Avatar
    Join Date
    May 2003
    Location
    Ohio
    Posts
    273
    What programs are being used to copy/paste?

    Could line endings be the issue? ( https://en.wikipedia.org/wiki/Newline )

    I use Geany instead of Windows Notepad. It does not mangle line endings. ( https://www.geany.org/ )



    EDIT: I now see that copying the python script from the browser produces different line endings than if one directly downloads (right-click, save target [or link] as...) the PY file from this page. ( http://www.clintons3d.com/plugins/lightwave/sosl.html )

    Try downloading the file without copying from the browser.
    Last edited by raymondtrace; 08-10-2017 at 07:26 AM.

  12. #12
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818
    Bingo.... that worked on Clinton's script for me. I didn't think to right click and "save as" Hence my stupidity. Thanks... giving it a check...

  13. #13
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    818
    Yes... Clinton's worked.. either way... either plugin... I really appreciate the help with this!

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
  •