Collada plugin for After Effects

More info here
Lightwave Plugins and Scripts

Autodesk MatchMover Import for LW11

right click the link above to download

matchmover panel

 

Lightwave 11.6 python script for importing an XSI vbscript file exported from Autodesk MatchMover.

  • Camera parented - if checked the camera will be parented to a null heirarchy otherwise it will be set to use same as item for the null
  • Import camera FOV animation - import animated changes of the fov

April 20 2014 - v1.2 fix camera rotation

April 18 2014 - v1.1 fix camera fov math

  1. Match move a file sequence
  2. File Export - XSI ; VB Script (*.vbs)
  3. Now in Layout - set the frame rate of the scene to match
  4. If the camera tab is active move to another tab
  5. run the script and wait - there is no progress indicator
  6. load the image sequence
  7. set compositing to use the sequence
  8. set the camera width and height to match the sequence size
  9. optionally bake the camera keyframes

To install copy the matchmovervbsimport.py file to the python script's plugin folder, something like:

"C:\Program Files\NewTek\LightWave11.6\support\plugins\scripts\Python\"

April 17, 2014

Blender Fluids Importer

right click the link above to download

click below to see the animation

lightwave fluids panel

Lightwave 11.5 python script for loading the files generated by the Blender fluids simulation. It reads the geometry, velocity and particles information to generate a series of lwo files. The velocity creates 4 sets of weight maps for the x,y,z directions and one weight map for speed. It also creates a morph based on the velocity which can be used for motion blurring. The particles mesh gets a weightmap for size and like the mesh the velocity is translated to a morph map. Particles will import into 4 selection sets: Drops, Tracers, Floats and unknown.

When subdivisions are set to 2 or more and generate particles is greater than zero then particle data is used in the generation of the fluid mesh. Setting tracer to specific count does not make for constant count so not an option for MDD format.

Modeler's Undo Levels must be set to 1 or a memory leak will crash Modeler.

  • Undo Levels - reminder must be set to 1 or will crash
  • Fluid type - choose one of the 3 fluid types generated by Blender
  • Select a fluid file - choose any of the files bobj.gz, bvel.gz, gz. The fluid type setting will determine which set of files gets imported.
  • First frame - start frame for the animation range
  • Last frame - end frame for the animation.  If both First and Last frame are left at -1 the script will automatically determine the correct values for the entire range
  • Subpatch the geometry - useful for smoothing out the geometry of preview type fluids. Final fluids are generally too dense to benefit from subpatching.
  • Include particle data - will import the particle files as point clouds when the fluid type is set to final. If the fluid type is set to "only particles" this check is ignored.
  • Flip normals - use if the fluid mesh is inside out
  • Delete unknown particle type - removes what looks like error particles
  • Particle Drops to their own sequence - drops saved to a seperate file sequence
  • Particles Floaters to their own sequence - floaters saved to a seperate file sequence
  • Particles Tracers to their own sequence - tracers saved to a seperate file sequence
  • Minimum particle size - remove very small particles to match Blender sim results.  Fewer particles should translate to better performance in Layout.  Set to 0 to get all the particles.
  • Scale X,Y,Z - scale the imported mesh. There are seperate controls for xyz to account for non-uniform fluid domain scaling.
  • New file name prefix - the lwo files will use this prefix instead of the default "fluidsurface". Can load several sequences into Layout. Clear the field to use the prefix of the files generated by Blender.

Tutorial Link: Blender Fluids to Lightwave

The easiest way to use this is to choose final or preview fluid, select any fluid file and press OK.  When the Blender simulation is set for subdivision value of 2 or more, the particles get incorporated into the final version of the fluids mesh.

preview vs final

This image shows the difference between preview and final fluids, both set to the same resolution. The difference is that the final fluid takes advantage of the combination of domain boundary subdivisions combined with particle generation.

Note: If you get a "delete unknown particles" message followed by an "error 2904" try turning off the unknown particle deletion option

February 19 2014 (v 1.10):

  • add version number to the title
  • minimum particle size to remove tiny mist like particles and improve performance

December 3 2013:

  • option for each particle type to it's own object file - layers are not compatible with object replacement in Layout
  • can import particles with the preview mesh
  • velocity weight maps added to the particles

