Import with color

I have seen how you can import colors to BS in prior post.

But I don’t see how to get to it.
Can someone give me a clue? I am wanting to go from SolidWorks to BS.
Closest I have come is exporting a 3mf, the preview shows face color. (that is just a preview raster image when saved from SW) Does not mean color data is saved into 3D data.

I know how to paint colors in BS. It would be so much easier to paint in the parametric file. Especially for iterating.

Thanks for any suggestions.

Hi Robert,

I don’t know about SW, but with Fusion or FreeCAD the colors are dictated by the material applied to an object/face. Also, I’m not sure about the .3MF color import because that is new in Studio v2.5 (and I haven’t updated yet), so it may act differently, but here is an example with using a .OBJ export, which has been supported for longer (the example is somewhat contrived since it’s an assembly, but I had it handy).

And in case you haven’t seen these pages yet:
https://wiki.bambulab.com/en/software/bambu-studio/import_obj (not incredibly informative)
https://wiki.bambulab.com/en/bambu-studio/Standard-3MF-File-Color-Parsing (some more details about what kind of input is expected)

There is apparently a bug/limitation in v2.5 that the .3MF colors are only being applied to faces, not the complete solids. Don’t know if that matters to you. The OBJ version does color complete solids, from what I’ve seen. Though in some cases it makes some odd choices… :sweat_smile:

The red sleeve is hollow, so I’m not sure why it’s filling that in, and the inside of the yellow and black parts aren’t shaped like that, obviously (they slip around the sleeve). But as I said this is a contrived example and I didn’t spend any time trying to adjust it.

-Max

If I understand you correctly, your goal is to import a model from CAD (or any other format that supports color) directly into Bambu Studio with the color information preserved.

Based on my testing, the only practical export paths from CAD that carry color into Bambu Studio are OBJ and 3MF. At least these are the only ones so far that I have been able to get working.

OBJ supports material definitions via an accompanying MTL file, which includes color. However, like STL, OBJ is a mesh format. Once you export to OBJ, you lose native CAD geometry. If you later try to re-import that file back into CAD, you will lose parametric and dimensional data and would need to reconstruct geometry from the mesh, which is messy and generally undesirable.

Below are concrete examples, with screenshots showing exactly what happens.

  1. Onshape (faces colored) → OBJ → Import into Bambu Studio
    This works reliably when exporting from Onshape.


    Upon importing the OBJ file into Bambu Studio, you are presented with an OBJ-specific import dialog. This dialog does not appear for other file formats.

    After import, the face colors are preserved correctly, as shown here:

  2. Onshape → 3MF → Import into Bambu Studio
    This also works, but only to a degree.



    The 3MF file imports into Bambu Studio and some color information is retained, but the behavior is less consistent than OBJ. Not all color assignments map cleanly or predictably in every case, depending on how the 3MF is exported.

Bottom Line:

  • OBJ reliably preserves face-level color in Bambu Studio, at the cost of converting the model to a mesh format.
  • 3MF can preserve color, but the results are more limited and less predictable.
  • Neither format preserves native CAD parametrics when round-tripping back into CAD.
  • This was only tested in OnShape, when I tested it in F360 and FreeCAD, I could not get it to work the same way but in all fairness, I did not do exhaustive testing once I found a workaround in OnShape, it may be possible with other CAD programs. Blender while not exactly CAD, is one that comes to mind although I did not test it.

The screenshots above are included as direct proof of how I got each workflow to work in practice. I would be eager to hear if others found better ways.

The challenge remains that even when you import the color, the slicer colors still have to be managed based on what filaments are loaded and all the nuances that go with managing AMS vs slicer colors.

1 Like

thanks for the reply’s. Unfortunately all my testing has not worked from SolidWorks.

Out of the box SW does not output an OBJ file. There are plugins available that give that capability.
I have yet to test that.

Ideally I want BS to use the color import on Step files. I know the format includes color data (ver 214 does). As long as the colors are defined, It should be reloadable. Making it work for iterating.

If I find a way I will post.

A work around is applying the colors to objects in BS. The limitation is the whole object needs to be the same color. The object can’t be split to be reloadable.

Does/can SW export 3MF format? With color maybe? Have you tried it?

For example Fusion exports 3MF with object colors, while FreeCAD doesn’t seem to (or a setting I haven’t found yet).

With the older version of Bambu Studio, 2.4, object color information in 3MF is actually preserved, there’s just no UI for assigning colors. It seems to assign colors/filaments to objects sequentially based on the filaments available in the current project. But it does recognize that the objects have different colors, for what it’s worth, and assigns a color to the whole part, not just painting them like with .OBJ import and new BS v2.5. And 3MF lets you keep parts of a model separated and named, similar to STEP. And re-loadable for iteration, to some extent anyway (but still lots of times not really because some internal alignments get screwed up).

I did some more experimenting with .OBJ format, on a real project I want to print with 2 colors, and it was actually all FUBAR once brought into the slicer, similar to my screenshot above with the colors all mixed up internally. Only way I found to actually separate the colors when printing was to break the parts out into their own objects, which isn’t always desirable. And .obj in general made iteration a bigger pain than it already is.

-Max

EDIT: A workaround for the current BS v2.5 behavior with 3MF files and colors being applied as surface paint was posted here (I haven’t tried it myself): Solid body colors replaced by surface painting. Please let us turn this off! - #7 by 3dEd

Yes SW exports 3mf files. But have not got color into BS. tried face color and body color. had not tried some of the other options. If body does not work, feature will not.

When I output a 3mf from SW the preview shows the face color. But that I assume is just the PNG within the 3mf. I don’t know how to check if the 3mf file has color assigned, but not interpreted by BS. Maybe the color is stripped on export, and the preview is not accurate.

Should try Orca slicer to see if it gets the color. If it does, it would be BS that is not playing nice. Could be it is there but not recognized.

I compared the 3MF files from Fusion and FreeCAD and the color difference was pretty obvious. In the .3mf → 3D → 3dmodel.model XML files of each archive, the Fusion version has a block declaring colors, just after the <resources> tag, while the FreeCAD version does not.

	<resources>
		<m:colorgroup id="2">
			<m:color color="#005904FF"/>
		</m:colorgroup>
		<m:colorgroup id="4">
			<m:color color="#303B96FF"/>
		</m:colorgroup>
   ... etc

Then later the id of each group is assigned to an object definition as pid attribute:

<object id="3" name="Sleeve" type="model" p:UUID="73f69490-4990-404b-ada5-a396989e0793" pid="4" pindex="0">

It seems the “Materials & Properties” extension was officially added to the 3MF spec less than a year ago, so I guess some software has yet to catch up.
https://3mf.io/spec/

Another difference is that Fusion maintains the names of the exported bodies while FC does not.

-Max

PS. Also in the Fusion export the texture extension is declared in the [Content_Types].xml file at the root of the archive:

<Types ...>
  ...
  <Default Extension="texture" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodeltexture"/>
</Types>

I just stumbled upon this post. In SolidWorks, when you go to save as a 3mf, you need to click ‘Options…’, then select the check box to ‘Include appearances’. This will export the appearance colors.