Feedback

Please leave feedback and comments. I am always interested to hear how people get on using these LScripts!

Monday, 18 February 2013

LScript - Generic_Blueprint

LScript (Layout) to quickly setup a scene to produce a blueprint look.

Please be aware this script overrides objects surfaces settings.

Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)

LScript - Generic_BoxRig (v1.1)

LScript (Layout) to rig a box so that it can pivot upon its edges and corners. This script sets up the hiearchy and expressions required ready for animation upon any selected objects.

Use "Parent" null to position and rotate box and "Control" null to animate using the rig.

Problem
  • Under LightWave 11 Item Shape is broken due to changes in comring
Changes
  • Fixed parenting (v1.1)
  • Objects require pivot to be resting on ground and centre of object
  • Does not work on clones due to expressions
  • Fixed getting correct boundingbox extents from layers
  • Fixed Parent in Place issues
  • Fixed offset when pivot not at bottom of object
Compatible with Newtek LightWave 9.6 up and prior to 11.0.

Download (.lsc)
Download - sourcecode (.ls)

LScript - Generic_StackIt (v1.2)

LScript (Layout) to stack an object upon another while parenting them. Select item to stack and then item to stack upon.

Changes
  • Now stacks multiple objects (v1.2)
  • Fixed pivot offset (v1.1)
  • Fixed getting correct boundingbox extents from layers
  • Fixed issue requiring pivot to always be at objects lowest extent
Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)

Sunday, 17 February 2013

Library - Random

The Library is where code samples, building blocks of scripts will be shared.
_randomseed = 0; // n Seed

randomseed: seed
{
    _randomseed = seed;
}

random // n
{
    n = (_randomseed * 214013 + 2531011) % 2^^24;
    _randomseed = n;
    n /= 2^^24; // 0..1
    return(n);
}

gaussianrandom // n
{
    n1 = random();
    n2 = random();
    if(n1 == 0.0){n1 = 0.01;}
    return(sqrt(-2.0 * log(n1)) * cos(2.0 * 3.1415926535 * n2));
}

Library - Matrix

The Library is where code samples, building blocks of scripts will be shared.
matrixworld: item,time // m
{
    // call before matrixtransformworld()
    vnRight = item.getRight(time); // Right
    m[1][1] = vnRight.x;
    m[1][2] = vnRight.y;
    m[1][3] = vnRight.z;
    m[1][4] = 0.0;
    vnUp = item.getUp(time); // Up
    m[2][1] = vnUp.x;
    m[2][2] = vnUp.y;
    m[2][3] = vnUp.z;
    m[2][4] = 0.0;
    vnForward = item.getForward(time); // Forward
    m[3][1] = vnForward.x;
    m[3][2] = vnForward.y;
    m[3][3] = vnForward.z;
    m[3][4] = 0.0;
    vWorldPosition = item.getWorldPosition(time); // World Position
    m[4][1] = vWorldPosition.x;
    m[4][2] = vWorldPosition.y;
    m[4][3] = vWorldPosition.z;
    m[4][4] = 1.0;
    return(m);
}

matrixinverseworld: item,time // m
{
    // call before matrixtransformlocal()
    vnRight = item.getRight(time); // Right
    m[1][1] = vnRight.x;
    m[1][2] = vnRight.y;
    m[1][3] = vnRight.z;
    m[1][4] = 0.0;
    vnUp = item.getUp(time); // Up
    m[2][1] = vnUp.x;
    m[2][2] = vnUp.y;
    m[2][3] = vnUp.z;
    m[2][4] = 0.0;
    vnForward = item.getForward(time); // Forward
    m[3][1] = vnForward.x;
    m[3][2] = vnForward.y;
    m[3][3] = vnForward.z;
    m[3][4] = 0.0;
    vWorldPosition = item.getWorldPosition(time); // World Position
    m[4][1] = -vWorldPosition.x;
    m[4][2] = -vWorldPosition.y;
    m[4][3] = -vWorldPosition.z;
    m[4][4] = 1.0;
    return(m);
}

matrixtransformworld: v,m // v
{
    // call after matrixworld()
    _v = <0.0,0.0,0.0>;
    _v.x = m[1][1] * v.x + m[2][1] * v.y + m[3][1] * v.z + m[4][1];
    _v.y = m[1][2] * v.x + m[2][2] * v.y + m[3][2] * v.z + m[4][2];
    _v.z = m[1][3] * v.x + m[2][3] * v.y + m[3][3] * v.z + m[4][3];
    return(_v);
}

matrixtransformlocal: v,m // v
{
    // call after matrixinverseworld()
    _v = <0.0,0.0,0.0>;    
    v.x += m[4][1];
    v.y += m[4][2];
    v.z += m[4][3];
    _v.x = m[1][1] * v.x + m[2][1] * v.y + m[3][1] * v.z;
    _v.y = m[1][2] * v.x + m[2][2] * v.y + m[3][2] * v.z;
    _v.z = m[1][3] * v.x + m[2][3] * v.y + m[3][3] * v.z;
    return(_v);
}

Library - Interpolation

The Library is where code samples, building blocks of scripts will be shared.
linear1D: n1,n2,i // i = interpolation point (0-1)
{
    return(n1 * (1 - i) + n2 * i);     
}

cosine1D: n1,n2,i // i = interpolation point (0-1)
{
    i2 = (1 - cos(i * 3.1415926535)) * 0.5;
    return(n1 * (1 - i2) + n2 * i2);     
}

bicubic1D: n1,n2,n3,n4,i // i = interpolation point (0-1)
{
    i2 = i * i;
    n_01 = n4 - n3 - n1 + n2;
    n_02 = n1 - n2 - n_01;
    n_03 = n3 - n1;
    n_04 = n2;
    return(n_01 * i * i2 + n_02 * i2 + n_03 * i + n_04);
}

Friday, 15 February 2013

Crackle - Roughnecks: Starship Troopers Chronicles

Over at Crackle they are currently showing Roughnecks : Starship Chronicles. It was one of the first LightWave television series and is based on Starship Troopers.

For a bit of nostalgia visit http://www.crackle.com/c/roughnecksstarshiptrooperschroniclesfullepisodes 

Stephen

Monday, 11 February 2013

LightWave Plugin Database

Ken over at the LightWave Plugin Database has been hard at work improving his website that is a trove of resources for users and artists. Check out his site - http://www.lwplugindb.com

Stephen

Monday, 4 February 2013

LScript - Motion_VolumeTrick

LScript (Layout) for motion values based on position during motion blur used to fake volume effects.

Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)

LScript - Channel_VolumeTrick

LScript (Layout) to shift channel values based on motion position during motion blur used to fake volume effects.

Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)

LScript - Channel_GlobalAmbientIntensity

LScript (Layout) to allow access via channel to the global ambient intensity.

Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)

LScript - Modeler_Poke

LScript (Modeler) that replicates poke in Maya to split polygons with an averaged center.

Changes

Compatible with Newtek LightWave 9.6 and above.

Download (.lsc)
Download - sourcecode (.ls)