December 2 2013:

  • create selection sets for the 3 types of particles: Drop, Float and Tracer
  • unknown type particles deleted - this may be unstable, random error 2904 in testing
  • fluid particle velocity scaled to more closely match the mesh vertex velocity
  • particle groups each to their own layer

November 23 2013:

added ability to rename the prefix of the lwo files created in order to enable the possibility of loading more than one fluid sim in the same scene file. The docs in Blender say you can set your own prefix inside Blender, but I can't figure out how it can be done.

November 19 2013:

fix for LW 11.6 release version changes

October 25 2013:

added reminder in UI to turn undo levels down

October 21 2013:

will not crash when fluids frame is empty

October 20 2013:

  • fixed error when no velocity file is generated from Blender
  • fixed Blender right to Lightwave left handed coordinates
  • added individual scale values for X, Y and Z for the case when the fluid domain is not scaled uniformly in Blender

July 23 2013:

  • reduced the default import scale
  • added import scale field
  • fix random spikes cause by bad triangles
  • added progress indicator with auto console open

July 15 2013:

  • easier to use
  • more error checking
  • discovered a large memory leak and a workaround for it
  • fix bad version upload

July 10 2013:

  • removed scaling from mesh velocity for stronger morphs
  • added velocity morph to the particle mesh

fluid domain

Settings used in the animation above. The timeline was set for 24 frames which when combined with the end time of 1.000 results in 24 frames per second animation.

Usage:

  1. Generate a fluid simulation in blender
    1. including the particles set value between 0 and 1
    2. subdivision level 2 if the particles will be generated into the fluid mesh
    3. might be able to control particle with explicite particle objects(size ?)
  2. Open modeler and set the undo levels to 1, this reduces the memory leak.
  3. Create dummy object with the desired material applied to it. The first surface of this object will be copied to the new fluid meshes.
  4. Run the script and choose any of the files generated by Blender. A set of lwo files are generated from the fluid meshes. Optionally particle mesh series are also produced.
  5. Wait - there is some feedback but it's sporadic at best
  6. Close modeler without saving.
  7. Open layout and create a null.
  8. Load the first lwo file of the set and parent it to the null.
  9. Rotate the null -90 degrees in pitch to turn the system right side up.
  10. Open the geometry tab for the mesh and set the object replacement to object sequencer.
  11. Open the deform tab for the mesh and add morph mixer.
  12. Create anorther null and animate it over 1 frame to move 1 m in Y. The value in Y will be used to scale the overall motion blur(1m=100%).
  13. Open the graph editor for the null and set post behavior on Y motion to repeat.
  14. Load the mesh into the graph editor and add a channel follower motion modifier and have it follow the animated null's Y position.
  15. Set the camera to use motion blur.

Notes:

  • Modeler undo levels needs to be set to the lowest value because of a memory leak
  • The material for the sequence can be changed in Layout by loading/creating an object in the scene with the same surface name and setting the surface editor to "edit by scene" instead of object. The object sequencer fluid will adopt the new surface settings. This only works when the surface is not nodal.
  • Fluid boundary with subdivisions(>=2) is required for particle detail enhancement to the fluid mesh.
  • The morph map of the fluid is animated to produce motion blur.

Some more notes(WIP):

Assuming most of the scene is setup in Lightwave and Blender is used just for it's fluids simulation. Both programs should be set to the same frame rate.

Export from LW:

  1. Be sure all objects have at least 2 keyframes even if they don't move, otherwise they will be adjusted to Blenders Z-up world.
  2. If an object is animated with Bullet rigid body clone it, turn bullet off on the clone, add follower to it then run mental fish bake keyframes lscript after baking remove the follower then remove the bulleted object from the scene - ?make invisible not export collada? <- test this - nope it exports so delete the bullet animated item if it will interfere...
  3. If the domain is created in Lightwave and does not have scale of 1, rotations of 0 and at the origin then save the object transformed or apply the transforms in Blender before running the simulation.
  4. ?Fluid obstacle meshes need some resolution/detail for good collision?
  5. Export Collada from Layout with no scene scale
  6. Run the Collada Export Fixer found on this page so the animation will transfer properly

