Maniphest T63399

Obj exporter does not respect "Apply Modifiers" settings
Closed, Resolved

Assigned To
None
Authored By
kursad k (kursadk)
Apr 8 2019, 7:19 PM
Tags
  • BF Blender
Subscribers
kursad k (kursadk)
Robert Guetzkow (rjg)
Sergey Sharybin (sergey)

Description

System Information
Operating system: Windows 10
Graphics card: GTX 1070

Blender Version
version: 2.80 (sub 53), branch: blender2.7, commit date: 2019-04-02 19:53, hash: a813e259d630, type: Release
build date: 02/04/2019, 18:01

Short description of error

The obj exporter does not seem to respect "use_mesh_modifiers=False" It always export as if it is set to "use_mesh_modifiers=True"

Exact steps for others to reproduce the error

  • Add Suzanne
  • Add Decimate modifier to Suzanne, set the value to 0.5
  • Open obj exporter
  • Make sure apply modifiers is unchecked, Selection only is checked
  • Export and imported it or check it out in a 3d viewer

As you see the mesh is exported with modifiers

Revisions and Commits

rB Blender

Related Objects

Mentioned Here
rB46eb5a0b8a4f: Tweak behavior of object.to_mesh()
rBa813e259d630: Fix T63220: Cannot make object single user after Duplicate Scene with Link…

Event Timeline

kursad k (kursadk) created this task.Apr 8 2019, 7:19 PM
kursad k (kursadk) updated the task description.Apr 8 2019, 7:31 PM
Robert Guetzkow (rjg) lowered the priority of this task from 90 to Low.EditedApr 8 2019, 7:49 PM
Robert Guetzkow (rjg) added a subscriber: Robert Guetzkow (rjg).

Looks like EXPORT_APPLY_MODIFIERS is set to False when the option is unchecked but to_mesh() or another function applies the modifiers regardless.

Robert Guetzkow (rjg) raised the priority of this task from Low to Normal.Apr 8 2019, 8:42 PM
Robert Guetzkow (rjg) added a subscriber: Sergey Sharybin (sergey).

The functions rna_Object_to_mesh(), rna_Main_meshes_new_from_object() and BKE_mesh_new_from_object() all get apply_modifiers set to false as it should be. Could it be that this is an error introduced in 46eb5a0b8a4f3a7826b5e5a1a11e114e09037dba @Sergey Sharybin (sergey) ?

Sergey Sharybin (sergey) closed this task as a duplicate of T63345: changing scene and applying modifiers.Apr 8 2019, 8:49 PM
Robert Guetzkow (rjg) added a comment.EditedApr 8 2019, 8:51 PM

@Sergey Sharybin (sergey) It seems to me that object_for_eval is set to the result of DEG_get_evaluated_object which has the modifiers applied, is used incorrectly in:

case OB_MESH:
			/* copies object and modifiers (but not the data) */
			if (cage) {
				/* copies the data (but *not* the shapekeys). */
				Mesh *mesh = object_for_eval.data;
				BKE_id_copy_ex(bmain, &mesh->id, (ID **)&tmpmesh, 0);
				/* XXX BKE_mesh_copy() already handles materials usercount. */
				do_mat_id_data_us = false;
			}

cage is true, if apply_modifiers isn't. Therefore mesh shouldn't be object_for_eval but the original mesh right?

Sergey Sharybin (sergey) changed the task status from Duplicate to Unknown Status.Apr 8 2019, 9:17 PM

Actually, re-opening as a stand-alone bug. It's somewhat related, but is not quite. Sorry for the noise.

@Robert Guetzkow (rjg), yes, but the responsible code is some lines above. Committing the fix now..

Sergey Sharybin (sergey) changed the task status from Unknown Status to Resolved by committing rBdf26f28835fb: Fix T63399: Obj exporter does not respect "Apply Modifiers" settings.Apr 8 2019, 9:21 PM
Sergey Sharybin (sergey) added a commit: rBdf26f28835fb: Fix T63399: Obj exporter does not respect "Apply Modifiers" settings.
kursad k (kursadk) added a comment.Apr 8 2019, 10:23 PM

I think this modifier bug was affecting other exporters as well.