Getting the ICE tree view from a menu callback

Good tip from eX-SI blog, former developer at Softimage and later Autodesk

eX-SI

How do you get the ICE Tree view in a menu callback? For example, if you add a menu item to the ICE Tree > User Tools, how does the menu item callback get the ICE Tree view?

The answer is actually in code I posted before, but that was in a blog post titled Getting the selected ICE nodes. So, with that title, you wouldn’t necessarily think to look there.

So what’s the answer? Uses Context.GetAttribute( “Target” ). For custom menus in the views like the ICE Tree view, the Fcurve Editor, and the Material Manager, the Target attribute is the View object. And once you have the View object, you can get the View attributes.

Soapbox alert…
This post illustrates why indexes are a good thing…with them, you can find information no matter what page or heading contains the information.
For ICE trees, you’d…

View original post 20 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s