#Reduce GAP file bloat for custom anims ?

14 messages · Page 1 of 1 (latest)

cloud mangoBOT
#

so i assume this is something to do w the gap file getting too bloated (it's at 26,680kb lmao) and im getting some similar issues in to this post where completly unrelated anims in the same gap seem to die whenever another ones replaced. So im wondering if there's a way to reduce the file size of the gap, i'm not sure if 010 editor would work as it did with the other post that had similar issues, becuase instead of adding keyframes to a base animation, these are just fully new anims but idk

I'm editing .GAP files to add wing animations for an Arsene-outfit Joker mod and I noticed the exported .GAPs were significantly larger than the originals. I tested by importing Joker's BB0001_051.GAP file into Blender and then exporting with no changes and saw the same effect.

In game, Blender-exported animations load in but any animations pulled from those .GAPs have clearly noticeable delays. The worst offender is the end of battle run at the victory screen; the animation appears to start but the model doesn't load in for several frames and only loads in pieces when it does. The model itself works fine with default animations, so I don't think it has anything to do with that.

The plugin doesn't throw any errors and all export version options return the same results. Am I missing something?

Jump

[Go to message!](#1203489072857751562 message)

plucky epoch
#

oops forgot it'd do the bot thingy hollowcat

#

Reduce GAP file bloat for custom anims ?

queen vine
#

thats a anim bounding box issue not a gap size issue

median idol
#

yeah the animation is either missing a bounding box or it's incorrect size

#

blender plugin should be able to generate a proper one

plucky epoch
#

hmm weird bc i haven't touched the victory anim at all lmao

#

i can try reextporting it, but would you have any idea what also causes the weird head tilt for the battle anim ?

median idol
#

funny lookat

plucky epoch
#

i guess it must be somin to do w how i baked the anims ? replacing the anims from the gb version which works fine also causes the head tilt and vice versa, so i'll mark this as solved and reexport all the anims tmr at some point

queen vine
#

input_file = "C:/mods/persona/Release (2)r2/Mods/p5rpc.skins.chee/P5REssentials/CPK/chee/model/character/enemy/0745/bem0745_000.GAP"
output_file = "C:/mods/persona/Release (2)r2/Mods/p5rpc.skins.chee/P5REssentials/CPK/chee/model/character/enemy/0745/bem0745_custom.GAP"

# Load the GFS interface from the input file
gi = GFSInterface.from_file(input_file)

# Define custom bounding boxes for specific animation ranges
custom_ranges = [
    {"start": 0, "end": 6, "min_dims": [4.0, 4.0, 4.0], "max_dims": [4.0, 4.0, 4.0]},
    {"start": 7, "end": 10, "min_dims": [8.0, 8.0, 8.0], "max_dims": [8.0, 8.0, 8.0]},
]

# Set a fallback bounding box for animations not specified in custom_ranges
fallback_min_dims = [-82.675392, -3.850763, -599.009583]
fallback_max_dims = [82.675392, 180.280975, 108.664375]

# Modify animations and apply custom bounding boxes
for anim_index, anim in enumerate(gi.animations):
    custom_range = None
    for custom_anim_range in custom_ranges:
        if custom_anim_range["start"] <= anim_index <= custom_anim_range["end"]:
            custom_range = custom_anim_range
            break

    if custom_range:
        anim.bounding_box_min_dims = custom_range["min_dims"]
        anim.bounding_box_max_dims = custom_range["max_dims"]
    else:
        anim.bounding_box_min_dims = fallback_min_dims
        anim.bounding_box_max_dims = fallback_max_dims

# Save the modified animations to a new file
gi.to_file(output_file, 0x01105100)  # Version is an integer

I use this script to fix it

median idol
#

the fook