Solved

Problem that material is not added to some obj when converting ifc

  • 5 December 2022
  • 7 replies
  • 50 views

You are trying to parse the IFC file into Obj and metadata through your company's FME Desktop.

I don't know why, but there is a problem that materials are not added to some objs. Please help in this regard.

The attached file is the workbench file used at this time.

​Regards,

Bongsup Kim​

icon

Best answer by mdeabreu 7 December 2022, 19:47

View original

7 replies

Userlevel 3
Badge +13

Hello @bskim​, the IFC Reader doesn't support textures yet. I think the textures need to be brought into FME Workbench seperately and applied in the workspace before writing out to OBJ. Try using the AppearanceSetter to add textures to your OBJ model. Bet of luck, Kailin.

Thank you Kailin.

If I convert the 02_1.ifc file by unzipping the 02_1.zip file below, materials are still not added to some obj files. I don't know the cause.

Userlevel 3
Badge +13

Thank you Kailin.

If I convert the 02_1.ifc file by unzipping the 02_1.zip file below, materials are still not added to some obj files. I don't know the cause.

Hello @bskim​, thanks for sharing your input dataset. I notice you're using a fanout in the OBJ Writer. I can't quite get the materials written properly while using fanout, but if we write to one model, all materials are translated properly:

 

imageI'm almost certian this is a bug. Can you use this workspace to workaround this for the time being? In the meantime, please let me know if you are still not seeing materials written. Initial findings are no longer applicable after further investigation! Best, Kailin

thank you for your quick reply.

 

When converting to OBJ through FME, a group tag was not added, so an OBJ file had to be created for each IFC property. In other words, it was impossible to know detailed properties when picking by exporting as a single OBJ file.

 

Also, material information is not normally included even if it is exported as a single OBJ file. Typically

The material property of the Mesh with ID "0MqJJVOvz9EAAqebgegn0o" is

Kd 1 1 0, Ks 0.5 0.5 0.5, Ns 64, but there is no material in the conversion through FME. (Faces without material properties are rendered with previous material values.)

 

The attached file is the result of conversion from other tools.

Good morning bskim,

 

I'm one of the developers here at Safe and I've been working with Kailin to try and help out.

 

Group Tags

> When converting to OBJ through FME, a group tag was not added, so an OBJ file had to be created for each IFC property. In other words, it was impossible to know detailed properties when picking by exporting as a single OBJ file.

 

From your attached workspace and data I believe you were trying to keep one of your attributes (`Tag` or `GlobalId`) this can be done by creating a geometry trait for each piece of geometry called `obj_group`. This can be done by creating an attribute called `obj_group` and then using a GeometryPropertySetter to convert the attribute into a geometry trait.

Please note that in our testing we found that if a Mesh contains the trait `obj_group` it is not preserved correctly, I've created a ticket to fix this. Until then, you can use a GeometryCoercer to convert your Mesh geometries into CompositeMesh geometries and the Group will be preserved successfully.

 

Materials

Kailin and I looked into your use of fanout (to preserve group tags) and preserving material information. After some more investigations we found that materials are actually being preserved, in the attached screenshot you can see a bright green feature and the resulting OBJ showing that we are preserving materials in some cases.

image.png> The material property of the Mesh with ID "0MqJJVOvz9EAAqebgegn0o" is

Kd 1 1 0, Ks 0.5 0.5 0.5, Ns 64, but there is no material in the conversion through FME. (Faces without material properties are rendered with previous material values.)

imageWhen we look at the mentioned feature inside the workspace prior to arriving at the writer, we can see that it has an appearance of `<inherited_or_default_appearance>`. This is how FME says that there isn't an appearance on that feature. The original IFC file didn't have an appearance for that feature. As such the OBJ writer has to decide what to do in that case. Since there was no material on the feature, the OBJ writer will not set a material on the resulting output. As such when you read that specific OBJ file back either in FME or another inspector app you will see the default material (usually grey as seen here).

imageIf you would like this behaviour to change you can create an appearance with your specified settings, and apply that material to all features that have a default appearance.

Thanks for letting me know why the material is not included.

Good luck.

Userlevel 3
Badge +13

Hello @bskim, happy to inform you this issue (FMEENGINE-75716) has been resolved in the newest 24.1 beta (Build 24541+). You can access the beta here, on the FME Downloads page. Please let me know if you have any concerns about the fix. Happy to help, Kailin.

Reply