changing scene and applying modifiers #63345

Closed
opened 2019-04-06 22:17:26 +02:00 by MACHIN3 · 12 comments

System Information
Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67

Blender Version
Broken: version: 2.80, a813e259d6
Worked: b936d7b16c

Short description of error
Creating a new scene or appending one, then making it the current scene, then copying an object from the previous scene and using
object.to_mesh() to apply the modifiers will fail to apply the modifiers. See the attached blend and the script for clarification.
This used to work just fine in b936d7b16c, but doesn't any longer, since at least a813e259d6.
I'm assuming it has to do with 46eb5a0b8a or similar changes at the time.

Exact steps for others to reproduce the error

  • open attached blend
  • run the script
    • the copy object's modifer will not have been applied
  • reload the blend, comment out the first scene change, and enable the second instead, and run the script again
    • the copy object's modifier will have been applied

I'm not even sure if this is a bug, or now expected behavior. In any case, I'd expect it to behave the same, whenever I do the scene change. Hence the report. If this is indeed expected behavior, I'd really appreciate an explanation, thanks!

apply_mods.blend

**System Information** Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67 **Blender Version** Broken: version: 2.80, a813e259d6 Worked: b936d7b16c **Short description of error** Creating a new scene or appending one, then making it the current scene, then copying an object from the previous scene and using `object.to_mesh()` to apply the modifiers will fail to apply the modifiers. See the attached blend and the script for clarification. This used to work just fine in b936d7b16c, but doesn't any longer, since at least a813e259d6. I'm assuming it has to do with 46eb5a0b8a or similar changes at the time. **Exact steps for others to reproduce the error** * open attached blend * run the script * the copy object's modifer will not have been applied * reload the blend, comment out the first scene change, and enable the second instead, and run the script again * the copy object's modifier will have been applied I'm not even sure if this is a bug, or now expected behavior. In any case, I'd expect it to behave the same, whenever I do the scene change. Hence the report. If this is indeed expected behavior, I'd really appreciate an explanation, thanks! [apply_mods.blend](https://archive.blender.org/developer/F6915810/apply_mods.blend)
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3

#63399 was marked as duplicate of this issue

#63399 was marked as duplicate of this issue
Sergey Sharybin was assigned by Sebastian Parborg 2019-04-07 21:01:44 +02:00

Added subscribers: @kursadk, @Sergey, @rjg

Added subscribers: @kursadk, @Sergey, @rjg

This comment was removed by @rjg

*This comment was removed by @rjg*

@MACHIN3, the issue is fixed by df26f28835, but this opens slightly different topic: the to_mesh function requires dependency graph to be evaluated. This means, constructing new scene and trying to do to_mesh from it will not give correct result.

This is one of the topics i wanted to raise with other developers during the homestretch, so keeping the report open for until some design decision is made here.

@MACHIN3, the issue is fixed by df26f28835, but this opens slightly different topic: the `to_mesh` function requires dependency graph to be evaluated. This means, constructing new scene and trying to do `to_mesh` from it will not give correct result. This is one of the topics i wanted to raise with other developers during the homestretch, so keeping the report open for until some design decision is made here.
Author

@Sergey Thanks, much appreciated!

@Sergey Thanks, much appreciated!
Author

I think b7a09114f6 reintroduced the problem, after it was fixed by df26f28835 as you mentioned.

I think b7a09114f6 reintroduced the problem, after it was fixed by df26f28835 as you mentioned.

@MACHIN3, ah, well. It worked by accident, by doing logic based on uninitialized variable. The issue is that the evaluated mesh is requested for a non-evaluated dependency graph. For some reason quick adjustments to the script didn't solve this. Looking deeper into it..

@MACHIN3, ah, well. It worked by accident, by doing logic based on uninitialized variable. The issue is that the evaluated mesh is requested for a non-evaluated dependency graph. For some reason quick adjustments to the script didn't solve this. Looking deeper into it..

Added subscriber: @brecht

Added subscriber: @brecht

I believe this may be solved by the latest API changes, in that if you ensure the depsgraph for the new scene is updated then to_mesh on the evaluated object should give the proper result?

I believe this may be solved by the latest API changes, in that if you ensure the depsgraph for the new scene is updated then `to_mesh` on the evaluated object should give the proper result?
Author

Changed status from 'Open' to: 'Resolved'

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

Yep, thank you!

Yep, thank you!
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
5 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#63345
No description provided.