Notifications
Clear all

[Closed] Creating node arrays – issue

Heya

I’m trying to collect specific objects and add them to array that then I want to plug to lens node.
Here is working test code:

ar = #()
append ar $Box002
append ar $Box003
shad = renderers.current.Camera_Lens_Shader
shad.objects = ar

And here is code that I want to use as it allowed me to input custom objects:

shad = renderers.current.Camera_Lens_Shader
ar = #()
aa= (for o in objects where o.gbufferChannel == 2  collect o)
bb = (for o in objects where o.gbufferChannel == 3  collect o)
append ar $aa
append ar $bb
shad.objects = ar

Can any1 help me out with it? Can figure out why its not working or how else I can approach it.

1 Reply

$aa and $bb are objects named “aa” and “bb” not your arrays. The question is do you need one array with objects that have buffer channel 2 and 3, or should it be 2 nested arrays?
single array = #(obj1,obj2,obj3,obj4)
nested arrays = #(#(obj1,obj2),#(obj3,obj4))

-Eric