Import to Blender:

  1. Open Blender and delete all items from the scene
  2. Import Collada - check on Import Units.  The scene will import on it's side.
  3. Make a cube for the fluid or maybe use an imported item from the scene.
  4. Object > Quick Effects > Quick Fluid
  5. Size the fluid domain to fit the scene and fluid placement.  Set the preview mode to Geometry to see it's extents properly.
  6. The fluid domain needs to be at the origin, with no rotation and a scale of 1 for the easiest translation back to Lightwave.
  7. Object > Apply > scale and rotation with Object > Apply > location will "freeze" the transforms.  This is needed because the fluid files do not have transform information embedded within them.
  8. Scene tab and set gravity to -9.8 in Y and set Z to zero, the change will not show in the domain settings.
  9. If the bake freezes try setting the fluid obstacle volume as "Shell" type. 

Import the fluid to Lightwave:

  1. can set the fluid import scale to 0.01 in X,Y and Z or do it later in Layout
  2. The object sequence surface loader can be used to change the surfaces of the sequenced lwo files in Layout.
  3. If the fluid mesh was imported at full scale of 1,1,1 then set the null scale to 0.01
  4. Parent the fluid mesh to a new null then rotate the null 180 degrees in Heading.
  5. At this point the fluid should be in it's proper position and orientation relative to the original scene that was export to Blender.
  6. Load particle mesh and set it up the same as the fluid mesh
  7. Apply hypervoxels and set the dissolve so they are invisible until their first frame.
  8. Object properties for the particle mesh > deform tab >double click HVParticles and set the weight map to Fluid_Size.
  9. Hypervoxels set gradient texture on particle size using particle weight as the input.  Adjust the gradient to set the particle size.
  10. Make hypervoxels look like the fluid mesh surface.
  11. If the fluid was generated in Blender with gravity in the  Z direction then parent the fluid to a null and set the null rotation to -90 in pitch and 180 in bank.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Physics/Fluid

http://www.blenderguru.com/videos/introduction-to-the-fluid-simulator/

http://www.pkblender.it/FluidSim/fluidsim_index.htm

https://www.youtube.com/watch?v=dgdGV0yaoM4

http://users.xplornet.com/~gimble/blender/tutorials/fluid/control101/fluid_control_101.htm

Good for transfering Bullet dynamics to keyframes - MentalFish Motion Baker

 

Below process may or may not be needed to run the script

Since Python 2.7.2 cannot load shared libraries from a Zip file, you must extract the Python library files found in "bin/python27.zip" to a folder called "bin/Lib". Once extracted, delete or rename "python27.zip", run LightWave, and Python should be able to locate and use all the shared libraries bundled within the "Lib/" folder (including "bin/Lib/pyexpat.pyd").

June 29, 2013

Box Shape for LW11

right click the link above to download

lightwave box shape

Lightwave 11.6 python script for creating a box shape with a non-modal interface. It will show in the Object Properties, Add Custom Object list as "Python Box Shape".  The same settings can be manually copied to the make cube geometry tool to get permanent geometry.

April 21 2014: v 1.1 dialog settings save with the scene

To install copy the box_shape.py file to the python script's custom object plugin folder, something like:

"C:\Program Files\NewTek\LightWave11.5\support\plugins\scripts\Python\Layout\CustomObject\"

March 02, 2014

Info Panel for LW11.6

right click the link above to download

lightwave info panel

Lightwave 11.6 python script for modifying an object. It was originally started as a convenient method to rename a scene object(nulls, lights, cameras) by just typing and pressing enter. It grew to include the other fields to resemble something like the info panel found in trueSpace. The script uses the Master plugin architecture and implements a non-modal interface panel.

Feb 18 2014 - script v1.8:

added pivot rotation and position controls

Dec 4 2013 - script v1.7:

  • ok I think I got the last bug with this version
  • it creates only one instance and is tied to the layout instead of the scene
  • bounding box active checkbox added - stops slowdowns from larger meshes

Dec 3 2013:

script v1.6 fixed couple of bugs, updated required LW version to 11.6

Nov 29 2013:

script v1.5 works with LW11.6 release, crashes in LW11.5.1

Sept 28 2013:

Lightwave 11.6 sept 25 pre-release does not crash when using the mesh creation tools.  Info Panel script v1.4

April 24 2013:

workaround for rename crash

April 20 2013:

added ability to rename mesh objects.

April 9 2013:

added bounding box size control

