Compare commits

..

No commits in common. "master" and "blender-3" have entirely different histories.

3 changed files with 14 additions and 16 deletions

View File

@ -1,9 +1,5 @@
# Changelog # Changelog
2.0.0
- fixed: bone collection instead of layers for Blender 4+
1.8.1 1.8.1
- added: bone propertie search and active bone picker - added: bone propertie search and active bone picker

View File

@ -4,8 +4,8 @@ bl_info = {
"name": "Auto Walk", "name": "Auto Walk",
"description": "Develop a walk/run cycles along a curve and pin feets", "description": "Develop a walk/run cycles along a curve and pin feets",
"author": "Samuel Bernou", "author": "Samuel Bernou",
"version": (2, 0, 0), "version": (1, 8, 1),
"blender": (4, 0, 0), "blender": (3, 0, 0),
"location": "View3D", "location": "View3D",
"warning": "", "warning": "",
"doc_url": "https://gitlab.com/autour-de-minuit/blender/auto_walk", "doc_url": "https://gitlab.com/autour-de-minuit/blender/auto_walk",

22
fn.py
View File

@ -9,7 +9,11 @@ def get_addon_prefs():
function to read current addon preferences properties function to read current addon preferences properties
access with : get_addon_prefs().super_special_option access with : get_addon_prefs().super_special_option
''' '''
return bpy.context.preferences.addons[__package__].preferences import os
addon_name = os.path.splitext(__name__)[0]
preferences = bpy.context.preferences
addon_prefs = preferences.addons[addon_name].preferences
return (addon_prefs)
def open_addon_prefs(): def open_addon_prefs():
'''Open addon prefs windows with focus on current addon''' '''Open addon prefs windows with focus on current addon'''
@ -735,15 +739,14 @@ def go_edit_mode(ob, context=None):
def get_visible_bones(ob): def get_visible_bones(ob):
'''Get name of all editable bones (unhidden *and* on a visible bone layer)''' '''Get name of all editable bones (unhided *and* on a visible bone layer'''
# visible bone layer index
## list names visible_layers_indexes = [i for i, l in enumerate(ob.data.layers) if l]
visible_bones_collection = [c.name for c in ob.data.collections_all if c.is_visible] # check if layers overlaps
## check if layers overlaps
visible_bones = [b for b in ob.data.bones \ visible_bones = [b for b in ob.data.bones \
if not b.hide and any((col.name in visible_bones_collection for col in b.collections))] # is in a visible bone collection if not b.hide \
if any(i for i, l in enumerate(b.layers) if l and i in visible_layers_indexes)]
return visible_bones return visible_bones
@ -757,7 +760,6 @@ def get_x_pos_of_visible_keys(ob, act):
## skip offset + fcu related to invisible bones ## skip offset + fcu related to invisible bones
viz_bones = get_visible_bones(ob) viz_bones = get_visible_bones(ob)
print('viz_bones: ', viz_bones)
visible_bone_names = [b.name for b in viz_bones] visible_bone_names = [b.name for b in viz_bones]
keys = [] keys = []