0

I am trying to name the nodes/faces in my obj file. So that after translation when I open the file in forge viewer I should be able to see the same names in model browser. I tried using 'o' parameter for object naming in my .obj file but still, I am seeing names like Node 1, Node 2 .... and so on.

This is my .obj file :

mtllib Classification.mat

v 0.000000 2.000000 2.000000
v 0.000000 0.000000 2.000000
v 2.000000 0.000000 2.000000
v 2.000000 2.000000 2.000000
v 0.000000 2.000000 0.000000
v 0.000000 0.000000 0.000000
v 2.000000 0.000000 0.000000
v 2.000000 2.000000 0.000000
# 8 vertices

usemtl Cone
o Cone
f 1 2 3 4
usemtl Cylinder
o Cylinder
f 8 7 6 5
usemtl plane
o plane
f 4 3 7 8
usemtl Sphere
o Sphere
f 5 1 4 8
usemtl Torus
o Torus
f 5 6 2 1
usemtl BSpline
o BSpline
f 2 6 7 3
# 6 elements

This is my Material file (Classification.mat):

newmtl Cone
Ka 1.00 1.00 1.00
Kd 0.3333333333333333 1.0 1.0
Killum 1
newmtl Cylinder
Ka 1.00 1.00 1.00
Kd 1.0 1.0 0.4980392156862745
Killum 1
newmtl plane
Ka 1.00 1.00 1.00
Kd 0.3333333333333333 0.6666666666666666 1.0
Killum 1
newmtl Sphere
Ka 1.00 1.00 1.00
Kd 1.0, 0.6666666666666666, 0.0
Killum 1
newmtl Torus
Ka 1.00 1.00 1.00
Kd 1.0, 0.3333333333333333, 1.0
Killum 1
newmtl BSpline
Ka 1.00 1.00 1.00
Kd 1.0, 0.0, 0.0
Killum 1

I am using a .zip for translation containing these two files. It would really great if anyone could help me out here ....

Thank You,

ketan shinde
  • 212
  • 2
  • 10

1 Answers1

1

Unfortunately, it does look like the translator ignores object and group names at the moment when creating the SVF for the Viewer from the OBJ file

I logged this behaviour as "OBJ >> SVF does not take into account object or group name", but not sure yet when this might be improved.

Sorry for the bad news.

Adam Nagy
  • 1,700
  • 1
  • 9
  • 14
  • I am working on a project that requires this behavior. It would be a great help if you could make it available sooner. :) – ketan shinde Mar 14 '19 at 13:24
  • It's supposed to have been fixed now – Adam Nagy May 23 '19 at 08:29
  • Hey, thanks for reply Adam and good to hear that, but it seems like there is a new issue with translation now. Just now I tried a translation of an obj file and I am seeing the same color applied for all objects and nodes even if I am providing it with appropriate materials :( can you please take a look at this, cause this is a big stopper for us. It would be great if this could be fixed ASAP. – ketan shinde May 24 '19 at 10:26
  • Hi, Adam. we were trying a few things on our side and here are our findings. Previously applying the material with "usemtl Cone" command was working just fine but now it does not. We have found a workaround for that by using "g Cone" command just after "usemtl Cone" command and then things work as expected. with this change, I am able to see object names and colors assigned to them as well. – ketan shinde May 28 '19 at 07:10
  • Looks like material doesn't apply if you don't provide object name or group name. For now, it seems I can continue my work with this change but this is something you should fix in the future. – ketan shinde May 28 '19 at 13:02