( parameter, parameterPath, uiPath, classTypeFilter, classNameFilter, result )
| 64 | return result |
| 65 | |
| 66 | def __findClassesWalk( parameter, parameterPath, uiPath, classTypeFilter, classNameFilter, result ) : |
| 67 | |
| 68 | if isinstance( parameter, IECore.ClassParameter ) : |
| 69 | cl = parameter.getClass() |
| 70 | if cl and isinstance( cl, classTypeFilter ) and classNameFilter.match( cl.path ) : |
| 71 | result.append( |
| 72 | { |
| 73 | "parent" : parameter, |
| 74 | "parameterPath" : parameterPath, |
| 75 | "uiPath" : uiPath, |
| 76 | "classInstance" : cl |
| 77 | } |
| 78 | ) |
| 79 | elif isinstance( parameter, IECore.ClassVectorParameter ) : |
| 80 | cls = parameter.getClasses( True ) |
| 81 | for cl in cls : |
| 82 | if isinstance( cl[0], classTypeFilter ) and classNameFilter.match( cl[0].path ) : |
| 83 | |
| 84 | label = cl[1] |
| 85 | if cl[0].parameters().has_key( "label" ) : |
| 86 | label = cl[0]["label"].getTypedValue() |
| 87 | |
| 88 | result.append( |
| 89 | { |
| 90 | "parent" : parameter, |
| 91 | "parameterPath" : parameterPath + [ cl[1] ], |
| 92 | "uiPath" : uiPath + [ label ], |
| 93 | "classInstance" : cl[0] |
| 94 | } |
| 95 | ) |
| 96 | |
| 97 | if isinstance( parameter, IECore.CompoundParameter ) : |
| 98 | for n, p in parameter.items() : |
| 99 | newParameterPath = parameterPath[:] + [ n ] |
| 100 | newUIPath = parameterPath[:] + [ n ] |
| 101 | __findClassesWalk( p, newParameterPath, newUIPath, classTypeFilter, classNameFilter, result ) |
| 102 | |
| 103 | ## Recurses down from srcParameter and dstParameter simultaneously, syncing the dstParameter tree to |
| 104 | # srcParameter by making sure the ClassParameters and ClassVectorParameters there hold instances of the same classes |
no test coverage detected