Usage:

  • Type in any field to set and keyframe the value, simple equations also work
  • The R button is to reset the values to (0,0,0) for position and rotation or (1,1,1) for scale
  • The K button is for setting keyframes when autokey is disabled and the values are changed outside of this panel. The normal Lightwave shortcut(ret) is more convenient in this case.
  • Position, World Position and BB size have units of meters
  • BB Active - calculation of BB is slow, can deactivate it here
  • Pivot Position and Rotation R to reset to (0,0,0) S to set to the displayed value.  Note that this is not the same as Recording the Pivot.
  • Change all mesh instances when renaming controls whether the selected object or all the common mesh objects in the scene will be renamed. When checked it is the equivalent of using the file menu "Save Current Object...". Unchecked is the same as "Save Object Copy..." followed by "Replace > With Object" when the checkbox below is unchecked.
  • if checked click NOW to finish renaming requires user input to compete the renaming of a mesh object. It is needed when "Change all mesh instances when renaming" is not checked. When a check appears click it to complete the rename. This is the same as doing "Replace > With Object" using the previous saved object.

To install copy the info_panel.py file to the python script's master plugin folder, something like:

"C:\Program Files\NewTek\LightWave11.5\support\plugins\scripts\Python\Layout\Master\"

March 05, 2013

HDR to Lights

hdr to lights

Lightwave 11.5 python script used to call the medianCut script written by Steve Twist for 3DWorld Issue #134 based on Paul Debevec's Median Cut Algorithm (Debevec 2005). It reads a HDR image and creates a set of lights based on the image. This set of scripts has not been tested in any way and very little error checking is in place. Use at your own risk.

  • Select HDR File - Latitude/Longitude style HDR image
  • Divisions - 2 raised to the divisions gives the number of lights produced. 5 => 32 lights, 6 => 64 lights...
  • Intensity Multiplier - multiply the light values by a constant
  • Dome Radius - size of the dome of lights created

Right click and save as:

Lightwave HDR to Lights script

MedianCut script modified for Lightwave

Sample HDR image

Place the two python scripts in the generics folder for python scripts:

C:\Program Files\NewTek\LightWave11.5\support\plugins\scripts\Python\Layout\Generic\

For some unknown reason the script can only be run once per session. A light and a parent null are created for each light to form the light dome.

March 05, 2013

Fix Exported Collada python script(Layout)

Fix Exported Collada python script(Modeler)

right click the links above to download

collada fixer

The Fix Collada Layout script is a Lightwave 11 Python script that is run on a LW exported Collada file to clean it and add camera and light animation. The script also fixes some issues with material exports. It cleans the file by removing all the extra tags and the translation and rotation tags that don't add any useful information. The default LW scene containing a light and a camera exports as a 36Kb file. It drops to 3Kb after cleaning. The added camera and light animations are compatible with the AECollada plugin for After Effects.

Note that Modeler will not export parenting relationships. So if you setup a heirarchy in Modeler be sure to export the Collada from Layout.

January 19, 2014 (version 1.4):

  • fixed a bug in the previous inverse pivot fix
  • new option to apply the pivot to the mesh vertices
  • version number included in the title bar

December 6, 2013:

  • added transparency tag to the export
  • fixed color export - was rgb changed to rgba

September 8, 2013:

  • Make animation export more compatible with Blender import. Blender can see the translation, rotation and scale animations.
  • inverse pivot fixed

June 23, 2013:

  • new Modeler version
  • fix for materials export
  • multiple surface channels with shared uv do not crash Blender when imported
  • relative image paths

Options:

  • Remove <extra> nodes - the LW collada file is full of extra mostly useless information, this removes it from the file
  • Remove extra rotation nodes - LW adds several rotation nodes with zero rotation values, this removes those nodes
  • Remove extra translation nodes - LW adds several translation nodes with zero values, this removes those nodes
  • Add Camera FOV animation - the camera zoom animation is converted to degrees and added to the collada file
  • Add Light properties animation - light color and spot angle animations are added to the collada file
  • Fix mesh and materials - removes a dummy material from the file, exports phong instead of lambert, prevents crashes in Blender, assigns textures for color, specular, transparency and bump in a standard way(note there is no standard bump so FCOLLADA profile is used)
  • Convert image paths to relative - converts image paths from absolute to relative style for easier sharing of assets
  • Apply mesh pivot to the vertices - adds the rotate pivot to the translation and subtracts the uncorrected inverse pivot from the mesh vertices. The result is that the meshes are converted to use the origin plus vertex translation instead of the pivot. The corrected inverse pivot is the negative of the inverse pivot as written by Lightwave.

