On Tue, Oct 29, 2013 at 12:28 AM, Bay <[email protected]> wrote:

> AttributeError: 'NoneType' object has no attribute 'childCount'


Can you show the code that is calling childCount()?

In Node.row() there is a check to see that self._parent is not None before
attempting to execute any operations for self._parent. From
SceneGraphModel.rowCount(), parent is provided as an argument. The code
that calls rowCount should make sure parent is valid, or that validation
can be added to the rowCount() directly.

Without having a more complete view of what you are working on it's hard to
provide much more input in regards to this specific error.

There are plenty of ways to handle the validation. For example, you can
test type() or hasattr() before executing code that expects the special
methods or attributes to be available.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CANESWi0VWOW%3D6H7nWFdcCJ_dX2rLEHarYU3JA6R%3DoeOU6rSXoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to