armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.23k stars 334 forks source link

Missing poligons on .obj files. #411

Closed RichardSepsi closed 4 years ago

RichardSepsi commented 4 years ago

This happens when I export .obj files from Cinema 4D and use them in ArmorPaint. There are always missing poligons and uv maps are also screwed up.

Armorpaint version : ArmorPaint v0.8 (2020-05-10) Os : Windows - Direct3D11 Gpu : Nvidia GeForce GTX 1650 Cpu : Intel Core i5-9300H

luboslenco commented 4 years ago

Please always throw in a sample .obj file for issues like these, so I can reproduce and fix it. Thanks!

RichardSepsi commented 4 years ago

https://drive.google.com/file/d/1weoenLIa4g9RjLDZF4H7A2QfRMfy0tOF/view?usp=sharing @luboslenco This is an example object made in Cinema 4D r19 where the bug is visible, but i also got glitches on a simple plane from Cinema 4D. 1

luboslenco commented 4 years ago

Thanks for the file! The missing faces appear to be caused by reversed normals & backface culling. Quick test in Blender with backface culling enabled:

cull copy

Reversing normals for the affected faces should resolve the issue.

There is a way to disable backface culling in ArmorPaint at Menu bar - Viewport - Cull Backfaces, however it may cause issues with lighting due to normals pointing in the opposite direction (and gives worse performance).

Related:

RichardSepsi commented 4 years ago

Yes, you are right. I didn´t notice inverted normals because in cinema 4D there is no backface culling. Thanks for your reply. But I still have one issue with uv maps. When I paint somewhere, it also paints somewhere else. On screenshot (below) there is a plane with a cone, I painted one edge of the plane with white color and it painted every edge of the plane. I tryed uv unwarping it with built in plugin in Armorpaint but it didn´t help. Is there any way to fix this?

1

luboslenco commented 4 years ago

When I paint somewhere, it also paints somewhere else.

My guess without seeing the file is that there are overlapping UVs - multiple faces share the same position on the uv map. It can be resolved by unwrapping the mesh so that each face occupies unique space on the uv map, or using multiple layers to paint objects with multiple uv sets like shown here.

Not sure about the unwrap plugin producing incorrect uv map, please feel welcome to open a new issue on that.

RichardSepsi commented 4 years ago

Yes, thanks. As you told it´s because of overlapping UVs. But the plugin seems like it´s not working at all. I tryed unwraping the mesh and I didn´t see any changes at first and the painting made it even worse. There is the object if you want to see it (link below), but it can be also seen on the chair that I sent and the uv unwrap plugin didn´t fix the issue. I think it´s better to test it on the chair, because the last shown object isn´t very good and it´s not finished. I exported it just to show the problem. When I unwraped the chair I got the same problem, but on different spots. Somewhere I couldn´t even paint at all. It looked like there were faces without uv map.

http://leteckaposta.cz/494987670

luboslenco commented 4 years ago

Thanks for info! I can reproduce and will investigate unwrap plugin issues, continuing at https://github.com/armory3d/armorpaint/issues/260.