Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
[fixed] Couldn't reproduce at importing completely an .obj file that has vertex color
10-26-2018, 10:20 PM (This post was last modified: 11-27-2018 02:31 PM by micheus.)
Post: #1
[fixed] Couldn't reproduce at importing completely an .obj file that has vertex color
Hi!
Wings3D couldn't reproduce at importing completely an "obj" file that has vertex color.

I wanted to handle colored voxel surfaces on Wings3D and goxel.
goxel is nice 3D voxel editor for modeling,coloring and rendering.
http://guillaumechereau.github.io/goxel/
It also can export an obj file with vertex color info.
So I import the obj file by Wings3D, but the Geometry object has no vertex color. Sad

Quote:For example of obj data(this case has vertex color)
#v x y z R G B
v -9 11 1 1.000000 0.000000 1.000000
Each R/G/B value range has (No color) 0.0 - 1.0 (Colored)

See a screenshot
https://gyazo.com/fdff691d8b1b67d55890691bb393be94

And I attached a sample file the obj data.
vtex_color_obj.txt (Rename to vtex_color.obj)

Best Regard Smile
--------------------------------------------------------
tkbd


Attached File(s)
.txt  vtex_color_obj.txt (Size: 5.95 KB / Downloads: 1)
Reply
10-27-2018, 09:26 PM
Post: #2
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
My gut feeling is that exporting vertex color to OBJ might not be the best idea.

From my readings ... the file format might be "flexible" enough to support it and some folks may have implemented vertex color into OBJ ... but that does not mean it is generally the best approach ...

Unless of course you want to write an OBJ importer of your own for Wings3d than can handle the extra information.

A lot of people and apps seem to deal with .PLY files having vertex color. This is how I last used to LOAD and SAVE vertex color and have my files go from MESHLAB to Wings and back and forth.

Good luck ... I'm just saying it sounds dicy to go with .OBJ and vertex color.
Reply
10-28-2018, 11:19 AM
Post: #3
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
ggaliens, Thanks you for thoughtful advice.
Fortunately,goxel can export ply format.
I'm going to use ply format for vertex colors.

Due to this,I noticed another problem here.
In Wings3D 2.1.7 for Mac, "Stanford ply (.ply) ..." doesn't appear in the file> import menu.
Also a module file(wpc_ply.beam) is missing too.

This module was added on Wings3D github repository in 2015.
However,it seems that had been missing since Wings3D v2.0 for Mac(2015 released).

So I realized why I overlooked to existing of ply formatBlush.
Ah...I want have to change the title of the thread "Couldn't select ply format in the import menu".

Thanks again!
-------------------
tkbd
Reply
10-28-2018, 04:00 PM (This post was last modified: 10-28-2018 04:32 PM by micheus.)
Post: #4
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
(10-26-2018 10:20 PM)tkbd Wrote:  Wings3D couldn't reproduce at importing completely an "obj" file that has vertex color.
I have already noticed that sometime ago. By tracking the code I notice Wings3D is just ignoring this information when importing the file.
I believe it should has had a reason for that - so, it's not really a bug, it's more like a limitation. Anyway, maybe we could to take a look on that further.

(10-28-2018 11:19 AM)tkbd Wrote:  Also a module file(wpc_ply.beam) is missing too.

This module was added on Wings3D github repository in 2015.
However,it seems that had been missing since Wings3D v2.0 for Mac(2015 released).
Sight! It's not available to the Windows version too (what is logical). I checked the Makefile into import_export folder and it doesn't include its source to be built.
Now we just need to know why it was removed from the make process. Smile

-----
In the Github I found the wpc_ply.erl file appears for the first time in Aug 2006 when Wings3D was imported to github.com. Interesting that even that age the import_export/Makefile didn't include the wpc_ply.erl. Rolleyes

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply
10-28-2018, 09:41 PM
Post: #5
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
You guys might find that any version that was with Wings3D at one time ... may still not support vertex color. If you find that to be the case ... I could share more code with both of you. MLAB has PLY with vertex color .... import and export.
Reply
10-29-2018, 08:38 AM
Post: #6
RE: Couldn't reproduce at importing completely an "obj" file that has vertex color.
We have never supported the PLY format it's there for debugging only, I don't know the status of that plugin.
Reply
11-02-2018, 10:47 AM
Post: #7
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
ggaliens,dgud,Thank you for clarifying the circumstances.
I compiled the old wpc_ply module which originally existed in Wings3D, but it didn't work well surely.

Next, I thought of using the ply importer of the Manifoldlab version.
(I tried run wings3d_v2.0.0.2018-01-15---10-41.mlab by WINE on my Mac,but failed
So I put install into copy of wpc_ply.beam file in directly from Manifoldab version)

