Skip to content

Blender Scripts

Adam Graves edited this page Aug 4, 2024 · 2 revisions

The folder containing Blender scripts can be found here

These scripts are meant to be run after importing your zone glTF into Blender. If you're unfamiliar with running scripts in Blender, see here These have been tested and verified working on Blender versions 3.2, 3.5, 4.0, and 4.2.

eq_animate_textures.py

The glTF format does not have support for animated textures.* This script can recreate animated textures in Blender after you've imported. It does this by referencing the included animatedTextures.csv to find the materials that need to be animated, the number of frames the animation includes, and the delay between frames.
The script will reference the current FPS in your scene at the time the script is run to make sure animations play at the correct speed. Unless the framerate of an animation is evenly disible into the scene framerate, it may appear a bit hitchy - increasing the FPS from Blender's default 24 FPS (before running the script) would help alleviate this.

Prerequisites: Exported zone in glTF format with LanternExtractor, and imported zone, character, or object model into Blender.
Configuration required: Put the path to animatedTextures.csv into animated_texture_csv_location.

* Technically, glTF does support morphing animations with UV coordinates. However, this would not work with EQ textures like water since the texture is tiled - you cannot palletize it. There's also a hacky workaround that requires you to create a copy of a mesh for each animation frame, set scale = 0 for all frames except the one that is visible, and use step animation. I didn't see this option as being practical to implement.

eq_import_chrs.py

This script will query the database for all NPCs that spawn in a given zone and their locations and then import their corresponding character models. You can choose to import "static" and/or "patrolling/roaming" NPCs. If you do import patrolling/roaming NPCs they will be placed where their initial spawn is located.
This script can take a long time to run, and Blender will be unresponsive while it executes. I recommend you open the System Console in Blender (Window -> Toggle System Console) before running the script.

Prerequisites: Exported zone in glTF format with LanternExtractor with ExportZoneCharacterVariations setting set to true, then imported zone model into Blender.
Configuration required: Enter the shortname of the zone you imported into zone_name. Set the paths for lantern_export_folder, race_data_csv_location, and db_location. If you updated the LanternExtractor setting ExportGltfInGlbFormat to true, make sure the model_extension is set to "glb". Adjust the zone_scalar from the default 0.2 to match the ExportZoneScale if it was modified in the LanternExtractor settings.

eq_vertex_color_shader_edit.py

By default, glTF material shader will multiply vertex colors by the diffuse texture color. This script will adjust the material shaders in Blender to give vertex colors a slight emissive effect, which better approximates how they would look in game. If you find the effect too subtle or too intense, you can adjust the emission_strength accordingly and run the script again.

Prerequisites: Exported zone in glTF format with LanternExtractor with ExportGltfVertexColors setting set to true, then imported zone model into Blender.
Configuration required: None. emission_strength can be modified to adjust intensity of vertex color emission.

Clone this wiki locally