Module: Flak::Template::Maya::Tasks

Defined in:
lib/flak/rake/templates/maya.rb

Class Method Summary collapse

Class Method Details

.extended(target) ⇒ Object



45
46
47
# File 'lib/flak/rake/templates/maya.rb', line 45

def self.extended target
  task_factory target
end

.generate_icon_tasks(target) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/flak/rake/templates/maya.rb', line 89

def self.generate_icon_tasks target
  settings = target.settings


  source_files = settings[:maya_icon_files]
  unless source_files.nil?

    source_files.each do |f|

      build_file = target.icon_build_filename f

      dest_file = target.destination_filepath( settings[:maya_icon_destination], build_file)

      file build_file => f do |t|
        target.make_directory_for(build_file)
        cmd = "#{settings[:icon_convert_cmd]} #{f} #{build_file}"
        sh cmd
      end

      file dest_file => build_file do |t|
        target.make_directory_for(dest_file)
        cp build_file, dest_file 
      end         

      task :release => dest_file 

    end
  end
end

.generate_node_icon_tasks(target) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/flak/rake/templates/maya.rb', line 51

def self.generate_node_icon_tasks target
  settings = target.settings


  source_files = settings[:maya_node_icon_files]
  unless source_files.nil?

    source_files.each do |f|

      ['outliner','dg'].each do |type|

        build_file = target.send "#{type}_icon_build_filename", f

        dest_file = target.destination_filepath( settings[:maya_icon_destination], build_file)

        file build_file => f do |t|
          target.make_directory_for(build_file)
          cmd_key = "#{type}_convert_cmd".to_sym
          cmd = "#{settings[cmd_key]} #{f} #{build_file}"
          sh cmd
        end

        file dest_file => build_file do |t|
          target.make_directory_for(dest_file)
          cp build_file, dest_file 
        end         

        task :release => dest_file 
      end
    end
  end
end

.task_factory(target) ⇒ Object

generate tasks here



127
128
129
130
131
# File 'lib/flak/rake/templates/maya.rb', line 127

def self.task_factory target
  settings = target.settings
  self.generate_node_icon_tasks target
  self.generate_icon_tasks target
end