Usage:

  1. Export a Collada file from Lightwave
  2. Run this script and select the file
  3. Choose a save as file/location for the new file - can be the same as the source file
  4. Choose your options and press OK

Installation:

  1. Find the python27.zip file in the bin folder of the Lightwave installation - C:\Program Files\NewTek\LightWave11.0\bin
  2. Open the zip file and copy "pyexpat.pyd" out of python27.zip and into the bin folder
  3. Restart Lightwave
  4. Copy the "fix_collada.py" file into the plugins folder or some subfolder like C:\Program Files\NewTek\LightWave11.0\support\plugins\scripts\Python.  Mostly it just needs to be somewhere you can find it.
  5. Use the Utilities/Add Plugins button to add the python file as a button
  6. The plugin/script will appear as "Python Fix Collada" in the Additional dropdown list

Alternate for steps 1 and 2 from a Newtek forums post:

Since Python 2.7.2 cannot load shared libraries from a Zip file, you must extract the Python library files found in "bin/python27.zip" to a folder called "bin/Lib". Once extracted, delete or rename "python27.zip", run LightWave, and Python should be able to locate and use all the shared libraries bundled within the "Lib/" folder (including "bin/Lib/pyexpat.pyd").

April 8, 2012

Make Collada Spotlight Readable python script

right click the link above to download

collada import spotlight add extra

The Make Collada Spotlight Readable Layout script is a Lightwave 11 Python script that is run on a Collada file to add extra LW core based tags to spotlights. Lightwave 11.0.2 will not read spotlights in Collada files generated by other programs. This script adds some Lightwave Core extra tags so that Lightwave will recognize a spotlight and import it.

Usage:

  1. Run the script
  2. Select the Collada file
  3. Define a Save As Collada file for the new file - it can be the same as the input file
  4. press OK
  5. Use the Fix Collada Import script below to finish the import process

Installation:

  1. Find the python27.zip file in the bin folder of the Lightwave installation - C:\Program Files\NewTek\LightWave11.0\bin
  2. Open the zip file and copy "pyexpat.pyd" out of python27.zip and into the bin folder
  3. Restart Lightwave
  4. Copy the "fix_collada_import.py" file into the plugins folder or some subfolder like C:\Program Files\NewTek\LightWave11.0\support\plugins\scripts\Python.  Mostly it just needs to be somewhere you can find it.
  5. Use the Utilities/Add Plugins button to add the python file as a button
  6. The plugin/script will appear as "Python Collada Add Spot Extra" in the Additional dropdown list

Alternate for steps 1 and 2 from a Newtek forums post:

Since Python 2.7.2 cannot load shared libraries from a Zip file, you must extract the Python library files found in "bin/python27.zip" to a folder called "bin/Lib". Once extracted, delete or rename "python27.zip", run LightWave, and Python should be able to locate and use all the shared libraries bundled within the "Lib/" folder (including "bin/Lib/pyexpat.pyd").

August 31, 2012

Fix Collada Import python script

right click the link above to download

collada import fixer

The Collada Import Fixer Layout script is a Lightwave 11 Python script that is run on a Collada file to read camera and light data. This script will read the camera X fov or Y fov and the corresponding fov animation, light color and spotlight angle with animations and ambient light value without animations. Reads material textures from the collada file.

Options:

  • Add Camera FOV animation - the camera zoom animation is imported
  • Add Light properties animation - light color, ambient color and spot angle are imported

Usage:

  1. Run the "Make Spotlight Readable" script above on the collada file if it contains any spotlights
  2. Load the Collada file into Lightwave
  3. Run this script on the same collada file
  4. Choose options and press OK

Installation:

  1. Find the python27.zip file in the bin folder of the Lightwave installation - C:\Program Files\NewTek\LightWave11.0\bin
  2. Open the zip file and copy "pyexpat.pyd" out of python27.zip and into the bin folder
  3. Restart Lightwave
  4. Copy the "fix_collada_import.py" file into the plugins folder or some subfolder like C:\Program Files\NewTek\LightWave11.0\support\plugins\scripts\Python.  Mostly it just needs to be somewhere you can find it.
  5. Use the Utilities/Add Plugins button to add the python file as a button
  6. The plugin/script will appear as "Python Fix Collada Import" in the Additional dropdown list

Alternate for steps 1 and 2 from a Newtek forums post:

