--Enhanced Model Viewer RE2 global resources
--by alphaZomega

local EMV = require("EMV Engine")

local game_name = reframework.get_game_name()
local create_resource = EMV.create_resource
local orderedPairs = EMV.orderedPairs
local loaded_resources = false

--a dictionary of tables with 2-3 tables each, one for body and one for face and sometimes one to exclude
local alt_names = { 
	--[[["ch02_00"]= { body=table.pack("ch02_050"), face=table.pack("em1262") }, 		--Bela RE8
	["ch02_01"]= { body=table.pack("ch02_050"), face=table.pack("em1261") }, 		--Cassandra
	["ch02_02"]= { body=table.pack("ch02_050"), face=table.pack("em1260") }, 		--Daniela
	["ch09_40"]= { body=table.pack("ch07_20"), face=table.pack("em133", "em132") },  --Miranda
	["ch07_20"]= { body=table.pack("ch09_40"), face=table.pack("em132", "em133") },  --Miranda
	["ch10_33"]= { body=table.pack("ch10_30") },
	["ch03_06"]= { body=table.pack("ch13_10") },
	["ch03_02"]= { body=table.pack("ch03_01") }, --Hauler 
	["ch13_01"]= { body=table.pack("ch13_00"), exclude=table.pack("ch07_20") },									--Lycan
	["ch09_32"]= { body=table.pack("ch09_30"), face=table.pack("em414", "em115") },	--Chris (Jacket)
	["ch09_30"]= { body=table.pack("ch09_32"), face=table.pack("em115", "em414") },	--Chris B
	["ch09_01"]= { face=table.pack("em440") }, --Rosemary (Adult)
	["ch09_05"]= { exclude=table.pack("ch09_00") }, --Mia]]
}

