Skip to content

content: #297/#298 fixes did not reach the pipeline template, ai-mesh-cleanup skill, scale rule, or export-preset-axis example #326

Description

@TMHSDigital

Why it matters

PR #309 fixed the Unreal location-scale bug (#297) and the per-object transform_apply loop with an ineffective selected_objects override (#298) in the snippets only. The same defects remain in four other places, including the shipped pipeline template and the skill/rule an AI reads before writing this code. The Unreal one produces wrong output: centimeter geometry on node translations still in meters.

Evidence

  • templates/ai-asset-pipeline-template/pipeline.py:275-282 (Unreal path) scales obj.scale ×100 but never obj.location. origin_to_base() (~line 129) always moves location.z off zero, so every exported LOD is affected.
  • templates/ai-asset-pipeline-template/pipeline.py:236-241 apply_selected_mesh_transforms() still loops apply_object_transform(obj) per object.
  • skills/ai-mesh-cleanup/SKILL.md:50-55 overrides selected_objects=[obj] (does not narrow transform_apply, per snippets: export presets loop transform_apply per object; selected_objects override does not narrow the operator #298) and calls it in a loop (lines ~110-112).
  • rules/validate-imported-mesh-scale.mdc "required pattern" loops transform_apply per object — violating the repo's own prefer-data-over-ops-in-loops rule.
  • examples/export-preset-axis/export_preset_axis.py:305-314:
    for obj in list(bpy.context.selected_objects):
        ...
        with bpy.context.temp_override(object=obj, active_object=obj, selected_objects=[obj]):
            bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
    The fixed snippets/export_preset_unity.py:17-27 documents why this is wrong.

Suggested approach

Port the snippet bodies: scale location with scale for Unreal; one transform_apply call with a selected_editable_objects override. Re-prove the export-preset-axis falsifier. Consider a grep check for selected_objects=[ inside temp_override near transform_apply.

Done when

All four locations match the snippet contract; smoke passes on 5.2 and 4.5; grep -rn "selected_objects=\[obj\]" skills rules templates examples returns no transform_apply sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions