Blender 5.1#106
Open
augmero wants to merge 23 commits intoaresdevo:masteraresdevo/animaide:masterfrom
Open
Conversation
Refactor fcurve handling by introducing helper functions to retrieve fcurves for actions, manage keyframes, and clone fcurves. This improves code readability and maintainability.
Update color handling for graph editor based on Blender version.
- Update bl_info version to (5, 1, 0) and addon version to (1, 1, 0) - Fix valid_fcurve(): guard are_frames_selected_in_fcurve check to GRAPH_EDITOR only, so Dope Sheet tools (smooth, blend left, etc.) work - Fix _get_or_create_default_slot_layer_strip(): create default OBJECT slot when action.slots is empty (needed for animaide masking action in 5.0+) - Add BLENDER_5_1_COMPATIBILITY.md audit document
TimelineMarker does not support IDProperties in Blender 5.0+.
Replace marker['side']/marker.get('side') lookups with marker.name
comparisons - markers are already named 'L' or 'R' (side + empty name),
so name-based lookup is equivalent and works in all Blender versions.
marker.get('side') throws TypeError in Blender 5.1 because TimelineMarker
no longer supports IDProperties. Replace with marker.name comparisons.
All add_marker() calls use name='' so markers are always named exactly
'L' or 'R' - name-based lookup is correct and equivalent.
Also fix iterator-invalidation bug in remove_marker(): collect markers
to remove first, then remove them outside the iteration loop.
Shear crash (AttributeError: FCurve has no .remove): shear_curves_list[0] is an FCurve object, not a collection. Replace shear_curves_list[0].remove() with shear_curves.remove() which correctly calls remove() on the fcurves collection. Dope sheet applying to unselected keys: keys_are_selected accumulates across all objects but is stored per-object at the time each object is processed. Objects processed before any selection was found stored False, causing the cursor fallback to fire for all their fcurves even when another object had explicit selections. After the full loop, propagate the final global keys_are_selected=True to all objects so to_execute() correctly skips unselected fcurves across all objects.
- Remove print(fcurve.data_path) debug statement (was printing every bone path on every tool use, bad performance) - Add ANIMAIDE_OT_randomize: standalone Randomize button below Wave-Noise. Uses same noise mechanism as wave_noise but with randomized phase (random.uniform(-1,1)) so each press gives different random offsets. Extracted from personal-tweaks wave_noise integration. - Add RANDOMIZE to menu_items selector enum (id 19) - Register ANIMAIDE_OT_randomize in classes tuple - Add randomize button to panel, menu, and pie UI locations
Remove factor > 0 guard so dragging left also randomizes. Negative factor naturally inverts the noise displacement direction.
utils/key.py some_selected_key():
valid_anim() now returns bool (not fcurves), causing
'TypeError: bool object is not iterable' when iterating.
Replace with direct get_fcurves_for_action() + get_fcurves_list()
and guard valid_obj() at the top. Also fix return value to False
consistently (was returning None on early exit).
key_manager/support.py delete_by_type():
- Replace action.fcurves with get_fcurves_for_action() +
get_fcurves_list() for Blender 5.1 slot-based action compatibility
- Add None guard for obj.animation_data.action
- Fix AttributeError: access fcurve.group.name through getattr()
since fcurve.group can be None
- Remove debug print() statements
anim_offset/ops.py:
Remove print() calls from modal operator event handler.
These fired on every LEFTMOUSE and MOUSEMOVE event (hundreds
of times per second while dragging), flooding the console.
__init__.py:
Remove print('init') from load_post_handler. Fired on every
file open and addon reload.
utils/curve.py create_path():
Remove 8 debug print() calls from dead-code function.
utils/curve.py get_all_fcurves():
Fix AttributeError when obj has no shape keys. Previously did
obj.data.shape_keys.animation_data.action which crashes when
shape_keys is None. Now uses chained getattr() guards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.