Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material mix error (BlendLuxCore Wheels v2.9a3) #961

Open
EgertKanep opened this issue Jan 11, 2025 · 4 comments
Open

Material mix error (BlendLuxCore Wheels v2.9a3) #961

EgertKanep opened this issue Jan 11, 2025 · 4 comments
Assignees

Comments

@EgertKanep
Copy link

Steps to reproduce:
Make a mix material and mix 2 materials

Screenshots or rendered images:

Error message from Blender console:
Reference to an undefined NamedObject name: 133918571256072Material

OS: Ubuntu 24.04 LTS
Blender version: 4.2.5 LTS
LuxCore version:2.9.0

@CodeFHD
Copy link
Member

CodeFHD commented Jan 11, 2025

I can't reproduce the error under Linux or Windows using Mix material alone.

Could you provide a test scene? It might be connected to further setup aspects like volumes.
Quick search did yield a similar issue reported on the forum:
https://forums.luxcorerender.org/viewtopic.php?p=1301#p1301

@EgertKanep
Copy link
Author

I have now made a bit more detailed test with this issue.

Steps to reproduce

  1. Make a blender scene, assign mix material to object, mix any shader. Save the scene
  2. Make a new blender scene. File -> Link -> Scene. Start rendering, at this point everything loads.
  3. Go back to the original scene made and adjust any shader parameter, save file.
  4. Go to second blender file and reload the linked file. then I get error (Reference to an undefined NamedObject name: 129294725863944Material)
  5. To fix this I need to go to solid mode and then to rendered mode again.
  6. When mix material node is not use, I do not experience this problem and after reloading linked files there is no error and scene is refreshed and start rendering.
    Test_files.zip

@CodeFHD
Copy link
Member

CodeFHD commented Jan 12, 2025

Okay I finally managed to reproduce it. There were two key details here:

  1. Both scenes are opened in parallel and stay opened. You posted on Discord about your dual-PC setup, that gave me the idea. I initially tried with one Blender session switching between them.
  2. Then, reloading the linked file via the outliner/Blender file menu while still in rendered view.

Have to investigate further if:

  1. The change of material name is down to BlendLuxCore (possibility that we improve) or Blender itself (we need to work around)
  2. The scene export to LuxCore is triggered at all (or correctly) when the linked update is happening

@CodeFHD CodeFHD self-assigned this Jan 12, 2025
@CodeFHD
Copy link
Member

CodeFHD commented Jan 13, 2025

Update:

First, little clarification, the error actually appears even if there was no change to the linked material. Simply calling a refresh on the linked file in the second scene is enough.

Regarding the error: This seems to be triggered by this line:

props.Set(mat_props)

In the whole scene/material chain, this is the second time the Properties.Set()method is called, the first being here:

scene_props.Set(mat_props)

Looking at the content of (scene_)props, the first time there are no new names pushed. The second time, additional keys appear which seem to be the material properties of the materials going into the mix shader, but not the mix shader itself. These new keys then trigger the error.

This suggests to me that the material key generation on the second time produces a bad result.
To be investigated further.

Simply commenting out the erroneous second instance seems to fix the error, the material is updated correctly after a change in the first scene. However care should be taken what other side effect this will have. I assume the code is not there for no reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants