-- globals
	FStart = (animationrange.start)
	FEnd = (animationrange.End)

--
-- ------------- Find Fume Container -------------------
--
foo = $* as array
fooFX = #()	-- array that has all the containers added to it
for i = 1 to foo.count do
(
		if classof foo[i] ==fumefx then 
	(
		append foofx foo[i]
	)	
)


	
rollout Fumer "Fumer v1.0  by Allan McKay"
(

	group  "Container"
	(
	pickbutton _MyContainer "DefaultContainer" text:"test"
	)
	group "Simulation Options"
	(
		checkbox _WT "Wavelet"
		checkbox _PP "PP Retime" -- turn on retime
	)
	
	
		on _MyContainer picked obj do
	(
		
		_MyContainer.text = obj.name
	)
	
	group "Render"
	(
		checkbox _Ren "Render" checked:true
		
		
		button _Go "Launch"
			on _Go pressed do
			(
				(
				print _MyContainer.text
				If _MyContainer.text == "DefaultContainer" then
					(
						print "yay"
						global _FinalContainer = (getnodebyname foofx[1].name)
					)
				else
					(
						print "nay"
						global _FinalContainer = (getnodebyname _MyContainer.text)
					)
				)
	
					_FinalContainer.SelectedCache = 0
					_FinalContainer.runsimulation 0
					if _WT.state == true then (print "it's fucking on")
					if _WT.state == true then (_FinalContainer.runsimulation 2)
					if _WT.state == true then (_FinalContainer.SelectedCache = 1)
					
					if _PP.checked = true then _FinalContainer.runsimulation 3
					if _PP.checked = true then _FinalContainer.SelectedCache = 2
					render framerange:#active outputfile:rendoutputfilename
					messagebox "Sim's done! Rock'N'Roll!"
			)
	)
	Label labAbout "HTTP://WWW.ALLANMCKAY.COM" align:#center

)

createdialog fumer width:220