And,I got ply files distributed on the internet and a ply format file from some 3D softwares.
Although two problems occurred, I was able to edit the ply data and explore the cause.

In the header of ply format file,there are known as described as follows.
  • property uchar int vertex_index
  • property uchar int vertex_indices <-- Manifoldlab ply importer only support this type.


Originally "vertex_indices" is correct, but the file of "vertex_index" is already circulating in the world.
However both of Goxel and Magicavoxel export ply file that using "vertex_index" keyword Sad

FYI:
http://www.pcl-users.org/PLY-Header-Conf...35755.html
https://github.com/PointCloudLibrary/pcl/pull/579

Also, even if there is no WHITESPACE in each line's end of the vertex lists, reading fails.

correct
Code:
-11.0 7.80000 0.00 255 255 255
1 2 3 4
0 4 5 6
:
incorrect (import failed)
Code:
-11.0 7.80000 0.00 255 255 255
1 2 3 4
0 4 5 6
:

So I edited the ply file data manually and it was readable with ply importer.
(Ply mesh imoporting is OK,but I couldn't make sure the reproduction of the vertex color yet.)
If Manifoldlab ply importer can accommodate these differences, there will be more ply files that can be read.
I hope this can be used by default on Wings 3D.

I will continue to the test of importing/exporting ply file. Smile
Reply
11-08-2018, 09:13 AM
Post: #8
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
I have found a couple of issues with the ply exporter with simple model.

Screen shot
https://gyazo.com/54a0381f8330b7daaf622a6c130fb10e

When re-import a ply file by mlab ply exporter
Code:
Dump written 2018-11-2_11-0
Version: 2.1.7
OS: Mac OS X (Darwin 16.7.0 x86_64)
GPU: Intel Inc. | Intel(R) Iris(TM) Pro Graphics 6200
Window: geom
Reason: function_clause

Short stack trace:
[{wings,command_1,2,[{file,"wings.erl"},{line,746}]},
{wings_develop,time_command,2,[{file,"wings_develop.erl"},{line,79}]},
{wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
{wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,651}]},
{wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]

Long stack trace:
[{wings,command_1,
     [{'EXIT',
          {function_clause,
              [{wpc_ply,convert_fs,
                   [[],
                    [vertex_index],
                    [[],
                     [[4,5,6,7]],
                     ["\b\t\n\v"],
                     [[12,13,14,15]],
                     [[16,17,18,19]],
                     [[20,21,22,23]],
                     [[24,25,26,27]],
                     [[28,29,30,31]],
                     [" !\"#"],
                     ["$%&'"],
                     ["()*+"],
                     [",-./"],
                     ["0123"],
                     ["4567"],
                     ["89:;"],
                     ["<=>?"],
                     ["@ABC"],
                     ["DEFG"],
                     ["HIJK"],
                     ["LMNO"],
                     ["PQRS"],
                     ["TUVW"],
                     ["XYZ["],
                     ["\\]^_"],
                     ["`abc"],
                     ["defg"],
                     ["hijk"],
                     ["lmno"],
                     ["pqrs"],
                     ["tuvw"],
                     ["xyz{"],
                     [[...]],
                     [...]|...],
                    true,[]],
                   [{file,"wpc_ply.erl"},{line,311}]},
               {wpc_ply,import_2,2,[{file,"wpc_ply.erl"},{line,239}]},
               {wpc_ply,import_1,2,[{file,"wpc_ply.erl"},{line,222}]},
               {wpc_ply,import,1,[{file,"wpc_ply.erl"},{line,214}]},
               {wpc_ply,'-import_fun/1-fun-0-',2,
                   [{file,"wpc_ply.erl"},{line,65}]},
               {wpa,do_import,3,[{file,"wpa.erl"},{line,129}]},
               {wpa,'-import/3-fun-0-',3,[{file,"wpa.erl"},{line,118}]},
               {wings_file,'-import_filename_1/2-fun-0-',3,
                   [{file,"wings_file.erl"},{line,67}]},
               {wings_develop,time_command,2,
                   [{file,"wings_develop.erl"},{line,79}]},
               {wings_plugin,command,3,[{file,"wings_plugin.erl"},{line,139}]},
               {wings,raw_command_1,3,[{file,"wings.erl"},{line,632}]},
               {wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
               {wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
               {wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
               {wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
               {wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
               {wings_wm,get_and_dispatch,0,
                   [{file,"wings_wm.erl"},{line,651}]},
               {wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
               {proc_lib,init_p_do_apply,3,
                   [{file,"proc_lib.erl"},{line,247}]}]}},
      {st,{0,nil},
          face,true,[],
          {0,nil},
          none,
          {1,
           {default,
               [{maps,[]},
                {opengl,
                    [{ambient,
                         {0.7898538076923077,0.8133333333333334,
                          0.6940444444444445,1.0}},
                     {diffuse,
                         {0.7898538076923077,0.8133333333333334,
                          0.6940444444444445,1.0}},
                     {emission,{0.0,0.0,0.0,1.0}},
                     {shininess,0.0},
                     {specular,{0.0,0.0,0.0,1.0}},
                     {vertex_colors,set}]}],
               nil,nil}},
          [],undefined,true,1,none,none,
          {0,{}},
          {1,{wings_shape,{no_folder,[{no_folder,{open,{0,nil}}}]},nil,nil}},
          ignore,none,none,
          {ignore,ignore},
          {'EXIT',
              {function_clause,
                  [{wpc_ply,convert_fs,
                       [[],
                        [vertex_index],
                        [[],
                         [[4,5,6,7]],
                         ["\b\t\n\v"],
                         [[12,13,14,15]],
                         [[16,17,18,19]],
                         [[20,21,22,23]],
                         [[24,25,26|...]],
                         [[28,29|...]],
                         [" !\"#"],
                         [[...]],
                         [...]|...],
                        true,[]],
                       [{file,"wpc_ply.erl"},{line,311}]},
                   {wpc_ply,import_2,2,[{file,"wpc_ply.erl"},{line,239}]},
                   {wpc_ply,import_1,2,[{file,"wpc_ply.erl"},{line,222}]},
                   {wpc_ply,import,1,[{file,"wpc_ply.erl"},{line,214}]},
                   {wpc_ply,'-import_fun/1-fun-0-',2,
                       [{file,"wpc_ply.erl"},{line,65}]},
                   {wpa,do_import,3,[{file,"wpa.erl"},{line,129}]},
                   {wpa,'-import/3-fun-0-',3,[{file,"wpa.erl"},{line,118}]},
                   {wings_file,'-import_filename_1/2-fun-0-',3,
                       [{file,"wings_file.erl"},{line,67}]},
                   {wings_develop,time_command,2,
                       [{file,"wings_develop.erl"},{line,79}]},
                   {wings_plugin,command,3,
                       [{file,"wings_plugin.erl"},{line,139}]},
                   {wings,raw_command_1,3,[{file,[...]},{line,...}]},
                   {wings,raw_command,4,[{file,...},{...}]},
                   {wings_wm,handle_event,3,[{...}|...]},
                   {wings_wm,send_event,2,[...]},
                   {wings_wm,do_dispatch,2,...},
                   {wings_wm,dispatch_event,...},
                   {wings_wm,...},
                   {...}|...]}},
          {[],[]},
          true,[]}],
     [{file,"wings.erl"},{line,746}]},
{wings_develop,time_command,2,[{file,"wings_develop.erl"},{line,79}]},
{wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
{wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,651}]},
{wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]


when load ply data by goxel
Code:
Dump written 2018-11-2_11-2
Version: 2.1.7
OS: Mac OS X (Darwin 16.7.0 x86_64)
GPU: Intel Inc. | Intel(R) Iris(TM) Pro Graphics 6200
Window: geom
Reason: function_clause

Short stack trace:
[{wings,command_1,2,[{file,"wings.erl"},{line,746}]},
{wings_develop,time_command,2,[{file,"wings_develop.erl"},{line,79}]},
{wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
{wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,651}]},
{wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]

Long stack trace:
[{wings,command_1,
     [{'EXIT',
          {function_clause,
              [{wpc_ply,convert_fs,
                   [[],
                    [vertex_index],
                    [[],
                     [[0,4,5,1]],
                     [[2,6,7,3]],
                     [[0,3,7,4]],
                     [[1,8,9,2]],
                     [[1,5,10,8]],
                     [[9,11,6,2]],
                     ["\b\f\r\t"],
                     [[8,10,14,12]],
                     [[13,15,11,9]],
                     [[12,16,17,13]],
                     [[12,14,18,16]],
                     [[17,19,15,13]],
                     [[16,18,19,17]],
                     [[4,20,21,5]],
                     [[6,22,23,7]],
                     [[4,7,23,20]],
                     [[24,25,26,27]],
                     [[28,29,30,31]],
                     [" !\"#"],
                     ["$%&'"],
                     [[14,40,41,18]],
                     [[19,42,43,15]],
                     [[18,41,42,19]],
                     [",-./"],
                     ["0123"],
                     [",10-"],
                     [".32/"],
                     ["-03."],
                     [",/21"],
                     [[20|...]],
                     [[...]],
                     [...]|...],
                    true,[]],
                   [{file,"wpc_ply.erl"},{line,311}]},
               {wpc_ply,import_2,2,[{file,"wpc_ply.erl"},{line,239}]},
               {wpc_ply,import_1,2,[{file,"wpc_ply.erl"},{line,222}]},
               {wpc_ply,import,1,[{file,"wpc_ply.erl"},{line,214}]},
               {wpc_ply,'-import_fun/1-fun-0-',2,
                   [{file,"wpc_ply.erl"},{line,65}]},
               {wpa,do_import,3,[{file,"wpa.erl"},{line,129}]},
               {wpa,'-import/3-fun-0-',3,[{file,"wpa.erl"},{line,118}]},
               {wings_file,'-import_filename_1/2-fun-0-',3,
                   [{file,"wings_file.erl"},{line,67}]},
               {wings_develop,time_command,2,
                   [{file,"wings_develop.erl"},{line,79}]},
               {wings_plugin,command,3,[{file,"wings_plugin.erl"},{line,139}]},
               {wings,raw_command_1,3,[{file,"wings.erl"},{line,632}]},
               {wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
               {wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
               {wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
               {wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
               {wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
               {wings_wm,get_and_dispatch,0,
                   [{file,"wings_wm.erl"},{line,651}]},
               {wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
               {proc_lib,init_p_do_apply,3,
                   [{file,"proc_lib.erl"},{line,247}]}]}},
      {st,{0,nil},
          face,true,[],
          {0,nil},
          none,
          {1,
           {default,
               [{maps,[]},
                {opengl,
                    [{ambient,
                         {0.7898538076923077,0.8133333333333334,
                          0.6940444444444445,1.0}},
                     {diffuse,
                         {0.7898538076923077,0.8133333333333334,
                          0.6940444444444445,1.0}},
                     {emission,{0.0,0.0,0.0,1.0}},
                     {shininess,0.0},
                     {specular,{0.0,0.0,0.0,1.0}},
                     {vertex_colors,set}]}],
               nil,nil}},
          [],undefined,true,1,none,none,
          {0,{}},
          {1,{wings_shape,{no_folder,[{no_folder,{open,{0,nil}}}]},nil,nil}},
          ignore,none,none,
          {ignore,ignore},
          {'EXIT',
              {function_clause,
                  [{wpc_ply,convert_fs,
                       [[],
                        [vertex_index],
                        [[],
                         [[0,4,5,1]],
                         [[2,6,7,3]],
                         [[0,3,7,4]],
                         [[1,8,9,2]],
                         [[1,5,10,8]],
                         [[9,11,6|...]],
                         ["\b\f\r\t"],
                         [[8|...]],
                         [[...]],
                         [...]|...],
                        true,[]],
                       [{file,"wpc_ply.erl"},{line,311}]},
                   {wpc_ply,import_2,2,[{file,"wpc_ply.erl"},{line,239}]},
                   {wpc_ply,import_1,2,[{file,"wpc_ply.erl"},{line,222}]},
                   {wpc_ply,import,1,[{file,"wpc_ply.erl"},{line,214}]},
                   {wpc_ply,'-import_fun/1-fun-0-',2,
                       [{file,"wpc_ply.erl"},{line,65}]},
                   {wpa,do_import,3,[{file,"wpa.erl"},{line,129}]},
                   {wpa,'-import/3-fun-0-',3,[{file,"wpa.erl"},{line,118}]},
                   {wings_file,'-import_filename_1/2-fun-0-',3,
                       [{file,"wings_file.erl"},{line,67}]},
                   {wings_develop,time_command,2,
                       [{file,"wings_develop.erl"},{line,79}]},
                   {wings_plugin,command,3,
                       [{file,"wings_plugin.erl"},{line,139}]},
                   {wings,raw_command_1,3,[{file,[...]},{line,...}]},
                   {wings,raw_command,4,[{file,...},{...}]},
                   {wings_wm,handle_event,3,[{...}|...]},
                   {wings_wm,send_event,2,[...]},
                   {wings_wm,do_dispatch,2,...},
                   {wings_wm,dispatch_event,...},
                   {wings_wm,...},
                   {...}|...]}},
          {[],[]},
          true,[]}],
     [{file,"wings.erl"},{line,746}]},
{wings_develop,time_command,2,[{file,"wings_develop.erl"},{line,79}]},
{wings,raw_command,4,[{file,"wings.erl"},{line,629}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,973}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,939}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,840}]},
{wings_wm,dispatch_event,1,[{file,"wings_wm.erl"},{line,747}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,651}]},
{wings,init_part2,2,[{file,"wings.erl"},{line,104}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]
Reply
11-20-2018, 11:41 AM
Post: #9
RE: Couldn't reproduce at importing completely an "obj" file that has vertex...
JFYI, the '.ply' importer was added to Wings3D project and the issues I found were fixed.
I caught a sample file from the internet; imported it to MeshLab and painted it; then I imported it in Wings3D:


Now, the vertex color should be properly imported to Wings3D by any importer that handles it.

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply


Forum Jump:


User(s) browsing this thread: 1 Guest(s)