MIteratorType::setFilterList not working with some types?

14 views
Skip to first unread message

Christopher Crouzet

unread,
Jul 4, 2016, 9:52:25 PM7/4/16
to python_in...@googlegroups.com
Hi,

Is anyone else having issues with the method `OpenMaya.MIteratorType::setFilterList` working with some types but not with others? Using `OpenMaya.MFn.kDagNode` for example returns an iterator over a valid number of objects, but `OpenMaya.MFn.kTime` doesn't.


    from maya import OpenMaya

    type_to_look_for = OpenMaya.MFn.kTime
    # type_to_look_for = OpenMaya.MFn.kDagNode

    filter_list = OpenMaya.MIntArray()
    filter_list.append(type_to_look_for)
    iterator_type = OpenMaya.MIteratorType()
    iterator_type.setFilterList(filter_list)
    iterator = OpenMaya.MItDependencyNodes(iterator_type)

    count = 0
    while not iterator.isDone():
        count += 1
        iterator.next()

    print(count)



In this snippet I'd expect `count` to be 1 but instead no nodes were found. Tested on Maya 2016 SP6.

Cheers!

--
Reply all
Reply to author
Forward
0 new messages