Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-13 Thread Gerard Gmail
This looks interesting Roy. Thanks for the suggestion. Formatting looks crazy on my phone, but I'll test it out on Monday morning when I'm back on the box. Have a great weekend all. Gerard. Sydney, Australia. On 13/03/2015, at 6:16 AM, Roy Nieterau wrote: > Just to get geeky and not sur

Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-12 Thread Roy Nieterau
Just to get geeky and not sure if it's any faster but here's another version. ;) import maya.cmds as mc import itertools def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter(iterable)] *

Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Gerard v
Hey there Chris. Thanks for the code I'll take a gander. Fuel catchup was great. Haven't seen any of the old team in quite some time. Cheers. G. On Thu, Mar 12, 2015 at 12:45 PM, Chris Gardner wrote: > hey gerard, > > nice to see you at the pub the other day :) > > here's some API code for looki

Re: [Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Chris Gardner
hey gerard, nice to see you at the pub the other day :) here's some API code for looking for custom attrs called "tags" and then looking for a string inside that. it's a bunch faster than maya cmds. adapt as necessary. it's filtering on transform nodes currently, but you could change that for you

[Maya-Python] fasted way to search for nodes based on attr, and under hierarchy?

2015-03-11 Thread Gerard v
Hi all. I am trying to determine the most efficient way to search for nodes (transforms) of specified types (eg transform of a curve) under a hierarchy (lets call it 'top_node') that have a specific custom (string) attribute. When potentially dealing with a large number of nodes speed becomes a fa