[Bf-committers] Getting the associated Blender object name from a uiBut object

The Simple Carnival jeff at simplecarnival.com
Mon Aug 7 03:39:04 CEST 2017


Hi Matt --

Thanks for the tip. I was able to get a proof-of-concept working going 
off of that code instead of dealing with the uiBut objects. I'll dig 
more into this, but I think I can make it work.

-Jeff


On 8/6/2017 5:15 PM, Matthew Keller wrote:
> Hi Jeff,
>
> Not sure if you've seen this, but there is a way to perform the 
> 'Restrict View' action in the ui recursively by pressing Ctrl while 
> clicking. This is the function that enables that behavior as far as I 
> can tell:
> https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_outliner/outliner_draw.c;f5f6f9c9ac3ec37ef98eae54464a801c2b7ddcc9$175
>
> They seem to be using the currently selected object and then iterating 
> through all the objects and checking every time if the object is a 
> child of the currently selected object.
>
> Could you follow that approach by setting the keyframe on the 
> underlying object as opposed to setting the keyframe on the button? 
> (there's even logic in there to actually set the keyframe, although 
> I'm not quite sure under what circumstances that functionality is 
> triggered)
>
> HTH,
>
> Matt



More information about the Bf-committers mailing list