Commit 2d638147 authored by Connor Price's avatar Connor Price 🤣

Auto generating reload anims works now!

parent f4c1b6e7
import lxml.etree as ET
# Reload State Checks
def reload( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload/") and not ( name.endswith("/enter") or name.endswith("/loop") or name.endswith("/exit") or name.endswith("/not_empty_exit") ) )
import state_check
import process_state
def reload_not_empty( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload_not_empty/") and not ( name.endswith("/enter") or name.endswith("/loop") or name.endswith("/exit") or name.endswith("/not_empty_exit") ) )
def reload_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload/") and name.endswith("/enter") )
def reload_loop( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload/") and name.endswith("/loop") )
def reload_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload/") and name.endswith("/exit") )
def reload_not_empty_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload/") and name.endswith("/not_empty_exit") )
# Bipod State Checks
def bipod_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_enter/") )
def bipod_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_exit/") )
def bipod_idle( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_idle/") )
def bipod_recoil( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil/") )
def bipod_recoil_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_enter/") )
def bipod_recoil_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_exit/") )
def bipod_recoil_loop( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_loop/") )
# Underbarrel State Checks
parser = ET.XMLParser(remove_comments=True)
parser = ET.XMLParser(remove_comments=True,remove_blank_text=True)
tree = ET.parse('fps_spawn.animation_states', parser)
root = tree.getroot()
states = root.findall('state')
for state in states:
if reload( state ):
first_index = None
contains_reload = False
contains_bipod = False
for index, state in enumerate(states):
if state_check.fps( state ):
process_state.fps( state )
print("fps")
elif state_check. reload( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload( state )
print("reload")
elif reload_not_empty( state ):
elif state_check. reload_not_empty( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload_not_empty( state )
print("reload_not_empty")
elif reload_enter( state ):
elif state_check. reload_enter( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload_enter( state )
print("reload_enter")
elif reload_loop( state ):
elif state_check. reload_loop( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload_loop( state )
print("reload_loop")
elif reload_exit( state ):
elif state_check. reload_exit( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload_exit( state )
print("reload_exit")
elif reload_not_empty_exit( state ):
elif state_check. reload_not_empty_exit( state ):
if first_index == None:
first_index = index
contains_reload = True
process_state.reload_not_empty_exit( state )
print("reload_not_empty_exit")
elif bipod_enter( state ):
elif state_check. bipod_enter( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_enter")
elif bipod_exit( state ):
elif state_check. bipod_exit( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_exit")
elif bipod_idle( state ):
elif state_check. bipod_idle( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_idle")
elif bipod_recoil( state ):
elif state_check. bipod_recoil( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_recoil")
elif bipod_recoil_enter( state ):
elif state_check. bipod_recoil_enter( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_recoil_enter")
elif bipod_recoil_exit( state ):
elif state_check. bipod_recoil_exit( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_recoil_exit")
elif bipod_recoil_loop( state ):
elif state_check. bipod_recoil_loop( state ):
if first_index == None:
first_index = index
contains_bipod = True
print("bipod_recoil_loop")
else:
print("other")
if contains_reload:
first_index = process_state.generate_new_reload_states( root, first_index )
new_root = ET.Element("xml")
doc = ET.SubElement(new_root, "doc")
......
This diff is collapsed.
This diff is collapsed.
# Main State Check
def fps( element ):
name = element.attrib['name']
return ( name == "fps" )
# Reload State Checks
def reload( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload") and not ( name.startswith("fps/reload_not_empty") or name.endswith("/enter") or name.endswith("/loop") or name.endswith("/exit") or name.endswith("/not_empty_exit") ) )
def reload_not_empty( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload_not_empty") and not ( name.endswith("/enter") or name.endswith("/loop") or name.endswith("/exit") or name.endswith("/not_empty_exit") ) )
def reload_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload") and name.endswith("/enter") )
def reload_loop( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload") and name.endswith("/loop") )
def reload_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload") and name.endswith("/exit") )
def reload_not_empty_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/reload") and name.endswith("/not_empty_exit") )
# Bipod State Checks
def bipod_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_enter") )
def bipod_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_exit") )
def bipod_idle( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_idle") )
def bipod_recoil( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil") )
def bipod_recoil_enter( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_enter") )
def bipod_recoil_exit( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_exit") )
def bipod_recoil_loop( element ):
name = element.attrib['name']
return ( name.startswith("fps/bipod_recoil_loop") )
# Underbarrel State Checks
\ No newline at end of file
......@@ -626,8 +626,8 @@ FPCameraPlayerBase.animation_globals = {
}
FPCameraPlayerBase.animation_transition_curves = {
reload = {
--enter = { 0, 0.01, "inout_quad" }
--exit = { 2.0, 2.5, "inout_quad" }
enter = { 0, 0.4, "inout_quad" },
exit = { 2.9, 3.3, "inout_quad" }
}
}
......@@ -662,8 +662,8 @@ FPCameraPlayerBase.hand_transition_curves = {
function FPCameraPlayerBase:setup_weapon_global_values( idle, reload )
self.animation_globals = {
idle = "ak5",
reload = "ak5"
idle = "aug",
reload = "ak74"
}
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment