Skip to content

Commit c972cc6

Browse files
committed
Patch 2.2.9 (#89)
* Resource Import: Fix MDL import from the gameinfo path * MDL: Fix collision import * Patch v2.2.9
1 parent a225524 commit c972cc6

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
release:
1414
if: github.event_name == 'push' || (github.event.pull_request.merged == true)
1515
runs-on: ubuntu-latest
16+
permissions: write-all
1617

1718
steps:
1819
- name: Checkout repository

addons/godotvmf/godotmdl/mdl_combiner.gd

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,8 @@ func generate_collision():
164164

165165
var static_body: StaticBody3D = StaticBody3D.new();
166166
var collision: CollisionShape3D = CollisionShape3D.new();
167+
var shape: ConvexPolygonShape3D = ConvexPolygonShape3D.new();
167168

168-
# FIXME: Use ConvexPolygonShape3D instead of ConcavePolygonShape3D
169-
# but if it used then for some models it triggers an error
170-
# "Failed to build convex hull godot"
171-
var shape: ConcavePolygonShape3D = ConcavePolygonShape3D.new();
172-
173-
collision.shape = shape;
174169
collision.name = "collision_" + str(surface_index) + "_" + str(solid_index);
175170
static_body.name = "solid_" + str(surface_index) + "_" + str(solid_index);
176171
static_body.basis *= additional_basis;
@@ -184,7 +179,9 @@ func generate_collision():
184179

185180
vertices.append_array([v1, v2, v3]);
186181

187-
collision.shape.set_faces(PackedVector3Array(vertices));
182+
shape.points = PackedVector3Array(vertices);
183+
collision.shape = shape;
184+
188185
if skeleton and skeleton.find_bone("static_body") == -1:
189186
var bone_attachment: BoneAttachment3D = BoneAttachment3D.new();
190187
bone_attachment.name = "bone_attachment_" + str(surface_index) + "_" + str(solid_index);

addons/godotvmf/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="GodotVMF"
44
description="Allows use VMF files in Godot"
55
author="H2xDev"
6-
version="2.2.8"
6+
version="2.2.9"
77
script="godotvmf.gd"

addons/godotvmf/src/vmf_config.gd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ class ImportConfig:
9797
## If specified, the importer will use this preset for the navigation mesh
9898
var navigation_mesh_preset: String = ProjectSettings.get_setting("godot_vmf/import/navigation_mesh_preset", "");
9999

100-
static var gameinfo_path: String = ProjectSettings.get_setting("godot_vmf/import/gameinfo_path", "res://");
100+
var gameinfo_path: String = ProjectSettings.get_setting("godot_vmf/import/gameinfo_path", "res://");
101+
102+
## NOTE: Support previous version of this config where this field wasn't a part of ImportConfig
103+
static var gameinfo_path: String:
104+
get: return ProjectSettings.get_setting("godot_vmf/import/gameinfo_path", "res://");
101105

102106
static var models: ModelsConfig:
103107
get:

addons/godotvmf/src/vmf_resource_manager.gd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static func for_resource_import() -> void:
3131
## Returns true if any resources were imported
3232
static func import_models(vmf_structure: VMFStructure) -> bool:
3333
if not VMFConfig.models.import: return false;
34-
if not "entity" in vmf_structure: return false;
34+
if vmf_structure.entities.size() == 0: return false;
3535

36-
for entity in vmf_structure.entity:
37-
if not "model" in entity: continue;
36+
for entity in vmf_structure.entities:
37+
if not "model" in entity.data: continue;
3838
if entity.classname != "prop_static": continue;
3939

40-
var model_path = entity.get("model", "").to_lower().get_basename();
40+
var model_path = entity.data.get("model", "").to_lower().get_basename();
4141
if not model_path: continue;
4242

4343
var mdl_path = VMFUtils.normalize_path(VMFConfig.gameinfo_path + "/" + model_path + ".mdl");

0 commit comments

Comments
 (0)