Class: Tracksperanto::Export::Maxscript
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::Maxscript
show all
- Defined in:
- lib/export/maxscript.rb
Overview
Export each tracker as a moving 3dsmax null
Constant Summary
collapse
- MULTIPLIER =
10.0
- IMAGE_PLANE =
'new_plane = convertToPoly (plane width:%0.5f length:%0.5f lengthsegs:1 widthsegs:1 name:"TracksperantoPlane" backFaceCull:True)'
Instance Attribute Summary
Attributes inherited from Base
#io
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
inherited, #initialize
Methods included from ConstName
#const_name, included
#just_export
Class Method Details
.desc_and_extension ⇒ Object
8
9
10
|
# File 'lib/export/maxscript.rb', line 8
def self.desc_and_extension
"3dsmax_nulls.ms"
end
|
.human_name ⇒ Object
12
13
14
|
# File 'lib/export/maxscript.rb', line 12
def self.human_name
"Autodesk 3dsmax script for nulls on an image plane"
end
|
Instance Method Details
#end_export ⇒ Object
50
51
52
53
54
|
# File 'lib/export/maxscript.rb', line 50
def end_export
@io.puts('animate off')
@io.puts('EnableSceneRedraw()')
end
|
#end_tracker_segment ⇒ Object
33
34
35
36
37
|
# File 'lib/export/maxscript.rb', line 33
def end_tracker_segment
@io.puts(')')
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/export/maxscript.rb', line 39
def export_point(frame, abs_float_x, abs_float_y, float_residual)
coords = get_coordinates(abs_float_x, abs_float_y)
coords.unshift @t
if !@initalized
@io.puts('pt = Point name:"%s" pos:[%0.5f,%0.5f,0.000] size:1.000000 axistripod:off centermarker:on isSelected:on' % coords)
@initalized = true
end
@io.puts('at time %d pt.pos.x = %.5f' % [frame, coords[1]])
@io.puts('at time %d pt.pos.y = %.5f' % [frame, coords[2]])
end
|
#start_export(w, h) ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'lib/export/maxscript.rb', line 16
def start_export(w, h)
@factor = (1 / w.to_f) * MULTIPLIER
@true_width, @true_height = w * @factor, h * @factor
@io.puts(IMAGE_PLANE % [@true_width, @true_height])
end
|
#start_tracker_segment(tracker_name) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/export/maxscript.rb', line 26
def start_tracker_segment(tracker_name)
@t = tracker_name
@initalized = false
@io.puts("-- Data for tracker %s" % @t)
@io.puts('animate on (')
end
|