Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
289455148f |
@ -1,5 +1,9 @@
|
|||||||
# 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
|
||||||
|
@ -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": (1, 8, 1),
|
"version": (2, 0, 0),
|
||||||
"blender": (3, 0, 0),
|
"blender": (4, 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",
|
||||||
|
20
fn.py
20
fn.py
@ -9,11 +9,7 @@ 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
|
||||||
'''
|
'''
|
||||||
import os
|
return bpy.context.preferences.addons[__package__].preferences
|
||||||
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'''
|
||||||
@ -739,13 +735,14 @@ def go_edit_mode(ob, context=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_visible_bones(ob):
|
def get_visible_bones(ob):
|
||||||
'''Get name of all editable bones (unhided *and* on a visible bone layer'''
|
'''Get name of all editable bones (unhidden *and* on a visible bone layer)'''
|
||||||
# visible bone layer index
|
|
||||||
visible_layers_indexes = [i for i, l in enumerate(ob.data.layers) if l]
|
## list names
|
||||||
# check if layers overlaps
|
visible_bones_collection = [c.name for c in ob.data.collections_all if c.is_visible]
|
||||||
|
|
||||||
|
## 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 \
|
if not b.hide and any((col.name in visible_bones_collection for col in b.collections))] # is in a visible bone collection
|
||||||
if any(i for i, l in enumerate(b.layers) if l and i in visible_layers_indexes)]
|
|
||||||
|
|
||||||
return visible_bones
|
return visible_bones
|
||||||
|
|
||||||
@ -760,6 +757,7 @@ 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 = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user