diff --git a/io_import_rbsp/rbsp/apex_legends/tool_textures.txt b/io_import_rbsp/rbsp/apex_legends/tool_textures.txt new file mode 100644 index 0000000..da5e049 --- /dev/null +++ b/io_import_rbsp/rbsp/apex_legends/tool_textures.txt @@ -0,0 +1,32 @@ +TOOLS\TOOLSBLACK +TOOLS\TOOLSBLOCKBULLETS +TOOLS\TOOLSBLOCKLIGHT +TOOLS\TOOLSBLOCK_LOS +TOOLS\TOOLSBLOCK_LOS_N_CLIP +TOOLS\TOOLSCLIP +TOOLS\TOOLSCLIP_ALLOW_ABILITIES +TOOLS\TOOLSCLIP_GRATE +TOOLS\TOOLSCLIP_HUMAN +TOOLS\TOOLSCLIP_HUMAN_CLIMBABLE +TOOLS\TOOLSCLIP_HUMAN_SLIP +TOOLS\TOOLSCLIP_METAL +TOOLS\TOOLSCLIP_TITAN +TOOLS\TOOLSCLIP_VEHICLE_BARRIER +TOOLS\TOOLSEXPOSUREVOLUME +TOOLS\TOOLSFOGVOLUME +TOOLS\TOOLSINVISIBLE +TOOLS\TOOLSNOAIRDROP +TOOLS\TOOLSNODRAW +TOOLS\TOOLSNODRAW_GLASS_FOOTSTEPS +TOOLS\TOOLSNPCCLIP +TOOLS\TOOLSOUT_OF_BOUNDS +TOOLS\TOOLSPLAYERCLIP +TOOLS\TOOLSSKYBOX +TOOLS\TOOLSSOUNDTRIGGER_CHAINLINK +TOOLS\TOOLSSOUNDTRIGGER_FOLIAGE +TOOLS\TOOLSTRIGGER +TOOLS\TOOLSTRIGGER_NO_ZIPLINE +TOOLS\TOOLS_CLIP_N_BLOCK +tools\toolsblack +tools\toolsblocklight +tools\toolsclip_allow_abilities \ No newline at end of file diff --git a/io_import_rbsp/rbsp/titanfall/entities.py b/io_import_rbsp/rbsp/titanfall/entities.py index d26520a..c72fba3 100644 --- a/io_import_rbsp/rbsp/titanfall/entities.py +++ b/io_import_rbsp/rbsp/titanfall/entities.py @@ -1,4 +1,5 @@ import math +import re from typing import Dict, List import bpy @@ -107,3 +108,32 @@ def as_empties(bsp, master_collection): entity_object[field] = entity[field] # TODO: once all ents are loaded, connect paths for keyframe_rope / path_track etc. # TODO: do a second pass of entities to apply parental relationships (based on targetnames) + + +# trigger_multiple, trigger_once, trigger_hurt + + +# ent_object_data["trigger_*"] = trigger_bounds +def trigger_bounds(trigger_ent: Dict[str, str]) -> bpy.types.Mesh: + # TODO: only for entities with no mesh geometry + raise NotImplementedError() + # pattern_vector = re.compile(r"([^\s]+) ([^\s]+) ([^\s]+)") + # mins = list(map(float, pattern_vector.match(trigger_ent["*trigger_bounds_mins"]))) + # maxs = list(map(float, pattern_vector.match(trigger_ent["*trigger_bounds_maxs"]))) + # TODO: return mesh data for a cube scaled to mins & maxs + + +# ent_object_data["trigger_*"] = trigger_bounds +def trigger_bmesh(trigger_ent: Dict[str, str]) -> bpy.types.Mesh: + # TODO: only for entities with no mesh geometry + pattern_plane_key = re.compile(r"\*trigger_brush([0-9]+)_plane([0-9]+)") # brush_index, plane_index + pattern_plane_value = re.compile(r"([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)") # *normal, distance + brushes = dict() + for key in trigger_ent.keys(): + match = pattern_plane_key.match(key) + if match: + brush_index, plane_index = map(int, match.groups()) + *normal, distance = map(float, pattern_plane_value.match(trigger_ent[key]).groups()) + brushes[(brush_index, plane_index)] = (normal, distance) + raise NotImplementedError() + # TODO: use Logic&Trick's brush creation code from QtPyHammer here