Notifications
Clear all

[Closed] filtering selection

hey all,
I just want to filter geometry with particulars material applies from a selection set.
I ve done that yet but I apply the filter on each function and I am not able to set this globally over the functiun.

spinner smpl “Samples:” range:[4,128,16]
on smpl changed val do
(for i in mysel where superClassOf i == GeometryClass and (classof i.material) == Arch___Design__mi do i.material.opts_ao_samples = val)

on every button or spinner I past that entire filter. How to tell this just once?
thank you for help

3 Replies

Put the code into a function:


 fn updateMaterial =
 (
 for i in mysel where superClassOf i == GeometryClass and (classof i.material) == Arch___Design__mi do i.material.opts_ao_samples = val
 )
 
 spinner smpl "Samples:" range:[4,128,16]
 
 on smpl changed val do updateMaterial() 

I think that’s what your asking, oui!?

thank you Dave
That s not really what I expect…

I have many others spinner, your code need to create a function by spinner

I want the following filter to be applied globally over the script…
maybe with a global?

“where superClassOf i == GeometryClass and (classof i.material) == Arch___Design__mi”

Or create a filter function…

function FilterFunction Obj =
(
return ((superClassOf Obj == GeometryClass) and ((classof Obj.material) == Arch___Design__mi))
)

like

for obj in mysel where (FilterFunction(obj)) do obj.material.opts_ao_samples = val

Hope it helps…