Skip to content

Commit a66da9a

Browse files
committed
Added Project Templates.
Added the same boilerplate templates as we are used to from LSED, but in Sublime format.
1 parent bcf7be8 commit a66da9a

10 files changed

+739
-0
lines changed
+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<snippet>
2+
<content><![CDATA[
3+
//-----------------------------------------
4+
// LScript Channel Filter template
5+
//
6+
7+
@version 2.2
8+
@warnings
9+
@script channel
10+
11+
// global values go here
12+
13+
create
14+
{
15+
// one-time initialization takes place here
16+
}
17+
18+
destroy
19+
{
20+
// take care of final clean-up activities here
21+
}
22+
23+
process: ca, frame, time
24+
{
25+
// 'ca' is the Channel Filter Object Agent
26+
27+
// it exports one read-only data member:
28+
// name the name of the channel as
29+
// it is displayed to the user
30+
31+
// it provides two methods:
32+
// get returns the value of the
33+
// channel (as a floating-point
34+
// number) for an indicated time
35+
// index
36+
// set sets the channel's value to
37+
// the provided floating-point
38+
// value for the current time
39+
// index (indicated by the 'time'
40+
// argument to process()).
41+
42+
}
43+
44+
load: what,io
45+
{
46+
if(what == SCENEMODE) // processing an ASCII scene file
47+
{
48+
}
49+
}
50+
51+
save: what,io
52+
{
53+
if(what == SCENEMODE)
54+
{
55+
}
56+
}
57+
58+
options
59+
{
60+
reqbegin("<Requester Title>");
61+
62+
c0 = ctlinteger("Integer Control",1);
63+
c1 = ctlnumber("Number Control",1.0);
64+
c2 = ctlstring("String Control","my string");
65+
c3 = ctlcheckbox("Checkbox Control",true);
66+
c4 = ctlpopup("Popup control",1,@"Item 1","Item 2","Item 3"@);
67+
c5 = ctlchoice("Choice Control",1,@"X","Y","Z"@);
68+
69+
return if !reqpost();
70+
71+
// get requester control values here
72+
73+
reqend();
74+
}
75+
76+
]]></content>
77+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
78+
<tabTrigger></tabTrigger>
79+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
80+
<scope>source.lscript</scope>
81+
<!-- description, syns i auto completion listan in view -->
82+
<description>Template: Channel Filter</description>
83+
</snippet>
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<snippet>
2+
<content><![CDATA[
3+
//-----------------------------------------
4+
// LScript Custom Object template
5+
//
6+
7+
@version 2.3
8+
@warnings
9+
@script custom
10+
11+
// global values go here
12+
13+
create
14+
{
15+
// one-time initialization takes place here
16+
}
17+
18+
destroy
19+
{
20+
// take care of final clean-up activities here
21+
}
22+
23+
newtime: frame, time
24+
{
25+
// called each time the current time index changes in the scene
26+
27+
currentFrame = frame;
28+
currentTime = time;
29+
}
30+
31+
init
32+
{
33+
// called at the beginning of each render pass
34+
}
35+
36+
cleanup
37+
{
38+
// called at the end of each render pass
39+
}
40+
41+
flags
42+
{
43+
// currently only one flag value is defined, SCHEMA.
44+
// this flag tells Layout that you support drawing
45+
// in Layout's schematic view. if the script does
46+
// not support such drawing, then it is best not to
47+
// define this function.
48+
49+
return(SCHEMA);
50+
}
51+
52+
process: ca
53+
{
54+
// called each time the object needs to be drawn
55+
}
56+
57+
load: what,io
58+
{
59+
if(what == SCENEMODE) // processing an ASCII scene file
60+
{
61+
}
62+
}
63+
64+
save: what,io
65+
{
66+
if(what == SCENEMODE)
67+
{
68+
}
69+
}
70+
71+
options
72+
{
73+
reqbegin("<Requester Title>");
74+
75+
c0 = ctlinteger("Integer Control",1);
76+
c1 = ctlnumber("Number Control",1.0);
77+
c2 = ctlstring("String Control","my string");
78+
c3 = ctlcheckbox("Checkbox Control",true);
79+
c4 = ctlpopup("Popup control",1,@"Item 1","Item 2","Item 3"@);
80+
c5 = ctlchoice("Choice Control",1,@"X","Y","Z"@);
81+
82+
return if !reqpost();
83+
84+
// get requester control values here
85+
86+
reqend();
87+
}
88+
]]></content>
89+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
90+
<tabTrigger></tabTrigger>
91+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
92+
<scope>source.lscript</scope>
93+
<!-- description, syns i auto completion listan in view -->
94+
<description>Template: Custom Object</description>
95+
</snippet>
+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<snippet>
2+
<content><![CDATA[
3+
//-----------------------------------------
4+
// LScript Displacement Map template
5+
//
6+
7+
@version 2.2
8+
@warnings
9+
@script displace
10+
11+
// global values go here
12+
13+
currentTime,currentFrame;
14+
myObject;
15+
16+
create
17+
{
18+
// one-time initialization takes place here
19+
20+
myObject = nil;
21+
}
22+
23+
destroy
24+
{
25+
// take care of final clean-up activities here
26+
}
27+
28+
newtime: id, frame, time
29+
{
30+
// called each time the current time index changes in the scene
31+
32+
myObject = id if !myObject;
33+
currentTime = time;
34+
currentFrame = frame;
35+
}
36+
37+
flags
38+
{
39+
// let's Layout know how you wish to process points:
40+
// WORLD LOCAL
41+
42+
return(WORLD); // we want vector values in World coordinates
43+
}
44+
45+
process: da
46+
{
47+
// called for each point in 'myObject'
48+
}
49+
50+
load: what,io
51+
{
52+
if(what == SCENEMODE) // processing an ASCII scene file
53+
{
54+
}
55+
}
56+
57+
save: what,io
58+
{
59+
if(what == SCENEMODE)
60+
{
61+
}
62+
}
63+
64+
options
65+
{
66+
reqbegin("<Requester Title>");
67+
68+
c0 = ctlinteger("Integer Control",1);
69+
c1 = ctlnumber("Number Control",1.0);
70+
c2 = ctlstring("String Control","my string");
71+
c3 = ctlcheckbox("Checkbox Control",true);
72+
c4 = ctlpopup("Popup control",1,@"Item 1","Item 2","Item 3"@);
73+
c5 = ctlchoice("Choice Control",1,@"X","Y","Z"@);
74+
75+
return if !reqpost();
76+
77+
// get requester control values here
78+
79+
reqend();
80+
}
81+
]]></content>
82+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
83+
<tabTrigger></tabTrigger>
84+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
85+
<scope>source.lscript</scope>
86+
<!-- description, syns i auto completion listan in view -->
87+
<description>Template: Displacement Map</description>
88+
</snippet>

