Convert .stp assembly to .dae with colors per face

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Den
Posts: 1
Joined: Thu Oct 14, 2021 12:16 pm

Convert .stp assembly to .dae with colors per face

Post by Den »

Greetings!
I need to convert a few dozen step assemblies to collada file format and keep their unique face colors. I've checked the "importDae.py" file and used it to build my automation script. All models were exported successfully, except their faces with unique colours, of course. It is also said inside .dae export method that support per-face colors is not yet implemented. Therefore I tried a method I used before to work with single parts:

import step file to FreeCAD -> Create a mesh with all colors from the model and export it to .obj file -> Import .obj to Blender -> Export .dae file.

I've tried to iterate this workflow for each solid part and then connect them inside the Blender. In this case, all geometry and colors were exported successfully to .dae. Unfortunately, the relations between coordinate frames of parts and their scale to each other was lost. I would be glad to have a piece of advice on how I can successfully convert from step to .dae keeping all face colours present?
For now, I have a few thoughts on that:
1) Try to modify the export method in importDae.py
2) Somehow modify coordinate frames of models during the .obj converting method.

Here is also an image of one of the models:
Image

Many thanks for considering my question.
Denis
Post Reply