Page MenuHome

changing scene and applying modifiers
Closed, ResolvedPublic


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, rBa813e259d630
Worked: rBb936d7b16c62

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 rBb936d7b16c62, but doesn't any longer, since at least rBa813e259d630.
I'm assuming it has to do with rB46eb5a0b8a4f 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!



Event Timeline

MACHIN3 (MACHIN3) updated the task description. (Show Details)
MACHIN3 (MACHIN3) updated the task description. (Show Details)
Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.
This comment was removed by Robert Guetzkow (rjg).

@MACHIN3 (MACHIN3), the issue is fixed by rBdf26f28835f, 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.

I think rBb7a09114f66f reintroduced the problem, after it was fixed by rBdf26f28835f as you mentioned.

@MACHIN3 (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..

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?

MACHIN3 (MACHIN3) closed this task as Resolved.May 23 2019, 9:48 AM

Yep, thank you!