Skip to content

Commit

Permalink
planning to add trigger geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-biscuits committed Sep 29, 2021
1 parent d1a816b commit ce188c3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
32 changes: 32 additions & 0 deletions io_import_rbsp/rbsp/apex_legends/tool_textures.txt
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions io_import_rbsp/rbsp/titanfall/entities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math
import re
from typing import Dict, List

import bpy
Expand Down Expand Up @@ -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

0 comments on commit ce188c3

Please sign in to comment.