Thank you for the reply.

I think it would be better if I can tell if the input mesh contains face color or not from code. Something like "mesh->is_face_color_valid()."

Another way is to initialize all face with a default color (Color(0,0,0,0), for example) if face colors are not available from the given .obj.
This can only be done inside FileOBJ plugin because user does not know whether face colors are available or not and may overwrite the (possibly correct) result read by FileOBJ plugin.
The current implementation only skips them as you mentioned so they may contain random meaningless data which I don't know if they are the correct colors or not.


MBRSL

2015-05-21 20:30 GMT+08:00 Jan Möbius <moebius@cs.rwth-aachen.de>:
Hi,

has_face_color() is just returning, if the OpenMesh has a face color
property. OpenFlipper uses face colors in several plugins, so the
property will always be added automatically and not depending on the
loaded file.

Maybe we could introduce some information structure that provides
information about the files which are loaded.

Which box do you want to uncheck? Load face colors in the obj reader
could be always on and will just skip reading face colors if they don't
exist.

Best,
Jan Möbius



On 19.05.2015 11:10, MBRSL . wrote:
> Hello,
>
> I'm using .obj for OpenFlipper.
> Is there any way to tell if a .obj contains face color or not from code?
>
> I found that if I checked "Load Face Colors" in the popup options,
> has_face_colors() will always return true no matter this .obj contains
> face color or not.
> The resulting color is invalid if this .obj does not contains face
> color. However, I can't tell this from my code.
>
> I would like to run a batch for several .objs that some of them contain
> face color and some others does not so I can't unchecked this option one
> by one manualy.
>
> Thanks,
> MBRSL
>
>
> _______________________________________________
> Openflipper mailing list
> Openflipper@lists.rwth-aachen.de
> http://mailman.rwth-aachen.de/mailman/listinfo/openflipper
>


--
Dipl.Inform. Jan Möbius
Department of Computer Science VIII
Aachen University of Technology (RWTH)
Ahornstrasse 55, 52074 Aachen, Germany

Phone   ++49 (0)241 80-21802
Fax     ++49 (0)241 80-22899
mailto:moebius@cs.rwth-aachen.de
http://www.rwth-graphics.de
_______________________________________________
Openflipper mailing list
Openflipper@lists.rwth-aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/openflipper