Since Python 2.7.2 cannot load shared libraries from a Zip file, you must extract the Python library files found in "bin/python27.zip" to a folder called "bin/Lib". Once extracted, delete or rename "python27.zip", run LightWave, and Python should be able to locate and use all the shared libraries bundled within the "Lib/" folder (including "bin/Lib/pyexpat.pyd").

July 20, 2013:

  • crash bug fix - was crashing when non-mesh items found in the scene before the meshes
  • was not searching the scene for meshes was only using the first mesh in the scene

Jun 16, 2013:

  • was only processing top level scene items - fixed
  • imports and assigns material textures

Sept 2 2012:

Fixed blue component of color animation and the spot light cone angle

August 31, 2012

Some python notes

sys.version - shows python version

message box

  • import lwsdk
  • lwsdk.LWMessageFuncs().info('Hello World', None)
    • alert level medium ->status line
    • alert level high -> dialog box

help(lwsdk.LWMessageFuncs.info)

help(lwsdk)

dir(lwsdk)

double click line in output window to populate command line

July 26, 2013

Sequence Object Surface Loader python script

right click the link above to download

object sequence surface copy

Use this LW 11.5 script to copy the surface of one object onto a sequence of objects. It can be used with the Blender Fluids importer to resurface the sequence of lwo files. The sequence of files must have their number padded with zeros and the number must be just before the ".lwo"

The files are read in one by one and the surface from a source mesh is copied into the sequenced mesh and then the mesh is saved to disc with the new surface applied.

November 8, 2013:

  • Permanent fix for item name crash
  • No need to disable the sequence
  • Progress dialog added
  • Final version until a method can be found to load a surface from disc without causing a crash

November 6, 2013:

  • Found major reason for crash - quick temp fix with error message
  • Works with other object file types(.obj)

Dialog items:

  • Object Replacement -
  • copy surface from - mesh that holds the replacement surface
  • sequenced object - one of the meshes in a sequence of lwo files that will receive the new surface assignment
  • First frame - start frame for the animation range
  • Last frame - end frame for the animation.  If both First and Last frame are left at -1 the script will automatically determine the correct values for the entire range

Notes:

  • filename can have only one '.' just before the extension
  • filename sequence digits must be before the '.'
  • filename extension must have 3 letters
October 26, 2013

Square python script(11.6)

right click the link above to download

Demonstrates mesh creation in modeler

Lightwave 11.5 version

March 12, 2012

Log Spiral python script

right click the link above to download

log spiral log spiral ui

The Log Spiral script is my second experiment with Lightwave 11's Python scripting.  The original code is from an article in 3D Artist magazine Issue #49 by Petr Sorfa for the Hash Animation software package.  The script can be run from the the Utilities tab > Python.  It can also be linstalled like an Lscript or plugin by using the Utilities > Add Plugin in which case it will show up under the Utilities > Additional list under the name "Python LogSpiral".

March 12, 2012

Morph Sequencer script

Lightwave lscript for converting a a series of morphs into a morph sequence. The script creates intermediate morphs that can be added to the final morph at set intervals to simulate a morphing sequence.

Usage:

  1. type number of morphs to use - the first morphs listed will be used
  2. type a prefix name for the new intermediate morphs
  3. choose morph order from the drop down lists
  4. choose whether interpolation is linear or not(no effect on the last morph)
  5. press ok to generate the intermediate morphs and the expressions to drive them
  6. copy the expressions to a temp location
  7. in layout: copy the expressions to the corresponding morphs
  8. final result: intermediate morphs are driven by the final/last morph values to create a sequential morph action
February 26, 2010

Poly Chain to Curve script

Lightwave lscript for converting a 2 point polygon chain to a curve. Right click the link to download the script. Install this script to modeler to use the multiple poly chains to curves script below.

Usage:
Set a background layer to receive the new curve. Select the first point of the polygon chain in the foreground layer then run the script. A curve based on the poly chain will be created in the background layer.

Multiple Poly Chains to Curves script can be used to call the poly chain to curve for multiple selections. Right click to download.

Usage:
The "single poly chain to curve" script above must be installed to modeler before using the "multiple poly chains to curves" script. Set the background layer to receive the new curves and select the first point of each of the 2 point poly chains in the foreground layer. Run the script and it will call the "single poly chain to curve" script for each point selected.

Note: Converting many poly chains can take time.

February 12, 2010

