Class: Tracksperanto::Import::NukeScript

Inherits:
Base
  • Object
show all
Defined in:
lib/import/nuke_script.rb

Defined Under Namespace

Classes: CornerPin2D, PlanarTracker, PlanarTracker1_0, Reconcile3D, Tracker3, Tracker4, Transform

Instance Attribute Summary

Attributes inherited from Base

#height, #io, #progress_block, #width

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

autodetects_size?, inherited, #report_progress

Methods included from BlockInit

#initialize

Methods included from ZipTuples

#zip_curve_tuples

Methods included from ConstName

#const_name

Methods included from Safety

#safe_reader

Methods included from Casts

#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string

Class Method Details

.distinct_file_extObject



10
11
12
# File 'lib/import/nuke_script.rb', line 10

def self.distinct_file_ext
  ".nk"
end

.human_nameObject



6
7
8
# File 'lib/import/nuke_script.rb', line 6

def self.human_name
  "Nuke .nk script file with Tracker, Reconcile3D, Transform2D, PlanarTracker and CornerPin nodes"
end

.known_snagsObject



14
15
16
17
# File 'lib/import/nuke_script.rb', line 14

def self.known_snags
  "The only supported nodes that we can extract tracks from are Transform2D, Reconcile3D, " +
  "PlanarTracker and Tracker (we support Nuke 5 up to and including 8)"
end

Instance Method Details

#eachObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/import/nuke_script.rb', line 19

def each
  parser = Tickly::NodeProcessor.new
  
  parser.add_node_handler_class(Tracker3)
  parser.add_node_handler_class(Reconcile3D)
  parser.add_node_handler_class(PlanarTracker1_0)
  parser.add_node_handler_class(PlanarTracker)
  parser.add_node_handler_class(Tracker4)
  parser.add_node_handler_class(CornerPin2D)
  parser.add_node_handler_class(Transform)
  
  parser.parse(Bychar.wrap(@io)) do | node |
    node.trackers.each do | t |
      report_progress("Scavenging tracker #{t.name}")
      yield t
    end
  end
end