[Bf-committers] access selection order via Python (Ton, Roosendaal)

Jacques Lucke mail at jlucke.com
Fri Feb 27 12:58:21 CET 2015


 

Hey all,
I just want to share how I solved this problem for the Animation Nodes
addon. I use the scene_update_post event and check if the selection
changed here:
https://github.com/JacquesLucke/animation-nodes/blob/master/utils/mn_selection_utils.py
[2] 

I know that this solution isn't optimal and adds some overhead when you
have a lot of objects, but in practice I never noticed a slowdown even
with more than 1000 selected objects. The advantage of this method over
some others is that it works with all existing selection methods like
circle select and it is transparent to the user. 

Jacques Lucke 

Am 2015-02-27 12:24, schrieb Martin Pyka: 

> Sounds good as a first start. How can I read the undo buffer via Python? 
> I just found bpy.ops.ed.undo_history(), but this command doesn't allow 
> me to see the command list like in the UI!?
> 
> Thx for the suggestion,
> Martin
> 
> On 02/27/2015 12:00 PM, bf-committers-request at blender.orgwrote:
> 
>> Just an idea: perhaps you can get this selection order information if you analyze the contents of the undo buffer. Bests, Fazek
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers [1]

 

Links:
------
[1] http://lists.blender.org/mailman/listinfo/bf-committers
[2]
https://github.com/JacquesLucke/animation-nodes/blob/master/utils/mn_selection_utils.py


More information about the Bf-committers mailing list