Follow us on Facebook Follow us on Twitter Flickr Watch us on YouTube
Register
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    4

    Python in lightwave

    Besides the python console button, I can't find any info about how to create python scripts for Lightwave.
    Could anyone bring some light to this matter?
    Sdk documentation lacks any info about how start with this.
    I have previous experience in maya but I can't figure out how to work in lightwave.

    Thanks in advance.

  2. #2
    Super Member Red_Oddity's Avatar
    Join Date
    Feb 2003
    Location
    A thousand years from here
    Posts
    3,343
    Chuck posted detailed instruction on how to create Python plugins/script here :http://forums.newtek.com/showthread.php?t=123672

    To check out some working examples, go to your LW 11 install directory, from there :
    \support\plugins\scripts\Python\
    I have no special talents. I am only passionately curious. - Albert Einstein
    visit my company site : House of Secrets
    visit my personal site : svenneve.com

  3. #3
    Registered User
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    4
    Quote Originally Posted by Red_Oddity View Post
    Chuck posted detailed instruction on how to create Python plugins/script here :http://forums.newtek.com/showthread.php?t=123672

    To check out some working examples, go to your LW 11 install directory, from there :
    \support\plugins\scripts\Python\
    Thanks, too bad I don't belong to the Core community, so I can't get acces to that info. I think maybe now that lightwave 11 is officially out they can make public these info.

  4. #4
    Karma Chameleon BigHache's Avatar
    Join Date
    Sep 2006
    Location
    Future Past Life
    Posts
    1,755
    Here is the info that Chuck posted in the Core forums. Should be okay to post, there's nothing special about it. If I'm wrong, that's why we has a sheriff.

    I'm working on writing my own doc and started a video series, but I'm learning Python at the same time so it won't be super fast coming.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    4
    Thanks a lot! That's what I was needing!

  6. #6
    I'd like to know more about Python in LW also.

    I did some lscript a few years ago and found it very tricky. I wanted to turn lights on and off during an animation, but it turned out that the scripts would randomly run several times per frame. I had to keep track and ratchet through the scene - so that the script would run only once per frame.

    Is Python in Lightwave 11 able to do the above where you can easily change object location, shape, color or other parameters depending on what frame you are in. ie: if frame = 10: do this ...

    This would allow procedural animation/motion graphics using code rather than manual keyframing.

  7. #7
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    Burbank, California, USA
    Posts
    12,820
    You would need to track which frame you're on, and do something based on that.

    Also, Python has full SDK access, whereas LScript doesn't.

    There is currently no specific documentation on writing Python in LScript beyond the commented examples, this is something we naturally want to address, it's just a very time consuming job that would have been impossible to have done for the release.
    UX / Product Design Manager
    LightWave 3D Group
    A Division of NewTek Inc.
    ______________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools

    "Beautiful things are easier to use" - Don Norman


  8. #8
    Karma Chameleon BigHache's Avatar
    Join Date
    Sep 2006
    Location
    Future Past Life
    Posts
    1,755
    @nurbman Tagging in on what Matt said, if you look at the C SDK you can get an idea of how to do what you're asking, probably more so than by looking at the LScript docs.

    For instance, these two classes are very similar to the C SDK docs:

    lwsdk.LWLightAccess

    lwsdk.LWLightInfo

    Understanding how to convert the C SDK to Python syntax is the kicker right now. To answer your question, is it possible to do with Python, I think the answer is Yes, I'm still learning this myself though.

  9. #9
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,641
    @nurbman
    From the sound of things you did not use the right type of plugin class and you did not use it the right way. Perhaps it's the fault of documentation, but I doubt it was the fault of lscript! Some plugin classes can be called several times a frame. This is not the fault of lscript, but a result of how LWs architecture is setup and it is not wrong in any way. It will also be the same for all plugin-platforms!

    What properties can be animated safely during animation is any property that has an envelope! You could animate other properties, that are set by commands, but realize that you are attempting to change LWs state mid-render, resulting in possible crash or no effect at all. For example there is an animatable limited region script which does this (a master, provides an envelope, then issues the command as need be). Unless LW was recently "fixed" I do not believe it worked when network rendering. It would be wonderful if we could animate anything.
    Last edited by evenflcw; 02-18-2012 at 10:58 AM.

  10. #10
    I wasn't able to animate a random pattern of blinking lights probably due to the envelope issue (or my lack of knowledge). Moving a lit object in lscript, every 10 frames -instantly, did work though.

    I'm hoping that the Python/sdk addition will give some additional freedom to do more stuff in code - but I realize that there are limits due to the nature of the animation/rendering pipeline.

    Feel free to mention any newly discovered abilities that the addition of Python allows. (or point to any new documentation)

    Thanks for the replies

  11. #11
    Quote Originally Posted by nurbman View Post
    I wasn't able to animate a random pattern of blinking lights probably due to the envelope issue (or my lack of knowledge). Moving a lit object in lscript, every 10 frames -instantly, did work though.

    I'm hoping that the Python/sdk addition will give some additional freedom to do more stuff in code - but I realize that there are limits due to the nature of the animation/rendering pipeline.

    Feel free to mention any newly discovered abilities that the addition of Python allows. (or point to any new documentation)

    Thanks for the replies
    Take a look at samples provided in plugins/scripts/python folder. You can learn a lot from those examples. Also it seems that you can querry pretty much anything that is available in LW SDK with python so take a look at SDK docs and examples also.

  12. #12
    Member
    Join Date
    Oct 2005
    Location
    Valdosta, GA
    Posts
    248
    BigHache,

    Thanks for the vids so far. Like how you are doing them. Make sense and it is easy to follow.

  13. #13
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    5,970
    Quote Originally Posted by nurbman View Post
    I'd like to know more about Python in LW also.

    I did some lscript a few years ago and found it very tricky. I wanted to turn lights on and off during an animation, but it turned out that the scripts would randomly run several times per frame. I had to keep track and ratchet through the scene - so that the script would run only once per frame.

    Is Python in Lightwave 11 able to do the above where you can easily change object location, shape, color or other parameters depending on what frame you are in. ie: if frame = 10: do this ...

    This would allow procedural animation/motion graphics using code rather than manual keyframing.
    Your problems are related to lack of knowledge.. Even C/C++ plugin can't do what you want. So, python or lscript, which are another layer above plugins won't do it too. If they will work, it will be by accident, and only in some rare situations. f.e. it won't work on render farm, or won't work when image-sequence is rendering from middle.

    Your plugin/script should be run once and make envelope with keys to 0 and 1.

    Plugin classes which can be run during rendering are: nodes, shaders, volumetrics, image filters and pixel filters. They need speed, which any interpreted language cannot give them. Who wants to have 100 times slower rendering?

  14. #14
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    37
    Quote Originally Posted by Matt View Post
    Also, Python has full SDK access, whereas LScript doesn't.
    Well, certainly "fuller" access to the SDK. To be sure, there are still elements and plug-in classes that I've not yet implemented.

  15. #15
    Super Member
    Join Date
    Mar 2003
    Location
    Great State of Georgia
    Posts
    421
    "\support\plugins\scripts\Python\" There aren't any files, that I can find, that would show examples. Every folder under "Layout" and "Modeler" contain empty folders. How do I get to the examples?
    Enjoy Life, this is not a rehearsal!!!

 

 
Page 1 of 2 12 LastLast

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
  •  
All times are GMT -6. The time now is 10:35 PM.
Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Copyright 2000-2012, NewTek
vBulletin Skin By: PurevB.com