Import WaveFront(.obj) ignores the parameter of 'Smooth Groups'. #44947

Closed
opened 2015-06-04 07:38:13 +02:00 by perfection cat · 20 comments

System Information
windows XP/SP3 32bits

Blender Version
Broken: version 2.74 (sub 5), branch b'master', commit date b'2015-06-03' b'19:19', hash b'896f08b', b'Release'
Worked: unknown

Short description of error
Import WaveFront(.obj) ignores the parameter of 'Smooth Groups'.
Exact steps for others to reproduce the error
The sharp is always set regardless of setting of 'Smooth Groups' for edge.
Cube.7z
The material which is not defined by mtl file is produced.

Import attached .obj file

**System Information** windows XP/SP3 32bits **Blender Version** Broken: version 2.74 (sub 5), branch b'master', commit date b'2015-06-03' b'19:19', hash b'896f08b', b'Release' Worked: unknown **Short description of error** Import WaveFront(.obj) ignores the parameter of 'Smooth Groups'. **Exact steps for others to reproduce the error** The sharp is always set regardless of setting of 'Smooth Groups' for edge. [Cube.7z](https://archive.blender.org/developer/F184595/Cube.7z) The material which is not defined by mtl file is produced. Import attached .obj file
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @sindra1961

Added subscriber: @sindra1961

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2015-06-04 13:56:21 +02:00

Thanks for the report, but no bug here. There is no smoothgroup in this .obj, however it has custom normals defined, which get imported (which also sets sharp edges as needed).

Thanks for the report, but no bug here. There is no smoothgroup in this .obj, however it has custom normals defined, which get imported (which also sets sharp edges as needed).
Author

I see.
Sharp was not set when I changed a parameter to export.
2MaterialsCube.blend.png
However, empty material increases when I import it though only two material is registered.
screen.png
Is this not a bug, too?
2MaterialsCube.7z
The third material is not included in .obj/.mtl file.

I see. Sharp was not set when I changed a parameter to export. ![2MaterialsCube.blend.png](https://archive.blender.org/developer/F185146/2MaterialsCube.blend.png) However, empty material increases when I import it though only two material is registered. ![screen.png](https://archive.blender.org/developer/F185148/screen.png) Is this not a bug, too? [2MaterialsCube.7z](https://archive.blender.org/developer/F185150/2MaterialsCube.7z) The third material is not included in .obj/.mtl file.
Author

I think that unique_materials[None] is added to material if I check import_obj.py.

I think that unique_materials[None] is added to material if I check import_obj.py.
Author

I revised a script so that the number of imported material accorded.
I attach the file which I used for a test.
ImportObj.7z
Test contents.

  • Plural material is included. (2MaterialsCube.obj)
  • Material is not included. (NonMaterials.obj)
  • Material was not included, but material was appointed when it was exported. (untitled.obj)
  • Material is included, but there is not mtl file.
    I do not test it about other cases.
    In the case of at least above, this worked well.
I revised a script so that the number of imported material accorded. I attach the file which I used for a test. [ImportObj.7z](https://archive.blender.org/developer/F185228/ImportObj.7z) Test contents. - Plural material is included. (2MaterialsCube.obj) - Material is not included. (NonMaterials.obj) - Material was not included, but material was appointed when it was exported. (untitled.obj) - Material is included, but there is not mtl file. I do not test it about other cases. In the case of at least above, this worked well.

This issue was referenced by d961b98bbb

This issue was referenced by d961b98bbb5c5539c69d96f08caeee97e3333c79

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'
Author

I confirmed that it acted about four items that I showed.

version 2.74 (sub 5), branch b'master', commit date b'2015-06-06' b'20:12', hash b'5aade17', b'Release'

However, a problem seems to be left about Exportor.
Only two are output among three vertex group which were defined when you export it with an attached file.
3ColorsGroups.blend
Group is managed in the definition of the obj file as face.
I think that edge is managed as a special case of face.
The exporter uses data of vertex included in face to find vertex group to belong to of face.
However, vertex is shared in plural face.
It is necessary to check whether all vertex included in face belongs to group if exporter finds vertex group to belong to of face.
The current exporter does not confirm it.

I remodeled this export_obj.py not to output unnecessary material.
However, I remodel nothing about the problem that I showed here.
export_obj.py

I confirmed that it acted about four items that I showed. version 2.74 (sub 5), branch b'master', commit date b'2015-06-06' b'20:12', hash b'5aade17', b'Release' However, a problem seems to be left about Exportor. Only two are output among three vertex group which were defined when you export it with an attached file. [3ColorsGroups.blend](https://archive.blender.org/developer/F186573/3ColorsGroups.blend) Group is managed in the definition of the obj file as face. I think that edge is managed as a special case of face. The exporter uses data of vertex included in face to find vertex group to belong to of face. However, vertex is shared in plural face. It is necessary to check whether all vertex included in face belongs to group if exporter finds vertex group to belong to of face. The current exporter does not confirm it. I remodeled this export_obj.py not to output unnecessary material. However, I remodel nothing about the problem that I showed here. [export_obj.py](https://archive.blender.org/developer/F186575/export_obj.py)
Author

In the case of these, the current exporter does not work definitely about group either.
2Colors.blend
OneGroup.blend

In the case of these, the current exporter does not work definitely about group either. [2Colors.blend](https://archive.blender.org/developer/F186585/2Colors.blend) [OneGroup.blend](https://archive.blender.org/developer/F186586/OneGroup.blend)

You cannot expect such vgroup layout to be exported fully, 'blue' face also completely belongs to 'green' vgroup (its four vertices belong to it). Such overlapping of vgroups simply cannot be represented correctly in OBJ (in fact, if 'green' group were to be the first defined, you would even get a single 'group' in generated .obj file)

You cannot expect such vgroup layout to be exported fully, 'blue' face also completely belongs to 'green' vgroup (its four vertices belong to it). Such overlapping of vgroups simply cannot be represented correctly in OBJ (in fact, if 'green' group were to be the first defined, you would even get a single 'group' in generated .obj file)
Author

@Bastien Montagne:
I think that it is wrong.
If you watch generated .obj file, the reason is clear.
"g BlueGroup" is not output in that.

@Bastien Montagne: I think that it is wrong. If you watch generated .obj file, the reason is clear. "g BlueGroup" is not output in that.
Author

I think that the reason that "g BlueGroup" cannot output is just what you showed it.
I understand it.

I think that the reason that "g BlueGroup" cannot output is just what you showed it. I understand it.
Author

vertex group recognizes the following images to be the same.
It is understood that it is this cause.
{F187251}screen2.png

Then I want to confirm only one.
Generate obj file using an attached file.
Import them in Split by objects.
Is it right that vertex group is not generated?
3ColorsGroups2Plus1.blend

vertex group recognizes the following images to be the same. It is understood that it is this cause. {[F187251](https://archive.blender.org/developer/F187251/screen.png)}![screen2.png](https://archive.blender.org/developer/F187253/screen2.png) Then I want to confirm only one. Generate obj file using an attached file. Import them in Split by objects. Is it right that vertex group is not generated? [3ColorsGroups2Plus1.blend](https://archive.blender.org/developer/F187256/3ColorsGroups2Plus1.blend)
Author

I make the above-mentioned attached file to be able to recognize vertex group definitely.

I make the above-mentioned attached file to be able to recognize vertex group definitely.
Author

It is difficult to output it in .obj file as a user aimed at overlapped vertex group.
Then I think that you should output it in form of the straight fact.
If a domain repeats, you output the same domain in the plural groups.
I think that it turns out good in at least 'Splits by groups'.
For example, it is such obj file.
3ColorsGroups_1.7z

It is difficult to output it in .obj file as a user aimed at overlapped vertex group. Then I think that you should output it in form of the straight fact. If a domain repeats, you output the same domain in the plural groups. I think that it turns out good in at least 'Splits by groups'. For example, it is such obj file. [3ColorsGroups_1.7z](https://archive.blender.org/developer/F187280/3ColorsGroups_1.7z)
Author

About the above-mentioned question from me.
I found what was listed in a source file when vertex Group did not support it when 'Split by objects' was appointed.

About the above-mentioned question from me. I found what was listed in a source file when vertex Group did not support it when 'Split by objects' was appointed.
Author

When I export it with an option of 'Objects as OBJ Objects' using an attached file, dummy material is output.
Attached export_obj.py is remodeled not to output dummy material.
IncludeNonMaterials.blend
export_obj.py
However, current Importer is not reflected definitely when plural object is included in obj file because they do not manage the material every object.
When plural object is included in obj file because they do not initialize context_material every object, current importer does not act definitely.
This is the case that used 'Splits by object '.
Attached import_obj.py is remodeled to initialize context_material every object.
import_obj.py

When I export it with an option of 'Objects as OBJ Objects' using an attached file, dummy material is output. Attached export_obj.py is remodeled not to output dummy material. [IncludeNonMaterials.blend](https://archive.blender.org/developer/F187330/IncludeNonMaterials.blend) [export_obj.py](https://archive.blender.org/developer/F187332/export_obj.py) However, current Importer is not reflected definitely when plural object is included in obj file because they do not manage the material every object. When plural object is included in obj file because they do not initialize context_material every object, current importer does not act definitely. This is the case that used 'Splits by object '. Attached import_obj.py is remodeled to initialize context_material every object. [import_obj.py](https://archive.blender.org/developer/F187333/import_obj.py)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#44947
No description provided.