Obj exporter does not respect "Apply Modifiers" settings #63399

Closed
opened 2019-04-08 19:19:46 +02:00 by kursad k · 12 comments
Member

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: a813e259d6, 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

**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
Author
Member

Added subscriber: @kursadk

Added subscriber: @kursadk

Added subscriber: @rjg

Added subscriber: @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.

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

Added subscriber: @Sergey

Added subscriber: @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 46eb5a0b8a @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 ?

Closed as duplicate of #63345

Closed as duplicate of #63345

@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 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?

Changed status from 'Duplicate' to: 'Open'

Changed status from 'Duplicate' to: 'Open'

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

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

Actually, re-opening as a stand-alone bug. It's somewhat related, but is not quite. Sorry for the noise. @rjg, yes, but the responsible code is some lines above. Committing the fix now..

This issue was referenced by df26f28835

This issue was referenced by df26f28835fb8a98760aef2f41d947579e95e73e

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

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

I think this modifier bug was affecting other exporters as well.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 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#63399
No description provided.