Select all objects with same Material Modifier ID

Select all objects with same Material Modifier ID

n_stylee
Contributor Contributor
8,057 Views
7 Replies
Message 1 of 8

Select all objects with same Material Modifier ID

n_stylee
Contributor
Contributor

Hello i have this script that is selecting all and only objects with turbosmooth  - 1 interactions 

 

select (for o in geometry where try (o.TurboSmooth.iterations == 1 ) catch(false) collect o )

 

How i can modify it, so it will be selecting all objects that are having Material  Modifier  applied  with a  certain  ID ( lets say only id-3   ) ? Somehow it works with  other modifiers like Bend - with certain angle but not with Material Modifier. 

 

 

 

0 Likes
Accepted solutions (2)
8,058 Views
7 Replies
Replies (7)
Message 2 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

 

for node in geometry where (m = node.modifiers[Materialmodifier]) != undefined and m.materialID == 3 collect #(node, m)

 

0 Likes
Message 3 of 8

n_stylee
Contributor
Contributor

Thank you for fast answer but its not working - it doesn't select anything . 

0 Likes
Message 4 of 8

denisT.MaxDoctor
Advisor
Advisor

I charge 10 bucks for each node selected... Maybe it would be cheaper to find out how to do it yourself?

0 Likes
Message 5 of 8

MartinBeh
Advisor
Advisor

Just look at the code you posted and Denis posted...

 

All you need is 

 

select (for node...

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 6 of 8

n_stylee
Contributor
Contributor

select ( for node in geometry where ( m = node.modifiers[Materialmodifier]) != undefined and m.materialID == 3 collect #(node, m))

 

nothing 😞

0 Likes
Message 7 of 8

MartinBeh
Advisor
Advisor
Accepted solution

@n_stylee wrote:

select ( for node in geometry where ( m = node.modifiers[Materialmodifier]) != undefined and m.materialID == 3 collect #(node, m))

 

nothing 😞


because Denis is thorough and collects not only the node but also the modifier... 😉

 

Try this:

 

select ( for node in geometry where ( m = node.modifiers[Materialmodifier]) != undefined and m.materialID == 3 collect node)

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 8 of 8

n_stylee
Contributor
Contributor

Thank you so much it`s working! 

0 Likes