Place Camera FOV animation on a null's transform

Lightwave collada does not export camera field of view(FOV) animation. This lscript transfers the animation to the position and rotation of a null so that whatever program reads the Lightwave collada file can reconstruct the camera animation. Right-click the link above to download the script(save target as/save link as). Place the script in the lscripts folder, "...Program Files\NewTek\LightWave 3D 9\Plugins\lscripts\animate", for easy access.

Usage:

  1. Animate the camera zoom
  2. Create a null and add the lscript, "camFOVtoTransform", via the motion options, motion modifiers.
  3. Double click the "FOV Motion Mod" to open the dialog. Set the scale you intend to use when exporting the collada file and select the camera from the list. When you push OK another null will be created that has it's controllers set to follow the first null. If you don't select a camera the null will not be created and only the scale will update.
  4. The new null's rotation and position will change to follow the camera's zoom.
  5. Add a key at frame zero for this null so that motion baker will see it properly. If you don't add the key then the position keys won't bake properly.
  6. Add a Motion Baker modifier to the new null
    1. check "Use existing..."
    2. check "Overwrite keys"
    3. check positions XYZ and rotations HPB
    4. In Lightwave preferences be sure "Play at Exact Rate" is unchecked.
  7. Play the animation to bake the keys before exporting the collada file

null camera fov bake dialogs

X and Z position will contain the zoom values for x and y stored in the collada file x and z. Multiply by the composition height in After Effects to get the corresponding After Effects zoom value.

lw camera zoom graph lw cam null fov graph

Image shows the camera zoom animation and the corresponding horizontal and vertical zoom animations created for After Effects.

pick whip camera zoom

Inside After Effects:

  1. Import the collada file to using the same scale used for exporting.
  2. Go to the camera settings and change the "Measure Film Size" to Vertically.
  3. Alt click the Zoom stopwatch to activate expressions.
  4. Use the pickwhip to link to the position z value of the camera null. The position information is actually stored on the parent of the camera null(Camera_FOVKF_Yr). Items imported from Lightwave always have a "_Yr" parent so that After Effects can use Lightwave's rotation order.
  5. Multiply the resulting expression by the composition's height.

Pitch and Bank will contain the x fov and y fov in degrees which translates to x and z rotations in the collada file.; The signs are set so that they are positive when imported to After Effects using the AECollada plugin.

October 14, 2009

Place Light animation on a null's transform

Lightwave collada does not export light color or spotlight cone angle animation. This lscript transfers the animation to the position, rotation and scale of a null so that whatever program reads the Lightwave collada file can reconstruct the light animation. Right-click the link above to download the script(save target as/save link as). Place the script in the lscripts folder, "...Program Files\NewTek\LightWave 3D 9\Plugins\lscripts\animate", for easy access.

Usage:

  1. Animate the light color and/or cone angle
  2. Create a null and add the lscript, "lightConeColorToTransform", via the motion options, motion modifiers.
  3. Double click the "Light Attr Motion Mod" to open the dialog. Select the light from the list.  When you push OK another null will be created that has it's controllers set to follow the first null. 
  4. A new null now exists and  it's rotation, position and scale will change to follow the light's cone angle and color.
  5. Add a Motion Baker modifier to the new null
    1. check "Use existing..."
    2. check "Overwrite keys"
    3. check positions XYZ, scale XYZ and rotations HPB
    4. In Lightwave preferences be sure "Play at Exact Rate" is unchecked.
  6. Play the animation to bake the keys before exporting the collada file

lightwave light graph lw light null graph

Image shows the animation graph for a spot light and the null created by this script. The scale null values are too small to see here because After Effects uses a 0 to 100% for scale instead of 0 to 1.0

The rotations HPB will each contain a copy of the light's cone angle. Color will be stored in the scale values and position will also contain the same color data. However, the position for color is only valid if the scene is exported with the default 0.01 scaling. The signs are set so that they are positive when imported to After Effects using the AECollada plugin.

lw light bug

lw light bug fixed

First step after importing to After Effects is to fix the light type. Lightwave exports spot lights as point lights.

light vals from null

Image above shows the resulting expressions from pick whipping values from the light null's scale and xRotation values. The scale of the Lightwave export is not an issue.

light values from parent

This image shows the result of pick whipping cone angle and color to the light null's parent(Light_LITKF_Yr). The collada file was exported at a scale of one and so the color expression had to be divided by 100 as shown.

