RUIC 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +3 -3
- data/HISTORY +63 -52
- data/README.md +220 -220
- data/bin/ruic +12 -11
- data/gui/TODO +2 -2
- data/gui/appattributesmodel.rb +51 -51
- data/gui/appelementsmodel.rb +126 -126
- data/gui/launch.rb +19 -19
- data/gui/makefile +14 -14
- data/gui/resources/style/dark.qss +459 -459
- data/gui/window.rb +90 -90
- data/gui/window.ui +753 -753
- data/lib/ruic.rb +182 -175
- data/lib/ruic/application.rb +2 -2
- data/lib/ruic/assets.rb +436 -421
- data/lib/ruic/attributes.rb +170 -165
- data/lib/ruic/behaviors.rb +1 -1
- data/lib/ruic/interfaces.rb +23 -1
- data/lib/ruic/presentation.rb +100 -34
- data/lib/ruic/ripl-after-result.rb +24 -24
- data/lib/ruic/statemachine.rb +1 -1
- data/lib/ruic/version.rb +3 -3
- data/ruic.gemspec +25 -25
- data/test/MetaData-simple.xml +28 -28
- data/test/MetaData.xml +435 -435
- data/test/customclasses.ruic +31 -21
- data/test/filtering.ruic +43 -43
- data/test/futureassets.ruic +8 -8
- data/test/nonmaster.ruic +0 -0
- data/test/paths.ruic +18 -18
- data/test/projects/CustomClasses/CustomClasses.uia +7 -7
- data/test/projects/CustomClasses/CustomClasses.uip +7 -1
- data/test/projects/CustomClasses/FutureAsset.uip +17 -17
- data/test/projects/CustomClasses/scripts/DataDrivenTime.lua +58 -0
- data/test/projects/CustomClasses/scripts/TimeDrivenAttribute.lua +49 -0
- data/test/projects/Paths/Paths.uia +4 -4
- data/test/projects/Paths/Paths.uip +98 -98
- data/test/projects/SimpleScene/SimpleScene.uia +4 -4
- data/test/projects/SimpleScene/SimpleScene.uip +35 -35
- data/test/properties.ruic +82 -82
- data/test/referencematerials.ruic +52 -52
- data/test/usage.ruic +20 -20
- metadata +32 -4
data/test/customclasses.ruic
CHANGED
@@ -1,21 +1,31 @@
|
|
1
|
-
#!/usr/bin/env ruic
|
2
|
-
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
-
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
4
|
-
show app.errors if app.errors?
|
5
|
-
|
6
|
-
main = app.main_presentation
|
7
|
-
|
8
|
-
effect = main/"Scene.Layer.Brush Strokes"
|
9
|
-
assert effect
|
10
|
-
assert effect.name == "Brush Strokes"
|
11
|
-
assert effect.properties.length == 11 # 6 shared asset, 1 effect, 4 from effect
|
12
|
-
assert effect['brushAngle'].value == 45
|
13
|
-
assert effect['starttime',1] == 0
|
14
|
-
assert effect['NoiseSamp'].value == 'maps/effects/brushnoise.dds'
|
15
|
-
|
16
|
-
material = main/"Scene.Layer.Rectangle.Material"
|
17
|
-
assert material.properties.length == 12 # 6 shared asset, 2 MaterialBase, 4 from material
|
18
|
-
assert material.name == "Material"
|
19
|
-
assert material['uEnvironmentMappingEnabled']
|
20
|
-
assert !material['ATTRIBUTE-DOES-NOT-EXIST']
|
21
|
-
assert material['uEnvironmentTexture',1] == 'maps/materials/spherical_checker.png'
|
1
|
+
#!/usr/bin/env ruic
|
2
|
+
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
+
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
4
|
+
show app.errors if app.errors?
|
5
|
+
|
6
|
+
main = app.main_presentation
|
7
|
+
|
8
|
+
effect = main/"Scene.Layer.Brush Strokes"
|
9
|
+
assert effect
|
10
|
+
assert effect.name == "Brush Strokes"
|
11
|
+
assert effect.properties.length == 11 # 6 shared asset, 1 effect, 4 from effect
|
12
|
+
assert effect['brushAngle'].value == 45
|
13
|
+
assert effect['starttime',1] == 0
|
14
|
+
assert effect['NoiseSamp'].value == 'maps/effects/brushnoise.dds'
|
15
|
+
|
16
|
+
material = main/"Scene.Layer.Rectangle.Material"
|
17
|
+
assert material.properties.length == 12 # 6 shared asset, 2 MaterialBase, 4 from material
|
18
|
+
assert material.name == "Material"
|
19
|
+
assert material['uEnvironmentMappingEnabled']
|
20
|
+
assert !material['ATTRIBUTE-DOES-NOT-EXIST']
|
21
|
+
assert material['uEnvironmentTexture',1] == 'maps/materials/spherical_checker.png'
|
22
|
+
|
23
|
+
b1 = main/'Scene.TimeDrivenAttribute'
|
24
|
+
assert b1.name == 'TimeDrivenAttribute'
|
25
|
+
assert b1['sourcepath',0][/[^\/\\]+$/]=='TimeDrivenAttribute.lua'
|
26
|
+
|
27
|
+
b2 = main/'Scene.Layer.DataDrivenTime'
|
28
|
+
assert b2.name == 'DataDrivenTime'
|
29
|
+
assert b2['sourcepath',0][/[^\/\\]+$/]=='DataDrivenTime.lua'
|
30
|
+
|
31
|
+
show "(all assertions successful)"
|
data/test/filtering.ruic
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
metadata 'MetaData.xml'
|
2
|
-
|
3
|
-
uia 'projects/SimpleScene/SimpleScene.uia'
|
4
|
-
show app.errors if app.errors?
|
5
|
-
|
6
|
-
main = app.main_presentation
|
7
|
-
|
8
|
-
assert main.find( _type:'Model' ).length==4
|
9
|
-
assert main.find( _type:'Model', _slide:0 ).length==3
|
10
|
-
assert main.find( _type:'Model', _slide:1 ).length==4
|
11
|
-
assert main.find( _type:'Model', _slide:1, _master:false ).length==1
|
12
|
-
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
13
|
-
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
14
|
-
assert main.find( _type:'Model', position:[nil,60,nil] ).length==4
|
15
|
-
assert main.find( _type:'Model', sourcepath:'#Cube' ).length==1
|
16
|
-
assert main.find( _under:main/"Scene.Layer.Sphere1" ).length==1
|
17
|
-
assert main.find( name:'Material' ).length==4
|
18
|
-
assert main.find( name:/^Sphere/ ).length==2
|
19
|
-
|
20
|
-
# Return values are in Scene graph order
|
21
|
-
assert main.find.first == main/"Scene"
|
22
|
-
assert main.find.last == main/"Scene.Layer.NonMaster.Material"
|
23
|
-
|
24
|
-
# Any asset can be used as the 'root'
|
25
|
-
sphere = main/"Scene.Layer.Sphere1"
|
26
|
-
assert sphere.find.length==1
|
27
|
-
|
28
|
-
# Supplying a block will iterate, including the index
|
29
|
-
expected = main.find _type:'Model'
|
30
|
-
found = 0
|
31
|
-
main.find _type:'Model' do |mod,i|
|
32
|
-
found += 1
|
33
|
-
assert mod == expected[i]
|
34
|
-
end
|
35
|
-
assert found==4
|
36
|
-
|
37
|
-
#
|
38
|
-
['NOPE',false,/NOPE/,-1,[-1],nil].each do |v|
|
39
|
-
assert main.find(__type:v).length==0
|
40
|
-
assert main.find(NOPE:v).length==0
|
41
|
-
assert main.find('NOPE'=>v).length==0
|
42
|
-
end
|
43
|
-
|
1
|
+
metadata 'MetaData.xml'
|
2
|
+
|
3
|
+
uia 'projects/SimpleScene/SimpleScene.uia'
|
4
|
+
show app.errors if app.errors?
|
5
|
+
|
6
|
+
main = app.main_presentation
|
7
|
+
|
8
|
+
assert main.find( _type:'Model' ).length==4
|
9
|
+
assert main.find( _type:'Model', _slide:0 ).length==3
|
10
|
+
assert main.find( _type:'Model', _slide:1 ).length==4
|
11
|
+
assert main.find( _type:'Model', _slide:1, _master:false ).length==1
|
12
|
+
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
13
|
+
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
14
|
+
assert main.find( _type:'Model', position:[nil,60,nil] ).length==4
|
15
|
+
assert main.find( _type:'Model', sourcepath:'#Cube' ).length==1
|
16
|
+
assert main.find( _under:main/"Scene.Layer.Sphere1" ).length==1
|
17
|
+
assert main.find( name:'Material' ).length==4
|
18
|
+
assert main.find( name:/^Sphere/ ).length==2
|
19
|
+
|
20
|
+
# Return values are in Scene graph order
|
21
|
+
assert main.find.first == main/"Scene"
|
22
|
+
assert main.find.last == main/"Scene.Layer.NonMaster.Material"
|
23
|
+
|
24
|
+
# Any asset can be used as the 'root'
|
25
|
+
sphere = main/"Scene.Layer.Sphere1"
|
26
|
+
assert sphere.find.length==1
|
27
|
+
|
28
|
+
# Supplying a block will iterate, including the index
|
29
|
+
expected = main.find _type:'Model'
|
30
|
+
found = 0
|
31
|
+
main.find _type:'Model' do |mod,i|
|
32
|
+
found += 1
|
33
|
+
assert mod == expected[i]
|
34
|
+
end
|
35
|
+
assert found==4
|
36
|
+
|
37
|
+
#
|
38
|
+
['NOPE',false,/NOPE/,-1,[-1],nil].each do |v|
|
39
|
+
assert main.find(__type:v).length==0
|
40
|
+
assert main.find(NOPE:v).length==0
|
41
|
+
assert main.find('NOPE'=>v).length==0
|
42
|
+
end
|
43
|
+
|
44
44
|
show "All #{File.basename(__FILE__)} assertions successful."
|
data/test/futureassets.ruic
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
metadata 'MetaData-simple.xml'
|
2
|
-
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
3
|
-
show app.errors if app.errors?
|
4
|
-
|
5
|
-
future = app["#future"]
|
6
|
-
|
7
|
-
assert xyzzy=future.find(_type:'XYZZY').first
|
8
|
-
assert xyzzy.type == 'XYZZY'
|
1
|
+
metadata 'MetaData-simple.xml'
|
2
|
+
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
3
|
+
show app.errors if app.errors?
|
4
|
+
|
5
|
+
future = app["#future"]
|
6
|
+
|
7
|
+
assert xyzzy=future.find(_type:'XYZZY').first
|
8
|
+
assert xyzzy.type == 'XYZZY'
|
9
9
|
assert xyzzy['eyeball',0]==true # Unknown assets inherit from Asset
|
data/test/nonmaster.ruic
CHANGED
File without changes
|
data/test/paths.ruic
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
#!/usr/bin/env ruic
|
2
|
-
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
-
uia 'projects/Paths/Paths.uia' # required before other commands
|
4
|
-
|
5
|
-
show "Uh oh!", app.errors if app.errors?
|
6
|
-
|
7
|
-
main = app.main
|
8
|
-
paths = main.find _type:'Path'
|
9
|
-
assert paths.length == 5
|
10
|
-
assert paths.first == main/"Scene.Layer.Path1"
|
11
|
-
assert paths.first['width'].value == 17
|
12
|
-
|
13
|
-
assert main.find(_type:'PathAnchorPoint').length == 25
|
14
|
-
|
15
|
-
assert paths.first.anchors
|
16
|
-
assert paths.first.anchors.first == paths.first.find(_type:'PathAnchorPoint').first
|
17
|
-
|
18
|
-
|
1
|
+
#!/usr/bin/env ruic
|
2
|
+
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
+
uia 'projects/Paths/Paths.uia' # required before other commands
|
4
|
+
|
5
|
+
show "Uh oh!", app.errors if app.errors?
|
6
|
+
|
7
|
+
main = app.main
|
8
|
+
paths = main.find _type:'Path'
|
9
|
+
assert paths.length == 5
|
10
|
+
assert paths.first == main/"Scene.Layer.Path1"
|
11
|
+
assert paths.first['width'].value == 17
|
12
|
+
|
13
|
+
assert main.find(_type:'PathAnchorPoint').length == 25
|
14
|
+
|
15
|
+
assert paths.first.anchors
|
16
|
+
assert paths.first.anchors.first == paths.first.find(_type:'PathAnchorPoint').first
|
17
|
+
|
18
|
+
|
19
19
|
show "All assertions successful"
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
-
<assets initial="
|
4
|
-
<presentation id="
|
5
|
-
<presentation id="future" src="FutureAsset.uip"/>
|
6
|
-
</assets>
|
7
|
-
</application>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
+
<assets initial="main">
|
4
|
+
<presentation id="main" src="CustomClasses.uip"/>
|
5
|
+
<presentation id="future" src="FutureAsset.uip"/>
|
6
|
+
</assets>
|
7
|
+
</application>
|
@@ -5,24 +5,30 @@
|
|
5
5
|
<Classes >
|
6
6
|
<Effect id="Brush Strokes" name="Brush Strokes" sourcepath=".\Brush Strokes.effect" />
|
7
7
|
<CustomMaterial id="copper" name="copper" sourcepath=".\copper.material" />
|
8
|
+
<Behavior id="DataDrivenTime" name="DataDrivenTime" sourcepath=".\scripts\DataDrivenTime.lua" />
|
9
|
+
<Behavior id="TimeDrivenAttribute" name="TimeDrivenAttribute" sourcepath=".\scripts\TimeDrivenAttribute.lua" />
|
8
10
|
</Classes>
|
9
11
|
<Graph >
|
10
12
|
<Scene id="Scene" >
|
13
|
+
<Behavior id="TimeDrivenAttribute_001" class="#TimeDrivenAttribute" />
|
11
14
|
<Layer id="Layer" >
|
12
15
|
<Camera id="Camera" />
|
13
16
|
<Light id="Light" />
|
14
|
-
<Effect id="Brush Strokes_001" class="#Brush Strokes" />
|
15
17
|
<Model id="Rectangle" >
|
16
18
|
<CustomMaterial id="Material" class="#copper" />
|
17
19
|
</Model>
|
20
|
+
<Behavior id="DataDrivenTime_001" class="#DataDrivenTime" />
|
21
|
+
<Effect id="Brush Strokes_001" class="#Brush Strokes" />
|
18
22
|
</Layer>
|
19
23
|
</Scene>
|
20
24
|
</Graph>
|
21
25
|
<Logic >
|
22
26
|
<State name="Master Slide" component="#Scene" >
|
27
|
+
<Add ref="#TimeDrivenAttribute_001" />
|
23
28
|
<Add ref="#Layer" />
|
24
29
|
<Add ref="#Camera" />
|
25
30
|
<Add ref="#Light" />
|
31
|
+
<Add ref="#DataDrivenTime_001" />
|
26
32
|
<State id="Scene-Slide1" name="Slide1" >
|
27
33
|
<Add ref="#Brush Strokes_001" name="Brush Strokes" />
|
28
34
|
<Add ref="#Rectangle" name="Rectangle" rotation="-4.94025 -10.2291 -12.3676" scale="5 5 5" sourcepath="#Rectangle" />
|
@@ -1,17 +1,17 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<UIP version="3" >
|
3
|
-
<Project >
|
4
|
-
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
-
<Graph >
|
6
|
-
<Scene id="Scene" >
|
7
|
-
<XYZZY id="future"/>
|
8
|
-
</Scene>
|
9
|
-
</Graph>
|
10
|
-
<Logic >
|
11
|
-
<State name="Master Slide" component="#Scene" >
|
12
|
-
<Add ref="#future" />
|
13
|
-
<State id="Scene-Slide1" name="Slide1" />
|
14
|
-
</State>
|
15
|
-
</Logic>
|
16
|
-
</Project>
|
17
|
-
</UIP>
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<UIP version="3" >
|
3
|
+
<Project >
|
4
|
+
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
+
<Graph >
|
6
|
+
<Scene id="Scene" >
|
7
|
+
<XYZZY id="future"/>
|
8
|
+
</Scene>
|
9
|
+
</Graph>
|
10
|
+
<Logic >
|
11
|
+
<State name="Master Slide" component="#Scene" >
|
12
|
+
<Add ref="#future" />
|
13
|
+
<State id="Scene-Slide1" name="Slide1" />
|
14
|
+
</State>
|
15
|
+
</Logic>
|
16
|
+
</Project>
|
17
|
+
</UIP>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
-- Copyright (c) 2013 NVIDIA, Inc.
|
2
|
+
-- Provided under the MIT License: http://opensource.org/licenses/MIT
|
3
|
+
|
4
|
+
--[[
|
5
|
+
<Property name="machineid" formalName="State Machine" description="The id of the statemachine asset to query." type="String" default="logic" />
|
6
|
+
<Property name="location" formalName="Data Name" description="Name of the data model attribute." type="String" default="vehicleSpeed" />
|
7
|
+
<Property name="minValue" formalName="Min Value" description="The min value of the data model value." type="Float" default="0" />
|
8
|
+
<Property name="maxValue" formalName="Max Value" description="The max value of the data model value." type="Float" default="100" />
|
9
|
+
<Property name="target" formalName="Target Component" description="The scene/component to control the time of." type="ObjectRef" default="parent" />
|
10
|
+
<Property name="minTime" formalName="Min Time" description="The time at which the min value is shown." type="Float" default="0" />
|
11
|
+
<Property name="maxTime" formalName="Max Time" description="The time at which the max value is shown." type="Float" default="10" />
|
12
|
+
<Property name="clampFlag" formalName="Clamp Values?" description="Prevent times outside the min/max?" type="Boolean" default="True" />
|
13
|
+
<Property name="smoothing" formalName="Enable Smoothing?" description="Smooth out abrupt changes in the data?" type="Boolean" default="False" />
|
14
|
+
--]]
|
15
|
+
|
16
|
+
function self:onInitialize( )
|
17
|
+
self:cacheAttributeValues('machineid','location','minValue','maxValue','minTime','maxTime','smoothing','clampFlag')
|
18
|
+
self.target = getElement( getAttribute( self.element, 'target' ), self.element )
|
19
|
+
self.machine = getStateMachine( self.machineid )
|
20
|
+
assert(self.machine,"Could not locate a State Machine with an id of '"..self.machineid.."'")
|
21
|
+
|
22
|
+
self.ratio = (self.maxTime - self.minTime) / (self.maxValue - self.minValue)
|
23
|
+
self.weighting = 0.3
|
24
|
+
self.newTime = 0
|
25
|
+
end
|
26
|
+
|
27
|
+
function self:onActivate()
|
28
|
+
pause(self.target) -- In case the artist forgot to pause the context
|
29
|
+
end
|
30
|
+
|
31
|
+
function self:onUpdate( )
|
32
|
+
local theNewValue = self.machine:get(self.location)
|
33
|
+
if theNewValue ~= self.oldValue then
|
34
|
+
self.oldValue = theNewValue
|
35
|
+
self.newTime = ( theNewValue - self.minValue ) * self.ratio + self.minTime
|
36
|
+
|
37
|
+
if self.clampFlag then
|
38
|
+
if self.newTime > self.maxTime then
|
39
|
+
self.newTime = self.maxTime
|
40
|
+
elseif self.newTime < self.minTime then
|
41
|
+
self.newTime = self.minTime
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if self.smoothing then
|
47
|
+
local theCurrentTime = getTime( self.target )
|
48
|
+
if theCurrentTime ~= self.newTime then
|
49
|
+
goToTime( self.target, self.newTime*self.weighting + theCurrentTime*(1-self.weighting) )
|
50
|
+
end
|
51
|
+
else
|
52
|
+
goToTime( self.target, self.newTime )
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
function self:cacheAttributeValues(...)
|
57
|
+
for _,name in ipairs(arg) do self[name] = getAttribute( self.element, name ) end
|
58
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
-- Copyright (c) 2013 NVIDIA, Inc.
|
2
|
+
-- Provided under the MIT License: http://opensource.org/licenses/MIT
|
3
|
+
|
4
|
+
--[[
|
5
|
+
<Property name="component" formalName="Component" description="The element to use the time of." type="ObjectRef" default="parent" />
|
6
|
+
<Property name="target" formalName="Target" description="The element to control." type="ObjectRef" default="parent" />
|
7
|
+
<Property name="attrName" formalName="Attribute" description="Name of the attribute on the object to control." type="String" default="rotation.x" />
|
8
|
+
<Property name="isNumber" formalName="Remap Numbers?" description="Is the value being read and set a number that needs to be transformed?" type="Boolean" default="False" />
|
9
|
+
<Property name="minTime" formalName="Min Time" description="The min time on the component." type="Float" default="0"><ShowIfEqual property="isNumber" value="True" /></Property>
|
10
|
+
<Property name="maxTime" formalName="Max Time" description="The max time on the component." type="Float" default="10"><ShowIfEqual property="isNumber" value="True" /></Property>
|
11
|
+
<Property name="minOutput" formalName="Min Set Value" description="The min value to set the attribute to." type="Float" default="0"><ShowIfEqual property="isNumber" value="True" /></Property>
|
12
|
+
<Property name="maxOutput" formalName="Max Set Value" description="The max value to set the attribute to." type="Float" default="1"><ShowIfEqual property="isNumber" value="True" /></Property>
|
13
|
+
<Property name="clamp" formalName="Clamp Value?" description="Prevent the value from being set outside the min/max range?" type="Boolean" default="True"><ShowIfEqual property="isNumber" value="True" /></Property>
|
14
|
+
<Reference>
|
15
|
+
[target].[attrName]
|
16
|
+
</Reference>
|
17
|
+
--]]
|
18
|
+
|
19
|
+
|
20
|
+
function self:onInitialize()
|
21
|
+
self.comp = getElement( getAttribute(self.element,'component'), self.element )
|
22
|
+
self.target = getElement( getAttribute(self.element,'target'), self.element )
|
23
|
+
self:cacheAttributeValues( 'attrName', 'isNumber' )
|
24
|
+
if self.isNumber then
|
25
|
+
self:cacheAttributeValues( 'minTime', 'maxTime', 'minOutput', 'maxOutput', 'clamp' )
|
26
|
+
self.degreesToRadians = string.find( self.attrName, 'rotation' ) and math.pi/180
|
27
|
+
self.ratio = (self.maxOutput - self.minOutput) / (self.maxTime - self.minTime)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
function self:onUpdate()
|
32
|
+
local theValue = getTime( self.comp )
|
33
|
+
if theValue ~= self.oldValue then
|
34
|
+
self.oldValue = theValue
|
35
|
+
if self.isNumber then
|
36
|
+
theValue = ( ( theValue - self.minTime ) * self.ratio + self.minOutput )
|
37
|
+
if self.clamp then
|
38
|
+
if theValue < self.minOutput then theValue = self.minOutput
|
39
|
+
elseif theValue > self.maxOutput then theValue = self.maxOutput end
|
40
|
+
end
|
41
|
+
if self.degreesToRadians then theValue = theValue * self.degreesToRadians end
|
42
|
+
end
|
43
|
+
setAttribute( self.target, self.attrName, theValue )
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
function self:cacheAttributeValues(...)
|
48
|
+
for _,name in ipairs(arg) do self[name] = getAttribute( self.element, name ) end
|
49
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
-
<assets><presentation id="main" src="Paths.uip"/></assets>
|
4
|
-
</application>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
+
<assets><presentation id="main" src="Paths.uip"/></assets>
|
4
|
+
</application>
|
@@ -1,98 +1,98 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<UIP version="3" >
|
3
|
-
<Project >
|
4
|
-
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
-
<Graph >
|
6
|
-
<Scene id="Scene" >
|
7
|
-
<Layer id="Layer" >
|
8
|
-
<Camera id="Camera" />
|
9
|
-
<Light id="Light" />
|
10
|
-
<Path id="Path" >
|
11
|
-
<Material id="M1" />
|
12
|
-
<PathAnchorPoint id="AnchorPoint" name="AnchorPoint" />
|
13
|
-
<PathAnchorPoint id="AnchorPoint_001" name="AnchorPoint" />
|
14
|
-
<PathAnchorPoint id="AnchorPoint_002" name="AnchorPoint" />
|
15
|
-
<PathAnchorPoint id="AnchorPoint_003" name="AnchorPoint" />
|
16
|
-
<PathAnchorPoint id="AnchorPoint_004" name="AnchorPoint" />
|
17
|
-
</Path>
|
18
|
-
<Path id="Path2" >
|
19
|
-
<Material id="M2" />
|
20
|
-
<PathAnchorPoint id="AnchorPoint_005" name="AnchorPoint" />
|
21
|
-
<PathAnchorPoint id="AnchorPoint_006" name="AnchorPoint" />
|
22
|
-
<PathAnchorPoint id="AnchorPoint_007" name="AnchorPoint" />
|
23
|
-
<PathAnchorPoint id="AnchorPoint_008" name="AnchorPoint" />
|
24
|
-
<PathAnchorPoint id="AnchorPoint_009" name="AnchorPoint" />
|
25
|
-
</Path>
|
26
|
-
<Path id="Path3" >
|
27
|
-
<Material id="M3" />
|
28
|
-
<PathAnchorPoint id="AnchorPoint_010" name="AnchorPoint" />
|
29
|
-
<PathAnchorPoint id="AnchorPoint_011" name="AnchorPoint" />
|
30
|
-
<PathAnchorPoint id="AnchorPoint_012" name="AnchorPoint" />
|
31
|
-
<PathAnchorPoint id="AnchorPoint_013" name="AnchorPoint" />
|
32
|
-
<PathAnchorPoint id="AnchorPoint_014" name="AnchorPoint" />
|
33
|
-
</Path>
|
34
|
-
<Path id="Path4" >
|
35
|
-
<Material id="M4" />
|
36
|
-
<PathAnchorPoint id="AnchorPoint_015" name="AnchorPoint" />
|
37
|
-
<PathAnchorPoint id="AnchorPoint_016" name="AnchorPoint" />
|
38
|
-
<PathAnchorPoint id="AnchorPoint_017" name="AnchorPoint" />
|
39
|
-
<PathAnchorPoint id="AnchorPoint_018" name="AnchorPoint" />
|
40
|
-
<PathAnchorPoint id="AnchorPoint_019" name="AnchorPoint" />
|
41
|
-
</Path>
|
42
|
-
<Path id="Path5" >
|
43
|
-
<Material id="M5" />
|
44
|
-
<PathAnchorPoint id="AnchorPoint_020" name="AnchorPoint" />
|
45
|
-
<PathAnchorPoint id="AnchorPoint_021" name="AnchorPoint" />
|
46
|
-
<PathAnchorPoint id="AnchorPoint_022" name="AnchorPoint" />
|
47
|
-
<PathAnchorPoint id="AnchorPoint_023" name="AnchorPoint" />
|
48
|
-
<PathAnchorPoint id="AnchorPoint_024" name="AnchorPoint" />
|
49
|
-
</Path>
|
50
|
-
</Layer>
|
51
|
-
</Scene>
|
52
|
-
</Graph>
|
53
|
-
<Logic >
|
54
|
-
<State name="Master Slide" component="#Scene" >
|
55
|
-
<Add ref="#Layer" multisampleaa="4x" />
|
56
|
-
<Add ref="#Camera" fov="58.1806" position="437 499 -600" />
|
57
|
-
<Add ref="#Light" brightness="50" />
|
58
|
-
<State id="Scene-Slide1" name="Slide1" >
|
59
|
-
<Add ref="#Path" name="Path1" diffuse="2 0 0" opacity="50" width="17" />
|
60
|
-
<Add ref="#M1" name="Path" />
|
61
|
-
<Add ref="#AnchorPoint" incomingcontrol="0 0" outgoingcontrol="-69.5 -36.6" position="1211.2 501.3" />
|
62
|
-
<Add ref="#AnchorPoint_001" incomingcontrol="103.9 2.39999" outgoingcontrol="-103.9 -2.4" position="968.3 425.6" />
|
63
|
-
<Add ref="#AnchorPoint_002" incomingcontrol="199.1 -19.6" outgoingcontrol="-199.1 19.7" position="631.3 465" />
|
64
|
-
<Add ref="#AnchorPoint_003" incomingcontrol="161.1 12.6" outgoingcontrol="-161.1 -12.6" position="90.5 391.5" />
|
65
|
-
<Add ref="#AnchorPoint_004" incomingcontrol="81.8 -50" outgoingcontrol="234.1 -478.8" position="-234.1 478.8" />
|
66
|
-
<Add ref="#Path2" name="Path2" diffuse="3 1.66274 1.50196" opacity="50" position="110 0 0" rotation="-20 -20 0" />
|
67
|
-
<Add ref="#M2" name="Path" />
|
68
|
-
<Add ref="#AnchorPoint_005" incomingcontrol="0 0" outgoingcontrol="-51.5 28.9" position="1218.2 431.5" />
|
69
|
-
<Add ref="#AnchorPoint_006" incomingcontrol="119 9.79999" outgoingcontrol="-119.1 -9.8" position="996.1 479.5" />
|
70
|
-
<Add ref="#AnchorPoint_007" incomingcontrol="188.6 -14.6" outgoingcontrol="-188.6 14.5" position="649.3 411.6" />
|
71
|
-
<Add ref="#AnchorPoint_008" incomingcontrol="161 12.6" outgoingcontrol="-161.1 -12.6" position="95.6 544.9" />
|
72
|
-
<Add ref="#AnchorPoint_009" incomingcontrol="77.7 58.3" outgoingcontrol="221 -415.7" position="-221 415.7" />
|
73
|
-
<Add ref="#Path3" name="Path3" diffuse="2.62745 0 0" opacity="50" rotation="10 10 0" />
|
74
|
-
<Add ref="#M3" name="Path" />
|
75
|
-
<Add ref="#AnchorPoint_010" incomingcontrol="0 0" outgoingcontrol="-87.5 -41.8" position="1259.8 557.6" />
|
76
|
-
<Add ref="#AnchorPoint_011" incomingcontrol="119.1 9.79999" outgoingcontrol="-119.1 -9.8" position="965.7 464.2" />
|
77
|
-
<Add ref="#AnchorPoint_012" incomingcontrol="199.1 -19.7" outgoingcontrol="-199.1 19.7" position="581.4 487.6" />
|
78
|
-
<Add ref="#AnchorPoint_013" incomingcontrol="155 19.4" outgoingcontrol="-155 -19.4" position="60.2 505.5" />
|
79
|
-
<Add ref="#AnchorPoint_014" incomingcontrol="73.4 63.6" outgoingcontrol="241.5 -359" position="-241.5 359" />
|
80
|
-
<Add ref="#Path4" name="Path4" diffuse="3 1.85882 0" opacity="50" rotation="11 0 0" />
|
81
|
-
<Add ref="#M4" name="Path" />
|
82
|
-
<Add ref="#AnchorPoint_015" incomingcontrol="0 0" outgoingcontrol="-71.9 51.6" position="1297.3 406.2" />
|
83
|
-
<Add ref="#AnchorPoint_016" incomingcontrol="139.1 2.5" outgoingcontrol="-139.1 -2.4" position="1014.4 506.9" />
|
84
|
-
<Add ref="#AnchorPoint_017" incomingcontrol="225.7 -1.40002" outgoingcontrol="-225.7 1.4" position="600.7 414.7" />
|
85
|
-
<Add ref="#AnchorPoint_018" incomingcontrol="211.8 47.8" outgoingcontrol="-211.8 -47.8" position="46.7 474.7" />
|
86
|
-
<Add ref="#AnchorPoint_019" incomingcontrol="79.9 95.4" outgoingcontrol="325 -236" position="-325 236" />
|
87
|
-
<Add ref="#Path5" name="Path5" diffuse="2 2 0" opacity="50" rotation="9 6.9 7.9" />
|
88
|
-
<Add ref="#M5" name="Path" />
|
89
|
-
<Add ref="#AnchorPoint_020" incomingcontrol="0 0" outgoingcontrol="-81.5 -61.8" position="1271.6 516.8" />
|
90
|
-
<Add ref="#AnchorPoint_021" incomingcontrol="103.9 2.40002" outgoingcontrol="-103.9 -2.4" position="1004.8 390.8" />
|
91
|
-
<Add ref="#AnchorPoint_022" incomingcontrol="199 -19.7" outgoingcontrol="-199.1 19.7" position="638.9 445.8" />
|
92
|
-
<Add ref="#AnchorPoint_023" incomingcontrol="161.1 12.6" outgoingcontrol="-161.1 -12.6" position="66.8 352.6" />
|
93
|
-
<Add ref="#AnchorPoint_024" incomingcontrol="85 -71.9" outgoingcontrol="264.3 -483.7" position="-264.3 483.7" />
|
94
|
-
</State>
|
95
|
-
</State>
|
96
|
-
</Logic>
|
97
|
-
</Project>
|
98
|
-
</UIP>
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<UIP version="3" >
|
3
|
+
<Project >
|
4
|
+
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
+
<Graph >
|
6
|
+
<Scene id="Scene" >
|
7
|
+
<Layer id="Layer" >
|
8
|
+
<Camera id="Camera" />
|
9
|
+
<Light id="Light" />
|
10
|
+
<Path id="Path" >
|
11
|
+
<Material id="M1" />
|
12
|
+
<PathAnchorPoint id="AnchorPoint" name="AnchorPoint" />
|
13
|
+
<PathAnchorPoint id="AnchorPoint_001" name="AnchorPoint" />
|
14
|
+
<PathAnchorPoint id="AnchorPoint_002" name="AnchorPoint" />
|
15
|
+
<PathAnchorPoint id="AnchorPoint_003" name="AnchorPoint" />
|
16
|
+
<PathAnchorPoint id="AnchorPoint_004" name="AnchorPoint" />
|
17
|
+
</Path>
|
18
|
+
<Path id="Path2" >
|
19
|
+
<Material id="M2" />
|
20
|
+
<PathAnchorPoint id="AnchorPoint_005" name="AnchorPoint" />
|
21
|
+
<PathAnchorPoint id="AnchorPoint_006" name="AnchorPoint" />
|
22
|
+
<PathAnchorPoint id="AnchorPoint_007" name="AnchorPoint" />
|
23
|
+
<PathAnchorPoint id="AnchorPoint_008" name="AnchorPoint" />
|
24
|
+
<PathAnchorPoint id="AnchorPoint_009" name="AnchorPoint" />
|
25
|
+
</Path>
|
26
|
+
<Path id="Path3" >
|
27
|
+
<Material id="M3" />
|
28
|
+
<PathAnchorPoint id="AnchorPoint_010" name="AnchorPoint" />
|
29
|
+
<PathAnchorPoint id="AnchorPoint_011" name="AnchorPoint" />
|
30
|
+
<PathAnchorPoint id="AnchorPoint_012" name="AnchorPoint" />
|
31
|
+
<PathAnchorPoint id="AnchorPoint_013" name="AnchorPoint" />
|
32
|
+
<PathAnchorPoint id="AnchorPoint_014" name="AnchorPoint" />
|
33
|
+
</Path>
|
34
|
+
<Path id="Path4" >
|
35
|
+
<Material id="M4" />
|
36
|
+
<PathAnchorPoint id="AnchorPoint_015" name="AnchorPoint" />
|
37
|
+
<PathAnchorPoint id="AnchorPoint_016" name="AnchorPoint" />
|
38
|
+
<PathAnchorPoint id="AnchorPoint_017" name="AnchorPoint" />
|
39
|
+
<PathAnchorPoint id="AnchorPoint_018" name="AnchorPoint" />
|
40
|
+
<PathAnchorPoint id="AnchorPoint_019" name="AnchorPoint" />
|
41
|
+
</Path>
|
42
|
+
<Path id="Path5" >
|
43
|
+
<Material id="M5" />
|
44
|
+
<PathAnchorPoint id="AnchorPoint_020" name="AnchorPoint" />
|
45
|
+
<PathAnchorPoint id="AnchorPoint_021" name="AnchorPoint" />
|
46
|
+
<PathAnchorPoint id="AnchorPoint_022" name="AnchorPoint" />
|
47
|
+
<PathAnchorPoint id="AnchorPoint_023" name="AnchorPoint" />
|
48
|
+
<PathAnchorPoint id="AnchorPoint_024" name="AnchorPoint" />
|
49
|
+
</Path>
|
50
|
+
</Layer>
|
51
|
+
</Scene>
|
52
|
+
</Graph>
|
53
|
+
<Logic >
|
54
|
+
<State name="Master Slide" component="#Scene" >
|
55
|
+
<Add ref="#Layer" multisampleaa="4x" />
|
56
|
+
<Add ref="#Camera" fov="58.1806" position="437 499 -600" />
|
57
|
+
<Add ref="#Light" brightness="50" />
|
58
|
+
<State id="Scene-Slide1" name="Slide1" >
|
59
|
+
<Add ref="#Path" name="Path1" diffuse="2 0 0" opacity="50" width="17" />
|
60
|
+
<Add ref="#M1" name="Path" />
|
61
|
+
<Add ref="#AnchorPoint" incomingcontrol="0 0" outgoingcontrol="-69.5 -36.6" position="1211.2 501.3" />
|
62
|
+
<Add ref="#AnchorPoint_001" incomingcontrol="103.9 2.39999" outgoingcontrol="-103.9 -2.4" position="968.3 425.6" />
|
63
|
+
<Add ref="#AnchorPoint_002" incomingcontrol="199.1 -19.6" outgoingcontrol="-199.1 19.7" position="631.3 465" />
|
64
|
+
<Add ref="#AnchorPoint_003" incomingcontrol="161.1 12.6" outgoingcontrol="-161.1 -12.6" position="90.5 391.5" />
|
65
|
+
<Add ref="#AnchorPoint_004" incomingcontrol="81.8 -50" outgoingcontrol="234.1 -478.8" position="-234.1 478.8" />
|
66
|
+
<Add ref="#Path2" name="Path2" diffuse="3 1.66274 1.50196" opacity="50" position="110 0 0" rotation="-20 -20 0" />
|
67
|
+
<Add ref="#M2" name="Path" />
|
68
|
+
<Add ref="#AnchorPoint_005" incomingcontrol="0 0" outgoingcontrol="-51.5 28.9" position="1218.2 431.5" />
|
69
|
+
<Add ref="#AnchorPoint_006" incomingcontrol="119 9.79999" outgoingcontrol="-119.1 -9.8" position="996.1 479.5" />
|
70
|
+
<Add ref="#AnchorPoint_007" incomingcontrol="188.6 -14.6" outgoingcontrol="-188.6 14.5" position="649.3 411.6" />
|
71
|
+
<Add ref="#AnchorPoint_008" incomingcontrol="161 12.6" outgoingcontrol="-161.1 -12.6" position="95.6 544.9" />
|
72
|
+
<Add ref="#AnchorPoint_009" incomingcontrol="77.7 58.3" outgoingcontrol="221 -415.7" position="-221 415.7" />
|
73
|
+
<Add ref="#Path3" name="Path3" diffuse="2.62745 0 0" opacity="50" rotation="10 10 0" />
|
74
|
+
<Add ref="#M3" name="Path" />
|
75
|
+
<Add ref="#AnchorPoint_010" incomingcontrol="0 0" outgoingcontrol="-87.5 -41.8" position="1259.8 557.6" />
|
76
|
+
<Add ref="#AnchorPoint_011" incomingcontrol="119.1 9.79999" outgoingcontrol="-119.1 -9.8" position="965.7 464.2" />
|
77
|
+
<Add ref="#AnchorPoint_012" incomingcontrol="199.1 -19.7" outgoingcontrol="-199.1 19.7" position="581.4 487.6" />
|
78
|
+
<Add ref="#AnchorPoint_013" incomingcontrol="155 19.4" outgoingcontrol="-155 -19.4" position="60.2 505.5" />
|
79
|
+
<Add ref="#AnchorPoint_014" incomingcontrol="73.4 63.6" outgoingcontrol="241.5 -359" position="-241.5 359" />
|
80
|
+
<Add ref="#Path4" name="Path4" diffuse="3 1.85882 0" opacity="50" rotation="11 0 0" />
|
81
|
+
<Add ref="#M4" name="Path" />
|
82
|
+
<Add ref="#AnchorPoint_015" incomingcontrol="0 0" outgoingcontrol="-71.9 51.6" position="1297.3 406.2" />
|
83
|
+
<Add ref="#AnchorPoint_016" incomingcontrol="139.1 2.5" outgoingcontrol="-139.1 -2.4" position="1014.4 506.9" />
|
84
|
+
<Add ref="#AnchorPoint_017" incomingcontrol="225.7 -1.40002" outgoingcontrol="-225.7 1.4" position="600.7 414.7" />
|
85
|
+
<Add ref="#AnchorPoint_018" incomingcontrol="211.8 47.8" outgoingcontrol="-211.8 -47.8" position="46.7 474.7" />
|
86
|
+
<Add ref="#AnchorPoint_019" incomingcontrol="79.9 95.4" outgoingcontrol="325 -236" position="-325 236" />
|
87
|
+
<Add ref="#Path5" name="Path5" diffuse="2 2 0" opacity="50" rotation="9 6.9 7.9" />
|
88
|
+
<Add ref="#M5" name="Path" />
|
89
|
+
<Add ref="#AnchorPoint_020" incomingcontrol="0 0" outgoingcontrol="-81.5 -61.8" position="1271.6 516.8" />
|
90
|
+
<Add ref="#AnchorPoint_021" incomingcontrol="103.9 2.40002" outgoingcontrol="-103.9 -2.4" position="1004.8 390.8" />
|
91
|
+
<Add ref="#AnchorPoint_022" incomingcontrol="199 -19.7" outgoingcontrol="-199.1 19.7" position="638.9 445.8" />
|
92
|
+
<Add ref="#AnchorPoint_023" incomingcontrol="161.1 12.6" outgoingcontrol="-161.1 -12.6" position="66.8 352.6" />
|
93
|
+
<Add ref="#AnchorPoint_024" incomingcontrol="85 -71.9" outgoingcontrol="264.3 -483.7" position="-264.3 483.7" />
|
94
|
+
</State>
|
95
|
+
</State>
|
96
|
+
</Logic>
|
97
|
+
</Project>
|
98
|
+
</UIP>
|