Templates/Generic.sublime-snippet

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<snippet>
2+
<content><![CDATA[
3+
//-----------------------------------------
4+
// LScript Generic template
5+
//
6+
7+
@version 2.2
8+
@warnings
9+
@script generic
10+
11+
// global values go here
12+
13+
generic
14+
{
15+
// perform all processing here
16+
17+
reqbegin("<Requester Title>");
18+
19+
c0 = ctlinteger("Integer Control",1);
20+
c1 = ctlnumber("Number Control",1.0);
21+
c2 = ctlstring("String Control","my string");
22+
c3 = ctlcheckbox("Checkbox Control",true);
23+
c4 = ctlpopup("Popup control",1,@"Item 1","Item 2","Item 3"@);
24+
c5 = ctlchoice("Choice Control",1,@"X","Y","Z"@);
25+
26+
return if !reqpost();
27+
28+
// get requester control values here
29+
30+
reqend();
31+
}
32+
]]></content>
33+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
34+
<tabTrigger></tabTrigger>
35+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
36+
<scope>source.lscript</scope>
37+
<!-- description, syns i auto completion listan in view -->
38+
<description>Template: Generic</description>
39+
</snippet>
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<snippet>
2+
<content><![CDATA[
3+
//-----------------------------------------
4+
// LScript Image Filter template
5+
//
6+
7+
@version 2.5
8+
@warnings
9+
@script image
10+
11+
// global values go here
12+
13+
create
14+
{
15+
// one-time initialization takes place here
16+
}
17+
18+
destroy
19+
{
20+
// take care of final clean-up activities here
21+
}
22+
23+
process: ifo
24+
{
25+
// called when a frame is completely rendered
26+
27+
moninit(ifo.height) unless runningUnder() == SCREAMERNET;
28+
29+
for(i = 1;i <= ifo.height;++i)
30+
{
31+
...
32+
for(j = 1;j <= ifo.width;++j)
33+
{
34+
...
35+
36+
if(runningUnder() != SCREAMERNET)
37+
{
38+
return if monstep();
39+
}
40+
}
41+
}
42+
43+
monend() unless runningUnder() == SCREAMERNET;
44+
}
45+
46+
load: what,io
47+
{
48+
if(what == SCENEMODE) // processing an ASCII scene file
49+
{
50+
}
51+
}
52+
53+
save: what,io
54+
{
55+
if(what == SCENEMODE)
56+
{
57+
}
58+
}
59+
60+
options
61+
{
62+
reqbegin("<Requester Title>");
63+
64+
c0 = ctlinteger("Integer Control",1);
65+
c1 = ctlnumber("Number Control",1.0);
66+
c2 = ctlstring("String Control","my string");
67+
c3 = ctlcheckbox("Checkbox Control",true);
68+
c4 = ctlpopup("Popup control",1,@"Item 1","Item 2","Item 3"@);
69+
c5 = ctlchoice("Choice Control",1,@"X","Y","Z"@);
70+
71+
return if !reqpost();
72+
73+
// get requester control values here
74+
75+
reqend();
76+
}
77+
]]></content>
78+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
79+
<tabTrigger></tabTrigger>
80+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
81+
<scope>source.lscript</scope>
82+
<!-- description, syns i auto completion listan in view -->
83+
<description>Template: Image Filter</description>
84+
</snippet>

0 commit comments

Comments
 (0)