Color handling in obj files

This topic has been viewed 3895 times and has 2 replies
Thread status: Active
Looking for a particular 3D model or texture? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
Folini
Posts: 3
Joined: Mon Dec 21, 2020 9:18 am
Country: Italia

Color handling in obj files

Post by Folini »

Importing obj files with colors on vertex breaks import wizard.
Is it planned to fix this issue?
specification says:
If a vertex line contains 3 values then they are interpretted as (x,y,z), if there are 4 values then they correspond to (x,y,z,w), if there are 6 values then they correspond to (x,y,z,r,g,b)

Basic fix could be to ignore last 3 values in case of a six values line.
Obviously the best would be to handle RGB colors.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Color handling in obj files

Post by Puybaret »

I wonder where you found these specifications. The ones I have used for years don't mention this feature.
Emmanuel Puybaret, Sweet Home 3D creator
Folini
Posts: 3
Joined: Mon Dec 21, 2020 9:18 am
Country: Italia

Re: Color handling in obj files

Post by Folini »

It's on wikipedia



Also on following site you can find infos with a mention (on third link) to the citation above

http://paulbourke.net/dataformats/obj/

As a programmer I think it's really easy to implement the first workaround... When parsing a 'v' record after splitting the line by commas, if more than 3 values are found ignore them intead of return an error
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest