=begin

(c) RENDERIZA 2013

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.

== Information
Author:: Renderiza
Name:: [SU]Ch
Version:: 1.0.2
SU Version:: v8
Date:: 6/29/2013
Description:: Create Rendering Channels for compositing.
History::
1.0.0:: 6/23/2013
	* Original release.  
1.0.1:: 6/29/2013
	* Exporter for all scenes
1.0.2:: 7/5/2013
	* Export single scene
	* Default scene 
=end

module RND_Extensions

	module RND_Suchannels
		require 'sketchup.rb'
		require 'RND_Suchannels/RND_Suchannels_loader.rb'
		require 'RND_Suchannels/RND_Suchannels_exporter.rb'
	end

	if !file_loaded?('rnd_menu_loader')
		@@rnd_tools_menu = UI.menu("Plugins").add_submenu("Renderiza Tools")
	end

	#------New menu Items---------------------------
	if !file_loaded?('rnd_ew_loader')
		@@rnd_ew_menu = @@rnd_tools_menu.add_submenu("Websites")
		@@rnd_ew_menu.add_separator
		@@rnd_ew_menu.add_item("Google Sites"){UI.openURL('https://sites.google.com/site/renderizastudio/')}
		@@rnd_ew_menu.add_item("Blogger"){UI.openURL('http://renderizastudio.blogspot.com/')}
		@@rnd_ew_menu.add_item("YouTube"){UI.openURL('http://www.youtube.com/renderizastudio')}
		@@rnd_ew_menu.add_item("Twitter"){UI.openURL('https://twitter.com/RenderizaStudio')}
		@@rnd_ew_menu.add_item("Google+"){UI.openURL('https://plus.google.com/u/0/100658341914902555650/posts')}
		@@rnd_tools_menu.add_separator
		@@rnd_ew_menu.add_separator
	end
	#------------------------------------------------

	if !file_loaded?(__FILE__) #then
		@@rnd_tools_menu.add_item('[SU]Ch') {
			Sketchup.active_model.select_tool RND_Extensions::RND_Suchannels::Suchannels.new
		}
		# Add toolbars
		rnd_suchannels_tb = UI::Toolbar.new "[SU]Ch"
		rnd_suchannels_cmd = UI::Command.new("[SU]Ch") {
			Sketchup.active_model.select_tool RND_Extensions::RND_Suchannels::Suchannels.new
		}

		# icons toolbar
		rnd_suchannels_cmd.small_icon = "img/rnd_suchannels_1_16.png"
		rnd_suchannels_cmd.large_icon = "img/rnd_suchannels_1_24.png"
		rnd_suchannels_cmd.tooltip = "[SU]Ch"
		rnd_suchannels_cmd.status_bar_text = "Create rendering channels for compositing."
		rnd_suchannels_cmd.menu_text = "[SU]Ch"
		rnd_suchannels_tb = rnd_suchannels_tb.add_item rnd_suchannels_cmd
		rnd_suchannels_tb.show

		###

		rnd_suexporter_cmd = UI::Command.new("[SU]Exporter") {
			Sketchup.active_model.select_tool RND_Extensions::RND_Suchannels::Suexporter.new
		}

		# icons toolbar exporter
		rnd_suexporter_cmd.small_icon = "img/rnd_suexport_1_16.png"
		rnd_suexporter_cmd.large_icon = "img/rnd_suexport_1_24.png"
		rnd_suexporter_cmd.tooltip = "[SU]Exporter"
		rnd_suexporter_cmd.status_bar_text = "Export rendering channels for compositing."
		rnd_suexporter_cmd.menu_text = "[SU]Exporter"
		rnd_suchannels_tb = rnd_suchannels_tb.add_item rnd_suexporter_cmd
		rnd_suchannels_tb.show

	end

	file_loaded('rnd_ew_loader')
	file_loaded('rnd_menu_loader')
	file_loaded(__FILE__)
end