I have an object called origin
with 272 meshes/faces and Float Property Layers
(called random_layer
), i.e. every mesh has a its own attribute. You can see random values in the Data -> Outliner -> Data API (see screenshot).
Goal: I want to use the values of the random_layer
to manipulate shaders/nodes.
Already tried: To get the values, I tried to use the Attribute Node
calling it with the name random_layer
, or ["random_layer"]
, but with no luck. I tried to wire the the three output nodes, but all seem to output 0.0. Setting the name
to Col
(for Vertex Colors
) works fine.
The object has a material ('TheOne') using a Vertex Color
node, this is working.
I have searched and found this: Use custom properties (variable values) in the node editor
However, this is not actually using the values of the Float Property Layers
, but rather the graph editor. Also, my values are static and not dynamic.
Any help or pointers are much appreciated.
Setup
- Win10 Pro
- Blender 2.81a
- Engine: Cycles (also tried Eevee)
- Add-ons: 'Node Wrangler' and 'Sun Position'
Update
just to clarify how the float layer is created. mesh_object
is an intermediate object for one mesh/cell/face that you see in the screenshot.
random_layer = mesh_object.data.polygon_layers_float.new(name="random_layer")
random_layer.data[mesh_object.data.polygons.active].value = random.uniform(0.0, 1.0)
bpy.ops.object.mode_set(mode='EDIT')
random_layer = bm.faces.layers.float.get(random_layer.name)
Also I am using the experimental 2.82a