Use the pickwhip to link the animation to the corresponding light.

October 14, 2009

SubD UV Preparation script for Lightwave

Lscript that converts subd uv's into an clean format for eps export. Right click on the link to download the script.

subpatch frozen subd prep
default subd eps export, frozen mesh eps export, "subd preped" eps export

Usage:

  • Save the object file to insure it's safety.
  • Set the uv subpatch interpolation to "Subpatch".
  • Run the script.
  • Export the UV by using the EPS export.

The script copies the geometry to a new layer, assigns a unique surface to each face, freezes the mesh and combines the polygons based on their surface.

March 27, 2010

Doom3(idtech4) Plugins for Lightwave 11

A set of 5 python scripts for importing and exporting Doom3 skeletal mesh and animation files. Right click on the links below to download the python scripts.

February 22, 2014:

  • reversed LW11.5 changes in mesh import for compatibility with LW11.6
  • mesh and animation export has the option to use bone creation order or heirarchy order
  • script version number shows in the ui title
  • fixed rotation flipping problem in the animation exporter

August 8, 2013:

fixed mesh import for python changes in LW11.5

right click the links below to download

md5meshimport.py - load md5mesh files into modeler

md5skeletonimport.py - select the mesh in layout and use this script to load the corresponding skeleton. Any other meshes can be set to use bones from the main mesh. Keyframes for the basic skeleton pose are set at frame -10.

md5animationimport.py - select the mesh portion of the skeletal mesh in layout and run this script to load an md5anim skeletal mesh animation.

  • Match file frame rate - set Lightwave frame rate to match that of the md5anim file
  • Start Frame - imported animation will start on this frame

md5skeletalmeshexport.py - export a skeletal mesh in md5mesh file format

  • Base Pose Frame - frame that contains the skeletal mesh bind pose
  • Export in bone creation order - default of unchecked seems to work for all cases. when checked  bones are exported in the order they were created, otherwise they are exported in heirarchy order

md5animationexport.py - select the mesh portion of the skeletal mesh and run this script to export an md5anim animation file.

  • Base Pose Frame - frame with the bind pose
  • Start Frame - animation start frame
  • End Frame - last frame of the animation
  • Export in bone creation order - default of unchecked seems to work for all cases. when checked bones are exported in the order they were created, otherwise they are exported in heirarchy order

The advantages over the original plugins are

  • fixes the mesh mirror problem
  • runs on 32 or 64 bit versions of Lightwave
  • skelegons are ignored
  • weight map names do not have to match the bone names
  • surfaces do not need to be assigned manually
  • full md5mesh shader names are imported
  • no limits on the number of bones.
  • helper null is deleted after export is completed
  • gives a warning if the mesh isn't made of triangles

Meshes still import with Z up, so a workflow for imported and Lightwave original Doom3 assets needs to be developed.

The base pose for animation export should proabably be a copy of the first frame of animation. The difference between the base pose and any animation frame is what gets recorded into the file.

Click here to go to the old Doom3/Quake import export plugins page for 32bit Lightwave 8 and 9 plugins. The original plugin usage notes can be helpful with the python versions here.

April 22, 2012

Collada Weight map loader scripts and program

Lightwave lscript and executable for loading weightmaps from Collada files so that bones will bind to the proper vertices. daeSkin2weight.exe reads a collada file and creates a text file in the same location. the text file contains the weight map information. daeSkinLoad.ls is an lscript to read the text file generated by the daeSkin2weight program and assigns the vertices to their weight maps. boneweightmap.ls is a layout script that sets the selected bones to use a weightmap with the same name as the bone.

Usage:

  1. if the collada file does not load properly into lightwave, load it into blender3d(2.5 alpha) and export a new collada file
  2. run the daeSkin2weight program and open the collada file. a text file will be created with the same name as the dae file but with a txt extension
  3. load the collada file into layout to get both mesh and bones
  4. load the resulting lwo file into modeler and run the daeSkinLoad script to load the weightmaps from the text file
  5. load the updated object back into layout
  6. run the boneweightmap script to assign the weightmaps to the corresponding bones

Note:

The executable won't work for files that have spaces in their path. so it won't work in paths like "C:\Program Files" or "C:\Documents and Settings\All Users"

source code - uses visual studio 2008 and the colladadom2.2 sdk

May 04, 2010
June 6, 2013