yeicor-3d/ocp-action

GLTF rotation

Closed this issue · 1 comments

First off, thanks again for your great GH action for building these models. I wanted to provide my fix for GLTF rotation so that a model's z-up becomes y-up in the exported GLTF. Might be nice to expose as a config option, although the easiest way to implement would be global (for all models in that repo) instead of per-model.

https://github.com/jdegenstein/parts-build123d/blob/main/examples/TTT/__ocp_action_api_OVERRIDE.py

    # Convert Z-up to Y-up (more common?)
    # obj = obj.rotateAboutCenter((1, 0, 0), -90) # CQ version (applies to Workplane type)
    obj = obj.rotate((0,0,0),(1,0,0),-90) # CQ Shape rotate method

Thanks for your contribution. I added this change under the option y-up, which defaults to false. It is published in v3.1.2. If anyone wants to use a different up vector for each model of a repo, they should rotate it manually before calling show_object.