Skip to content

[Bug Report] Viewport crashes and terminal error spam due to luxcore_material_nodes in Blender 4.5.x #1054

@BangGang6969

Description

@BangGang6969

OS: Windows 11
Blender: 4.5.6 LTS
BlendLuxCore: 2.10.2
GPU: RTX 3090

Problem:
Constant error spam with this message
AttributeError: '_RestrictData' object has no attribute 'materials' Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\BlendLuxCore\nodes\materials\tree.py", line 37, in update for mat in bpy.data.materials:

Regullar crashes in Rendered viewport mode when editing scene (doesnt crash in standby)

Ai overview:
BlendLuxCore accesses bpy.data.materials from a NodeTree update() callback, which runs in a restricted context where bpy.data is _RestrictData. This causes repeated AttributeErrors, infinite error spam, and eventually Blender instability/crashes (especially in viewport).

Quick AI patch, fixed error spam, crashes less often:
in BlendLuxCore/nodes/materials/tree.py change

def update(self):
    import bpy
    ctx = bpy.context
    if not ctx or not hasattr(ctx, "blend_data"):
        return

    for mat in ctx.blend_data.materials:
        ...

This stops _RestrictData crashes and prevents infinite Python error spam.

After patching I get only this at launching:
WARN (bpy.rna): C:\Users\blender\git\blender-v450\blender.git\source\blender\python\intern\bpy_rna.cc:9468 bpy_class_call: unable to get Python class for RNA struct 'luxcore_material_nodes'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions