armory icon indicating copy to clipboard operation
armory copied to clipboard

Set material param RGB Node

Open t3du opened this issue 2 years ago • 1 comments

scene1 object1 material1 scene2 object2 material1

it seems if object1 is spawned from scene1 to scene2, if i use the set material param rgb node with per object option disabled, only object1 changes color, even though both object1 and object2 share the same material1. If i check the name of the material of object1 which was spawned is still material1, but it appears is not referencing to the same material1 of object2.

System Blender: 3.3.0 Armory: 202301 OS: Windows 10

t3du avatar Jan 20 '23 19:01 t3du

Apparently individual scenes export separate materials, even if the material is from the same data-block originally?

image

I was able to find a workaround to the issue without touching source code by:

  1. Getting the material per object instead of by data-block.

image

  1. Running the logic in both scenes. Interestingly, I also discovered for the second scene (which I spawn in), I only need to run the logic on one of the objects from the second scene for all of those scene's objects to copy the same logic. NOTE: If the code is not run in the second scene on at least one object, the logic will not affect that scene's materials at all, even if run by the first/original scene.

I think material constants are the issue here.. I personally cannot seem to figure out whether it's a Python or Haxe side of things.

rpaladin avatar Mar 20 '23 22:03 rpaladin