Re-visting MotionBuilder’s Python Dir()

In a previous post I briefly talked about the dir() command within python. The dir() command is an invaluable tool when trying to discover valid attributes.

This is going to be a very quick post on how I have been using the print dir() command to list out attribute with a vertical read out instead of a horizontal read out.

here is an example for both horizontal and vertical to better illustrate:

## Horizontal Read out
print dir(FBApplication())

## Vertical Read out
for items in dir(FBApplication()):
    print items

I personally prefer the vertical read out, I find it easier to read and search through.

As always, I hope this helps. 🙂


Add a Comment

Your email address will not be published. Required fields are marked *