re.on_application_entry("UpdateMotion", function()
	if not loaded_resources and game_name == "re2" and EMVSettings and RSCache and (figure_mode or forced_mode) then 
		
		local dlc_folder = scene:call("findFolder", "RopewayContents_Rogue")
		if dlc_folder and dlc_folder:call("get_Active") == false then 
			dlc_folder:call("activate")
		end
		
		RSCache.motbank_resources = RSCache.motbank_resources or {}
		RSCache.tex_resources = RSCache.tex_resources or {}
		local all_motbanks = {}
		
		--create_resource("sectionroot/animation/player/pl10/pl1050_cutscene_face.motbank", "via.motion.MotionBankResource")
		--create_resource("sectionroot/animation/player/pl10/bank/pl1000_cutscene_body.motbank", "via.motion.MotionBankResource")
		if EMVSettings.special_mode == 2 then 
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/Face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/pl10body.motbank")
			--re.msg("Loaded Claire Assets")
		elseif EMVSettings.special_mode == 3 then
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2000_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2050_cutscene_face.motbank")
			--re.msg("Loaded Ada Assets")
		else	
			--table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/pl0000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/pl00/pl0050_cutscene_face.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2050_cutscene_face.motbank")
			--[ [
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300_dead.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/outer/pl30/hag/bank/pl30_hag.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl64/bank/facial.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl50/bank/facial.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl30/pl30face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/pl20face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_facial.motbank")
			
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/pl10face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/pl00face.motbank")

			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/common/pl_common_facial.motbank")
			--]]
			
			table.insert(all_motbanks, "sectionroot/animation/player/outer/pl20/ada_leading/bank/barehand.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/outer/pl30/sherry_scare/bank/barehand.motbank")
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/pl10face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/pl00face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl75/bank/facial.motbank")
			--]]
			
			--[ [
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/barehand.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl64/bank/barehand.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl30/bank/barehand.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/barehand.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/barehand.motbank")
			
			--]]
			
			--table.insert(all_motbanks, "sectionroot/animation/player/outer/pl10/claire_lgt_fin/bank/barehand.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/outer/pl00/leon_lgt_fin/bank/barehand.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/weapon/common/bank/common.motbank")
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7000/bank/em7000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7000/bank/em7000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7000/bank/em7000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7000/bank/em7000_jack.motbank")
		
			--]]	
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp6400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp3200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp6300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp6200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp4100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp3000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp2200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp2000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp1000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0800.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp0000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/weapon/bank/wp7000.motbank")
			--]]
			
			--[[
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_233_moveswitchboard01a/sm42_233_moveswitchboard_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_233_moveswitchboard01a/sm42_233_moveswitchboard.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_003_safebox01a/sm44_003_safebox01a_01md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_232_moveshelf01a/sm42_232_moveshelf01a_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_232_moveshelf01a/sm42_232_moveshelf01a.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/outer/pl00/leon_crocodile/bank/pl0000_crocodile.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_520_freighttrain01a/sm43_520_freighttrain01a_00.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_096_listtaglever01a/sm42_096_listtaglever01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/ladder/sm_tpl_ladder_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/general/sm_tpl_general_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/doubledoor/dbldoormotionbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/door/doormotionbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm77/sm77_004_cookiescan01a/sm77_004_gimmick_open_.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm77/sm77_002_portablesafe01a/sm77_002_portablesafe01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_727_cushiondoll01a/sm73_727_cushiondoll01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_429_liftkey01a/sm73_429_liftkey01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_222_orphanagekey01a/sm73_222_orphanagekey01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_157_blisterpack01a/sm73_157_gimmick_sound_.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_153_gardenkey01a/sm73_153_gardenkey01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_141_carkey01a/sm73_141_carkey01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_113_redjewelrybox01a/sm73_113_redjewelrybox01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_112_bluejewelrybox01a/sm73_112_bluejewelrybox01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_109_kingscepter01a/sm73_109_kingscepter01a_01md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_108_starsbadge01a/sm73_108_starsbadge01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_001_keycase01a/sm73_001_keycase01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm7x_item/sm73/sm73_000_backdoorkey01a/sm73_000_backdoorkey01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_131_orphanagedoor01a/sm40_515_gimmick_notopen.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_209_booklshelfjack01a/sm42_209_booklshelfjack01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_026_mobilebookshelf01a/sm43_26_shelf.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/window/sm_tpl_oldbarricade_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_033_zombiewindow01a/sm40_033_zombiewindow01a_01md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/switch/sm_tpl_switch_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/typewriter/sm_tpl_typewriter_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/motiononce/sm_tpl_motiononce_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/attachment/sm_tpl_attachment_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/drawer/sm_tpl_drawer_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_507_gaspipe/sm46_507_gaspipe.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm45/sm45_100_alligator01a/sm45_100_alligator01a_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm45/sm45_100_alligator01a/sm45_100_alligator01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_525_turntablelever01a/sm43_525_turntablelever01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_601_biglrubble01a/sm46_601_biglrubble01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_600_smallrubble01a/sm46_600_smallrubble01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_239_explosiontank01a/sm42_239_explosiontank01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_504_breakables01a/sm46_504.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_230_coolingsystem01a/sm42_230_coolingsystem01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_222_sprayingmachine01a/sm42_222_sprayingmachine01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_223_breakerbox01a/sm42_223_breakerbox01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_236_morguedoor01a/sm42_236_morguedoor01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_015_ceilinglicker01a/sm46_015_ceilinglicker01a_00.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm45/sm45_020_ivy01a/sm45_020_ivy01a_00.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_702_removetoy01a/sm46_702_removetoy01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_203_orphanagechest01a/sm42_203_orphanagechest01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_131_orphanagedoor01a/sm40_131_orphanagedoor01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_231_incineratorshutter01a/sm42_231_incineratorshutter01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_508_g2battlecrane01a/sm46_508_g2battlecrane01a_button.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_508_g2battlecrane01a/sm46_508_g2battlecrane01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/toggleswitch/sm_tpl_toggleswitch_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/toggleswitch/sm_tpl_toggleswitch_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_511_shutterg2break01a/sm46_511_shutterg2break01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_021_electricdoor01a/sm40_021_electricdoor01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_502_movablebridge01a/sm43_512_platform01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_234_plugshutter01a/sm42_234_plugshutter01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/jackpl/slidingslope/slidingslope_player.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_515_sewagedrawbridge01a/sm43_515_sewagedrawbridge01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_516_bridgefence01a/sm43_516_bridgefence01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_171_thandlehole01a/sm42_171_thandlehole01a_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_171_thandlehole01a/sm42_171_thandlehole01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_172_sluicegate01a/sm42_172_sluicegate01a_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_195_elevatorlever01a/sm42_195_elevatorlever01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_512_platform01a/sm43_512_platform01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_019_starslocker01a/sm44_019_starslocker01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_202_policekennel01a/sm42_202_policekennel.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_021_patrolcar01a/sm44_021_patrolcar01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm6x_event/sm60/sm60_036_policeundergroundshatter01a/sm60_036_policeundergroundshatter01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_014_mortuarylockertray01a/sm43_014_mortuarylocker_cover_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_028_thandlehole02a/sm41_028_thandlehole02a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_006_blastbarricade01a/sm42_006_blastbarricade01a_01md_break.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_213_west3fstairs01a/sm42_213_west3fstairs01a_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_218_clockbell01a/sm42_218_clockbell01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_216_clockgear01a/sm42_216_clockgear01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_220_bellfalldown01a/sm42_220_bellfalldown01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_210_zombiefence01a/sm42_210_zombiefence.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_211_rooftopdrainlever01a/sm42_211_rooftopdrainlever01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_022_statue01a/sm41_022_statue01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm46/sm46_011_crashheli01a/sm46_011_crashheli01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/crank/sm_tpl_crank_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/jackpl/crank/sm_tpl_crank_pl.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_021_shuttercrankhole01a/sm41_021_shuttercrankhole01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_179_firealarm01a/sm42_179_firealarm01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_003_fireshutter01a/sm42_003_fireshutter01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm45/sm45_025_stabbedcorpse/sm45_025_stabbedcorpse.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_017_brokenfloor01a/sm42_017_brokenfloor01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/common/jackpl/fallthrough/fallthrough_male.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_004_weskerdesk01a/sm44_004_weskerdesk01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_020_watertankvalve01a/sm41_020_watertankvalve01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_014_diallock01a/sm42_014_diallock01a_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_197_rickershelf01a/sm42_197_rickershelf.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm6x_event/sm60/sm60_034_shutter02a/sm60_034_shutter02a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_002_opentoilet01a/sm44_002_opentoilet01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_007_magicmirror01a/sm42_007_brokenmirror01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_075_eastofficebarricade01a/sm42_075_eastofficebarricade01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_046_zombiewindow01a/sm40_046_zombiewindow01a_00ms.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_048_zombiewindow01b/sm40_048_zombiewindow01b.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_212_drainageswitchingdevice01a/sm42_212_drainageswitchingdevice01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_008_openoldlocker01a/sm44_008_openoldlocker01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm45/sm45_018_zombiechair01a/sm45_018_zombiechair01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_003_safebox01a/sm44_003_safebox01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_001_openlocker01a/sm44_001_openlocker01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_007_woodtable01a/sm44_007_woodtable01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_006_leondesk01a/sm44_006_leondesk01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_020_fixturesstorehouse01a/sm44_020_fixturesstorehouse01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm44/sm44_005_electroniclocker01a/sm44_005_electroniclocker01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_024_newpolicestatue01a/sm41_024_newpolicestatue01a_00md.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm6x_event/sm60/sm60_033_pipeshutter01a/sm60_033_pipeshutter01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_010_hallpipeshutter01a/sm42_010_hallpipeshutter01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm41/sm41_011_itemlocker01a/sm41_011_itemlocker01a_gimmick.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm43/sm43_522_skewliftlever01a/sm43_522_skewliftlever01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_237_labogenerator/sm42_237_labogenerator.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_207_sewageironfence01a/sm42_207_sewageironfence01a.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm42/sm42_151_shelfbottle01a/sm42_151_shelfbottle01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_143_ivydoor01a/sm40_143_ivydoor01a_motbank.motbank")
			table.insert(all_motbanks, "objectroot/setmodel/sm4x_gimmick/sm40/sm40_107_jaildoor01a/sm40_107_jaildoor.motbank")
			--]]
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7400_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7400_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7400_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7200/bank/em7200_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7200/bank/em7200_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7200/bank/em7200_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7100/bank/em7100_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7100/bank/em7100_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7100/bank/em7100_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_facial_pl20.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_facial_pl10.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_facial_pl00.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em9000/bank/em9000_facial.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack_facial_pl50.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack_facial_pl50.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack_facial_pl50.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_facial_pl50.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack_facial_pl50.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl75.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl64.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000_jack_facial_pl50.motbank")
			--]]
			--[[
			table.insert(all_motbanks, "sectionroot/animation/enemy/em9000/bank/em9000_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7400_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7100/bank/em7100_jack_pl.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7200/bank/em7200_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000_jack_pl.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000_jack.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200_jack.motbank")
			--]]
			--[ [
			table.insert(all_motbanks, "sectionroot/animation/enemy/em0000/bank/em0000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7000/bank/em7000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em9000/bank/em9000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7410.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7400/bank/em7400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7300/bank/em7300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7200/bank/em7200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em7100/bank/em7100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6300/bank/em6300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6000/bank/em6000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em5000/bank/em5000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4400/bank/em4400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em4000/bank/em4000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em3000/bank/em3000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6200/bank/em6200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/enemy/em6100/bank/em6100.motbank")
			
			--]]
			--table.insert(all_motbanks, "sectionroot/animation/player/common/pl_common.motbank")
			--[ [
			
			--]]
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4104/pl4104_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4103/pl4103_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4102/pl4102_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4101/pl4101_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4100/pl4100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl4000/pl4000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp4700/wp4700_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp4600/wp4600_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0600/wp0600_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp3000/wp3000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp4200/wp4200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp4300/wp4300_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp2200/wp2200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp2000/wp2000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp4100/wp4100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp1000/wp1000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp7000/wp7000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0100/wp0100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0300/wp0300_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0700/wp0700_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0200/wp0200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0800/wp0800_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp0000/wp0000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em7400/em7400_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em7300/em7300_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em7200/em7200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em7100/em7100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em7000/em7000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em6300/em6300_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em6200/em6200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em6400/em6400_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em4400/em4400_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em5000/em5000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em6100/em6100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em6000/em6000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em4000/em4000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em3000/em3000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl7700/pl7700_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl5000/pl5000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em0100/em0100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/em0000/em0000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl1005/pl1005_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl1011/pl1011_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl1000/pl1000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl1001/pl1001_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl0005/pl0005_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl0000/pl0000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl0002/pl0002_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl6000/pl6000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl5300/pl5300_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl5200/pl5200_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl5100/pl5100_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl5700/pl5700_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3011/pl3011_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3008/pl3008_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3001/pl3001_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3000/pl3000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl2000/pl2000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl2001/pl2001_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp7020/wp7020_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp7010/wp7010_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/wp7030/wp7030_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/sm41/sm41_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/evend/pl1000/evend_pl1000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/evend/pl0000/evend_pl0000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/evend/pl3000/evend_pl3000_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3000_01/pl3000_01_figuremotionbank.motbank")
			table.insert(all_motbanks, "sectionroot/animation/figure/pl3000_01/motion1/pl1000/pl3000_01_pl1000_figuremotionbank.motbank")
			--]]
			
			--[[
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp7000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp7000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp7000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp6300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp6300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp6300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp6200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp6200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp6200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4510.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4510.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4510.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4500.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4500.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4500.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp3000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp3000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp3000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp2200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp2200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp2200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp2000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp2000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp2000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp1000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp1000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp1000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0800.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0800.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0800.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0100.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp6400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp6400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp6400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp4000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp4000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp4000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp3200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp3200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp3200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0700.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0600.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0400.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl20/bank/wp0200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/wp0200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/wp0200.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl50/bank/wp4300.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl50/bank/wp1000.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl64/bank/wp4510.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl64/bank/wp4500.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/pl64/bank/wp0800.motbank")
			--]]
			
			--table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/pl0000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/pl00/pl0050_cutscene_face.motbank")
			--[ [
			--table.insert(all_motbanks, "sectionroot/animation/player/pl00/bank/pl0000_cutscene_body.motbank")
			
			--table.insert(all_motbanks, "sectionroot/animation/player/pl10/pl1050_cutscene_face.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/pl10/bank/pl1000_cutscene_body.motbank")
			--sdk.create_resource("via.motion.MotionBankResource", "sectionroot/animation/player/pl10/bank/pl1000_cutscene_body.motbank")
			--sdk.create_resource("via.motion.MotionBankResource", "sectionroot/animation/player/pl10/pl1050_cutscene_face.motbank")
			--sdk.create_resource("via.motion.MotionBankResource", "sectionroot/animation/player/alphaz/pl3050_cutscene_face.motbank"):add_ref()
			--sdk.create_resource("via.motion.MotionBankResource", "sectionroot/animation/player/pl00/pl0050_cutscene_face.motbank"):add_ref()
			
		--	
		--create_resource("sectionroot/animation/player/pl10/bank/pl10body.motbank", "via.motion.MotionBankResource")
		--create_resource("sectionroot/animation/player/pl00/bank/em0000.motbank", "via.motion.MotionBankResource")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl2050_cutscene_face.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/all.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl3000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl3050_cutscene_face.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5000_cutscene_body.motbank")
			--table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5050_cutscene_face.motbank")
			
			--]]
			--[[
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5100_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5150_cutscene_face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5200_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5250_cutscene_face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5300_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5350_cutscene_face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5700_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl5750_cutscene_face.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl6000_cutscene_body.motbank")
			table.insert(all_motbanks, "sectionroot/animation/player/alphaz/pl6050_cutscene_face.motbank")
			--]]

			--re.msg("Loaded Other Assets")
		end
		
		for i, bank_string in ipairs(all_motbanks) do 
			local bank
			local bank_name = bank_string --bank_string:match("^.+/(.+)%.motbank") or bank_string
			pcall(function()
				bank = create_resource(bank_string, "via.motion.MotionBankResource")
			end)
			if bank then
				RSCache.motbank_resources[bank_name] = bank
			end
		end
		
		local bgs = {}
		if true then			
			table.insert(bgs, "sectionroot/light/ibl/ibl_morning00.tex")
			table.insert(bgs, "sectionroot/light/ibl/ibl_20160419_0700_06.tex")
			table.insert(bgs, "sectionroot/light/ibl/ibl_20160419_0600_00.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm42_196_unlocklight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm42_196_unlocklight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_086_labofrontlight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_086_labofrontlight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_083_operatingroomlight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_083_operatingroomlight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_077_emitterlight01a_b_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_077_emitterlight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_031_searchlight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_030_lighttower01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_030_lighttower01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_021_streetlightc01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_020_streetlightb01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_019_streetlighta01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_019_streetlighta01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_014_aqueductlight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_014_aqueductlight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_013_walllight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_013_walllight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_011_polelight01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_011_polelight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_007_ceilinglight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm30_187_cigarettelighterbox01a_a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm30_187_cigarettelighterbox01a_a_albm.tex")
			table.insert(bgs, "sectionroot/light/ibl/ibl_opening3.tex")
			table.insert(bgs, "sectionroot/light/ibl/ibl_opening.tex")
			table.insert(bgs, "sectionroot/light/ibl/ibl_night00.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_084_labolight01a_emi.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_083_operatingroomlight01a_a_atos.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_077_emitterlight01a_a_atos.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_028_cafelight01a_a_emi.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_007_ceilinglight01a_a_atos.tex")
			table.insert(bgs, "streaming/sectionroot/environment/location/textures/st5_121_pillarlight01_nrmr.tex")
			table.insert(bgs, "streaming/sectionroot/environment/location/textures/st5_121_pillarlight01_albm.tex")
			table.insert(bgs, "sectionroot/light/texture/dirtmask/tex_capcom_light_orbs_0009_alpg.tex")
			table.insert(bgs, "streaming/sectionroot/character/weapon/wp4530/wp4530_flashlight_nrmr.tex")
			table.insert(bgs, "streaming/sectionroot/character/weapon/wp4530/wp4530_flashlight_albm.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm42_196_unlocklight01a_a_nrmr.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm42_196_unlocklight01a_a_albm.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm35_086_labofrontlight01a_a_nrmr.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm35_086_labofrontlight01a_a_albm.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_084_labolight01a_nrmr.tex")
			table.insert(bgs, "streaming/objectroot/setmodel/textures/sm35_084_labolight01a_albm.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm35_083_operatingroomlight01a_a_nrmr.tex")
			table.insert(bgs, "objectroot/setmodel/textures/sm35_083_operatingroomlight01a_a_albm.tex")
		end
		
		for i, bg_string in ipairs(bgs) do 
			local tex_resource = create_resource(bg_string, "via.render.TextureResource")
			if tex_resource then 
				--local bg_name = bg_string:match("^.+/(.+)%.tex") or bg_string
				local bg_name = tex_resource:call("ToString"):match("^.+%[@?(.+)%]")
				RSCache.tex_resources[bg_name] = tex_resource
			end
		end
		
		loaded_resources = true
	end
end)

local function finished()
	return loaded_resources
end

return {
	backgrounds = bgs,
	alt_names = alt_names,
	finished = finished,
	reset = reset,
}