Question

OpenSceneGraph writer disregards FME_color

  • 3 August 2018
  • 2 replies
  • 4 views

Badge

I'm writing line and polygon data to an OSGB-file and need color info to be preserved and written correctly. At the moment I can't seem to get a written file with color data in it. Everything else however works and is represented as expected.

Am I missing something in order to get the writer to write color data? As textures and diffuse color values are supported according to the quick facts page I figured that simple color values would be as well, but maybe this isn't the case?


2 replies

Badge +7

Hi @andrejacquet, thanks for the question!

 

 

Out of curiosity how are you currently setting the color on your lines and polygons in FME? Are you able to transform these features into 3D surfaces to suit your needs or do you need them to be written as lines and polygons?

 

As far as I can tell (doing some ongoing investigation) simple colors are in fact not supported on lines and polygons written by the OSG writer. Diffuse color and texture are appearance attributes which only apply to 3D surfaces.

 

 

Nathan

Badge

I'm transforming .DWG files to .OSGB as an automation measure in a project, so the line colors are extracted from the layer color in the .DWG file. And yes I need lines to be kept as lines, polygons can be transformed to something else that looks the same so 3D Surfaces would work there.

My end goal can be described as keeping 2D information as similar as the original file as possible, while 3D data will be both preserved and automatically stylized with textures in different output files. So if the OSG Writer in FME doesn't support writing color data to geometry I guess I'll have to make a workaround.

Writing the files to an intermediary as .DXF and running it through osgconv seems to solve the issue of getting color data onto line geometry. So utilizing SystemCaller to use osgconv through cmd should solve my issue as long as I don't get Cadfiles containing both 2D and 3D data. (In that case I'll have to split the data into 2 output files) Which is a bit of a botched approach, but it should work.

Btw, writing the files to .OSGT instead and reading the written files I noticed that it seems as if FME uses osgconv internally. (Both .OSGT files written by FME and osgconv creates the same metadata in file) If that is the case, how hard would it be to expand the functionality of the OSG Writer to also write color data? Seeing as the backend converter already has the ability and can do it using a different intermediary.

Reply