OverviewFilesCommitsIssuesDocsReleasesPeers

iqm-blender-importer commits / 4044afb

Fix operator properties: use annotation syntax (Blender 5.x)
Blender 2.9x+ silently ignores assignment-style operator properties when a base class (ImportHelper) already declares annotations. files/directory/bone_axis never registered, so multi-file selection crashed (_PropertyDeferred not iterable) and Bone Axis was stuck on Preserve. Switch all operator props to annotation syntax. Verified: selecting all clip files imports 21 actions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4044afbef516874a8a7d6d87888172984a3f028c
by plankatron <fleeky@gmail.com> · 2026-06-23T23:51:03.000Z

Changed files (2) +19 -14

README.md +11 -9
……@@ -39,15 +39,17 @@ Self-contained files import their embedded animations automatically. Models
3939that split clips into separate **skeleton-less** files (OctaForge does this —
4040see `iqm_src/animation/`) are applied onto an existing armature:
4141
42- **One step:** in the import dialog, shift-select the base model **and** the
43 clips together (e.g. `player.iqm` + everything in `animation/`). Models are
44 imported first, then each clip is attached to the new armature as its own
45 **action** (browse them in the Action Editor / NLA).
46- **Or sequentially:** import `player.iqm` first, then import the clip files —
47 they attach to the armature already in the scene.
48
49The base model (the one with the skeleton) must be importable alongside the
50clips; the importer matches them by bone count.
421. Import the base model (`player.iqm`) first — this creates the armature.
432. Then **File ▸ Import** again and **shift-select all the clips** in the
44 `animation/` folder. Each becomes its own **action** (browse them in the
45 Action Editor / NLA).
46
47(If a model keeps its clips in the *same* folder as the base mesh, you can
48shift-select the model and the clips together in one go — models are always
49imported before clips.)
50
51The base model must already be imported (armature in the scene) and its `.iqm`
52must be reachable from the clips; the importer matches them by bone count.
5153
5254> After editing the add-on file, restart Blender (or disable/re-enable it) so
5355> the new code is reloaded — Blender caches enabled add-ons.
iqe_import.py +8 -5
……@@ -1175,14 +1175,17 @@ class ImportIQM(bpy.types.Operator, ImportHelper):
11751175 bl_label = "Import IQM or IQE"
11761176
11771177 filename_ext = ".iqe, .iqm"
1178 filter_glob = StringProperty(default="*.iq[em]", options={'HIDDEN'})
1179 filepath = StringProperty(name="File Path", maxlen=1024, default="")
1178 # NOTE: properties MUST use annotation syntax (name: Property(...)). Since
1179 # Blender 2.9x, assignment-style operator properties are silently ignored
1180 # when a base class (here ImportHelper) already declares annotations.
1181 filter_glob: StringProperty(default="*.iq[em]", options={'HIDDEN'})
11801182 # Allow selecting several files at once (e.g. a model + its animation clips);
11811183 # models are imported first so clips can attach to the new armature.
1182 files = CollectionProperty(name="Files", type=bpy.types.OperatorFileListElement)
1183 directory = StringProperty(subtype='DIR_PATH')
1184 files: CollectionProperty(name="Files", type=bpy.types.OperatorFileListElement,
1185 options={'HIDDEN', 'SKIP_SAVE'})
1186 directory: StringProperty(subtype='DIR_PATH', options={'HIDDEN', 'SKIP_SAVE'})
11841187
1185 bone_axis = EnumProperty(name="Bone Axis",
1188 bone_axis: EnumProperty(name="Bone Axis",
11861189 description="Flip bones to extend along the Y axis",
11871190 items=[
11881191 ('Y', "Preserve", ""),