Due to changes in my web hosting my blog is currently undergoing updates. If files go offline you can still access all LScripts on my Google Drive until a permanent solution is in place.
https://drive.google.com/open?id=1cR_q2GVUAJHumic1-A3eXV16acQnVTWs
Feedback
Sunday, 29 July 2018
Thursday, 12 April 2018
LScript - Modeler_Compound
LScript (Modeler) to offset points based on total offset by compounding across selected points.
Compatible with Newtek LightWave 9.6 and above.
// LScript Modeler - www.StephenCulley.co.uk
//
// web address: http://www.stephenculley.co.uk
// email address: email@stephenculley.co.uk
/*
LScript Modeler - Compound
Modeler_Compound.ls
*/
@version 2.2
@warnings
@script modeler
@name *Compound
// Title
sTitle = "*Compound";
// Version
sVersion = "v1.0";
ctrl_c0, ctrl_c1, ctrl_c2, ctrl_c3;
main
{
// Store
bAxisX = recall("bAxisX",true);
bAxisY = recall("bAxisY",false);
bAxisZ = recall("bAxisZ",false);
fDistance = recall("fDistance",0.0);
reqbegin(sTitle + " " + sVersion);
// Reset
ctrl_res0 = ctlbutton("Reset",50,"button_reset"); // Button Reset
ctlsep();
// Control
ctrl_c0 = ctlcheckbox("X", bAxisX);
ctrl_c1 = ctlcheckbox("Y", bAxisY);
ctrl_c2 = ctlcheckbox("Z", bAxisZ);
ctrl_c3 = ctldistance("Distance",fDistance);
// Developer
ctlsep();
ctrl_dev0 = ctltext("","developer: Stephen Culley","http://www.stephenculley.co.uk");
return if !reqpost();
bAxisX = getvalue(ctrl_c0); // X
bAxisY = getvalue(ctrl_c1); // Y
bAxisZ = getvalue(ctrl_c2); // Z
fDistance = getvalue(ctrl_c3); // Distance
// Store
store("bAxisX",bAxisX); // X
store("bAxisY",bAxisY); // Y
store("bAxisZ",bAxisZ); // Z
store("fDistance",fDistance); // Distance
// Selection - Point (DIRECT)
selmode(DIRECT);
iPointCount = pointcount();
if(iPointCount <= 1) error("None or not enough points selected.");
undogroupbegin(); // Undo
moninit(iPointCount,"Processing..."); // Progress Monitor
vStep = <fDistance / (iPointCount - 1),fDistance / (iPointCount - 1),fDistance / (iPointCount - 1)>;
vCompound = <0.0,0.0,0.0>; // Compound
editbegin();
for(iCurrentPoint = 1; iCurrentPoint <= iPointCount; iCurrentPoint++)
{
vPoint = pointinfo(points[iCurrentPoint]);
if(bAxisX) vPoint.x = vPoint.x + vCompound.x; // X
if(bAxisY) vPoint.y = vPoint.y + vCompound.y; // Y
if(bAxisZ) vPoint.z = vPoint.z + vCompound.z; // Z
pointmove(points[iCurrentPoint],vPoint); // Move point
// Compound
vCompound += vStep;
monstep(); // Progress Monitor
}
editend();
undogroupend(); // Undo
}
button_reset
{
setvalue(ctrl_c0,true); // X
setvalue(ctrl_c1,false); // Y
setvalue(ctrl_c2,false); // Z
setvalue(ctrl_c3,0.0); // Distance
}
https://drive.google.com/open?id=1cR_q2GVUAJHumic1-A3eXV16acQnVTWs
Saturday, 3 March 2018
LScript - Modeler_Converge
LScript (Modeler) to align points based on last or previous selected or average points.
Compatible with Newtek LightWave 9.6 and above.
// LScript Modeler - www.StephenCulley.co.uk
//
// web address: http://www.stephenculley.co.uk
// email address: email@stephenculley.co.uk
/*
LScript Modeler - Converge
Modeler_Converge.ls
*/
@version 2.2
@warnings
@script modeler
@name *Converge
// Title
sTitle = "*Converge";
// Version
sVersion = "v1.0";
ctrl_c0, ctrl_c1, ctrl_c2, ctrl_c3;
main
{
// Store
bAxisX = recall("bAxisX",true);
bAxisY = recall("bAxisY",false);
bAxisZ = recall("bAxisZ",false);
iSelected = recall("iSelected",1);
reqbegin(sTitle + " " + sVersion);
// Reset
ctrl_res0 = ctlbutton("Reset",50,"button_reset"); // Button Reset
ctlsep();
// Control
ctrl_c0 = ctlcheckbox("X", bAxisX);
ctrl_c1 = ctlcheckbox("Y", bAxisY);
ctrl_c2 = ctlcheckbox("Z", bAxisZ);
ctrl_c3 = ctlchoice("Selected",iSelected,@"First","Last","Average"@);
// Developer
ctlsep();
ctrl_dev0 = ctltext("","developer: Stephen Culley","http://www.stephenculley.co.uk");
return if !reqpost();
bAxisX = getvalue(ctrl_c0); // X
bAxisY = getvalue(ctrl_c1); // Y
bAxisZ = getvalue(ctrl_c2); // Z
iSelected = getvalue(ctrl_c3); // Selected
// Store
store("bAxisX",bAxisX); // X
store("bAxisY",bAxisY); // Y
store("bAxisZ",bAxisZ); // Z
store("iSelected",iSelected);
// Selection - Point (DIRECT)
selmode(DIRECT);
iPointCount = pointcount();
if(iPointCount <= 1) error("None or not enough points selected.");
undogroupbegin(); // Undo
moninit(iPointCount,"Processing..."); // Progress Monitor
editbegin();
if(iSelected == 1) vConvergePoint = pointinfo(points[1]); // First
if(iSelected == 2) vConvergePoint = pointinfo(points[iPointCount]); // Last
if(iSelected == 3) // Average
{
vConvergePoint = <0 .0="">;
for(iCurrentPoint = 1; iCurrentPoint <= iPointCount; iCurrentPoint++)
{
vConvergePoint += pointinfo(points[iCurrentPoint]);
}
// Resize by points
vConvergePoint *= 1 / (iPointCount - 1);
}
for(iCurrentPoint = 1; iCurrentPoint <= iPointCount; iCurrentPoint++)
{
vPoint = pointinfo(points[iCurrentPoint]);
if(bAxisX) vPoint.x = vConvergePoint.x; // X
if(bAxisY) vPoint.y = vConvergePoint.y; // Y
if(bAxisZ) vPoint.z = vConvergePoint.z; // Z
pointmove(points[iCurrentPoint],vPoint); // Move point
monstep(); // Progress Monitor
}
editend();
undogroupend(); // Undo
}
button_reset
{
setvalue(ctrl_c0,true); // X
setvalue(ctrl_c1,false); // Y
setvalue(ctrl_c2,false); // Z
setvalue(ctrl_c3,1); // Selected
}0>
https://drive.google.com/open?id=1cR_q2GVUAJHumic1-A3eXV16acQnVTWs
Thursday, 25 January 2018
Arduino Christmas Lights UPDATE - WS2811 / Arduino Mega2560
I have been working non stop on the code ready to be released, I have been able to optimise and improve efficiency and allowed me to get it ready for further features.
"Public Release 'falalalalala' (Mega 2560) v1.0b" is in its final testing and will be released shortly with a new demo video on youtube to come shortly.
Current features include in first release (Public Release 'falalalalala' (Mega 2560) v1.0b) :-
"Public Release 'falalalalala' (Mega 2560) v1.0b" is in its final testing and will be released shortly with a new demo video on youtube to come shortly.
Current features include in first release (Public Release 'falalalalala' (Mega 2560) v1.0b) :-
- Customised effects.
- Colour selections.
- Consistent and time accurate effects for smoother playback at 20 frames per second.
- Auto-save feature to update automatically when a user changes settings.
- 128x32 OLED display.
- 3 button interface.
- Stack based effects tree (this is to get ready for further expansion)
Features coming :-
- SD card access.
- Scripting language.
- Playback of text written effects.
- Audio interaction and playback.
- Custom effects created on board via stack.
I appreciate your time and patience as I wish to give everyone a magical experience and many happy Christmas trees and smiling faces.
Stephen
Stephen
Tuesday, 30 May 2017
Arduino Christmas Lights Preview - WS2811 / Arduino Mega2560
Preview of some of the effects I have programmed to run in real time on an Arduino Mega2560 that is displayed every Christmas outside my house. More effects are added during the years with more and more lights. The intention is to create a Christmas feeling where by it looks magical and not cheep and tacky.
The full setup runs 4 channels of 200 leds and are processed with in an effects stack, individually and grouped in to sets and can apply different effects per frame.
A cut down version (Source Code) running one channel of of lights on an Arduino Nano will be available at a later date.
Subscribe to:
Posts (Atom)