Maniphest T101272

Missing view layer updates handling collections in python
Closed, ResolvedBUG

Assigned To
Jeroen Bakker (jbakker)
Authored By
paul geraskin (mifth)
Sep 22 2022, 2:25 PM
Tags
  • BF Blender
  • Python API
  • Core
Subscribers
Bastien Montagne (mont29)
Germano Cavalcante (mano-wii)
Jeroen Bakker (jbakker)
Monique Dewanchand (mdewanchand)
paul geraskin (mifth)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Windows 11
Graphics card: NVidia

Blender Version
Broken: Blender 3.4.0 Alpha
Worked: Blender 2.93-3.2

Caused by rB68589a31ebfb: ViewLayer: Lazy sync of scene data.

Short description of error
The code in the Blend file worked well in Blender 2.93-3.2 but it's broken in Blender 3.4.
There is a fix to update a viewLayer but probably this is a bug?

My Blend file (Tested in Blender 3.4):

Exact steps for others to reproduce the error

  • Open my blend file in Blender 3.4
  • Run Pyhon code.

Revisions and Commits

rB Blender

Related Objects

Mentioned In
T101394: Importing file after making a new collection active hits an assert (View Layer Object Base out of sync)
Mentioned Here
rB68589a31ebfb: ViewLayer: Lazy sync of scene data.
rBe00f76c6a8cc: ViewLayer: fix missing sync in object APIs (fixes T101128, T101204)

Event Timeline

paul geraskin (mifth) created this task.Sep 22 2022, 2:25 PM
paul geraskin (mifth) updated the task description.Sep 22 2022, 2:27 PM
paul geraskin (mifth) updated the task description.
paul geraskin (mifth) updated the task description.
Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Sep 23 2022, 2:41 AM
Germano Cavalcante (mano-wii) triaged this task as High priority.
Germano Cavalcante (mano-wii) added a project: Python API.
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".
Germano Cavalcante (mano-wii) added a subscriber: Germano Cavalcante (mano-wii).

Probably caused by rB68589a31ebfb: ViewLayer: Lazy sync of scene data.

To fix it, maybe we could add a BKE_view_layer_synced_ensure as done in rBe00f76c6a8cc

Although a regression, I'm not sure it has high priority. The workaround seems valid.

Philipp Oeser (lichtwerk) added a project: Core.Sep 23 2022, 8:18 AM
Philipp Oeser (lichtwerk) added subscribers: Monique Dewanchand (mdewanchand), Bastien Montagne (mont29), Philipp Oeser (lichtwerk).

CC @Monique Dewanchand (mdewanchand)
CC @Bastien Montagne (mont29)

Philipp Oeser (lichtwerk) renamed this task from Python error in Blender 3.4 to Missing view layer updates handling collections in python.Sep 23 2022, 8:18 AM
Philipp Oeser (lichtwerk) updated the task description.
Jeroen Bakker (jbakker) added a subscriber: Jeroen Bakker (jbakker).Sep 25 2022, 6:37 PM
Jeroen Bakker (jbakker) added a comment.Sep 25 2022, 6:52 PM

I pushed a branch temp-T101272 with a potential fix, still WIP.

Jeroen Bakker (jbakker) claimed this task.Sep 25 2022, 6:52 PM
Jeroen Bakker (jbakker) closed this task as Resolved by committing rB4a60c4746ddf: Fix T101272: Missing view layer updates handling collections via python..Sep 27 2022, 11:59 AM
Jeroen Bakker (jbakker) added a commit: rB4a60c4746ddf: Fix T101272: Missing view layer updates handling collections via python..